2 ms·
I can't figure out why some developers love writing lines of code like that. It's like they think there is a cost for every line of code so they attempt to use
by 300bps 13y ago
I can't figure out why some developers love writing lines of code like that. It's like they think there is a cost for every line of code so they attempt to use the fewest lines possible while making their intent difficult to discern without comments.
I had a young developer work for me that did this all the time. He was actually quite brilliant - but he would put sometimes 20 statements into one line of code that would scroll past the end of the screen. It was difficult to discern intent but even worse it was impossible to debug. I asked him several times if he was taking his programming style from:
http://thc.org/root/phun/unmaintain.html http://thc.org/root/phun/unmaintain.html
- coldtea 13y ago>It's like they think there is a cost for every line of code Well, there is. More LOC is the most stable predictor of more bugs. Of course, complexity per LOC also matters.
- redblacktree 13y agoCode golfer.
- notdonspaulding 13y ago`but he would put sometimes 20 statements into one line of code` This is why Python's PEP8 recommends an 80 char limit on line length. Not because at column 81 the code magically becomes more complicated, but because if you're struggling to make it all fit on one line, it's probably a good sign that you need to factor out some complexity. Although you could certainly still write extremely terse (read: unreadable) code with less than 80 chars per line.