back

by emptybits·3y ago·view on hn ↗
Kevin Wang, competitive coder: "I also try to minimize the amount of code I write: each line of code is just another chance for a typo."

Peter Norvig: This is why AlphaCode learned to write code with one-letter variable names, and with no comments or docstrings.

!!

3 comments
To be fair, unless you're doing something absurd the length of variable names shouldn't significantly affect the number of lines. Also comments with typos aren't really a problem. I don't like hard-to-read code either, but the more years I work the more I think that the shortest (within reason) code is the best code.

That is to say, golfing is bad unless for fun, shorter code is usually better, the shitty hard to read code is probably a reflection of human laziness rather than misguided tersity.

"If I had more time, I would have written shorter code"
Heh definitely an eyebrow-raising comment! On a second read of it though, I took it more as "because minimizing the code written is a pattern observed in the wild, AlphaCode mimics it as that's what it learned from."

I might be terribly wrong though. :-D

This is why neural networks need to have pain buttons that humans can repeatedly press. Of course that's how we get killbots.