Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The most obvious advantage here is that the code at the left is much more concise. This is good because then more code will fit in the same screen.

Not sure this is what Go needs though.



> Not sure this is what Go needs though.

Yep, a generics prototype would be better spent time.


I was actually going to include that in my comment. Go really needs generics.


How is more code on the same screen a good thing?


A lot of programmers seem to think that (the more code they can jam on the screen at a time the better, and thus any unnecessary newlines are superfluous), but I also don't understand why many are so rabid about it.

We generally don't code on 80x25 character terminals anymore, super high res monitors are cheap, vertical lines in code aren't a scarce commodity.

Personally I tend to like a fair amount of vertical whitespace (either in pure whitespace form or comments) in my code to split things up logically, even within the same function and when the newlines aren't required, eg:

  x = 10
  y = 20
  z = 0

  speed = 80
Variables assignments/func calls, etc that are closely coupled kept together, but some whitespace as things become less directly linked. I'd rather be able to quickly scan code in 10-40 line chunks than fit more code on the screen at once.


Many things are valuable. Conciseness per se is valuable (I don't think you will argue in favor of unnecessary verbosity in programming). However, of course this is just one of many factors, and any programming language will have to find a balance between these many factors, depending on how important each is, and so on.

If you think you are getting conciseness by decreasing readability then you probably have a balancing issue, but if you can get more concise code without decreasing readability then that's good news.


I comically interpreted your example of hi-res monitors as jamming more code on the screen at once.


2 lines is certainly better than 1 line. 10 better than 2. I don't know where it tops out, if ever.

100 chars/line better than 200. 60 better than 100. I don't know where it bottoms out.

That's how it's a good thing (not sure if you were being serious).


Less scorlling?

On the other hand many young developers these days seem to think, that scrolling is good and insert lots of blank lines everywhere.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: