News for hackers. Stuff that matters.
Re:Avoid Else, Return Early (2013) by fyi1183 on Monday March 26, 2018 @09:29AM (#16678673)
Oh but it is, independent of the language. Fewer LOC means more code on the screen, which means you can more easily grasp the functionality of some piece of code, which makes it easier to maintain.
Re:Avoid Else, Return Early (2013) by jcelerier on Monday March 26, 2018 @11:17AM (#16679512)
> Fewer LOC means more code on the screen, which means you can more easily grasp the functionality of some piece of code,

uh ? for me the less code on each line and the easier it is to read

Re:Avoid Else, Return Early (2013) by Dylan16807 on Monday March 26, 2018 @10:57PM (#16684814)
When it comes to bracket placement, we're talking about empty lines. They don't affect the amount of code on a line.
Re:Avoid Else, Return Early (2013) by collyw on Tuesday March 27, 2018 @04:17AM (#16686376)
That depends. Python's pep guidelines has an 80 char wide rule, but I personally find that a lot harder to read than one long line (most of the time).
Re:Avoid Else, Return Early (2013) by extralego on Tuesday March 27, 2018 @04:34AM (#16686455)
I find the 80 chars too short but, and this is highly objective, I notice I am more relaxed and usually having more fun when working with shorter lines. The best theory a I have as to why is just that most lines in code are short so long lines require making my eyes deviate from the code structure. If there is a long line, it will probably be out of place. So, my personal rule is to avoid that one or two lines that juts out beyond the lines above and below it. If all lines in a block are long, they are often similar commands/expressions which makes them orderly, and not so discomforting.
Re:Avoid Else, Return Early (2013) by redblacktree on Wednesday March 28, 2018 @07:32PM (#16703088)
It's pretty sweet when you need to read code in a console that's limited to 80 characters. Also, it makes it easy to have two files opened side-by-side.