Scrolling in code is bad - a necessary evil, obviously, but evil nonetheless. Vertical scrolling is bad because it causes what we were looking at to move and our eyes have to track and/or reacquire what we were looking at. It's obviously possible, but on the micro-scale it's expensive when you have to do it 1000 times per day of coding. Horizontal scrolling is even worse because not only is it harder to track visually, but we don't have nearly the same ease of use on our mouse to horizontally scroll as we do to vertically scroll. Just reacquiring where you were in the code takes up a miniscule amount of time and brain power that could be used for better purposes. Again, it doesn't seem like much, and you may dismiss me as being melodramatic, but this discussion is a recurring one for a reason. It's enough of a problem to bug people and want it to be different.
So to speak to Dan's point, trading vertical scrolling for horizontal scrolling would be a move in the wrong direction. But if you can reduce three lines to one WITHOUT causing horizontal scrolling, that benefits everyone, or at least everyone who uses a scroll wheel. On Sunday, July 2, 2023 at 1:55:31 AM UTC-4 Dan Kortschak wrote: > On Sat, 2023-07-01 at 22:34 -0700, Mike Schinkel wrote: > > > What is the difference to if err != nil { goto <label> } ? > > > > Thanks you for asking. > > > > If you run go fmt on a file that contains the formatting you ask > > about the line will be expanded to the 3 lines, which brings us back > > to status quo: > > > > if err != nil { > > goto <label> > > } > > > > Why is there a bias towards favouring horizontal code over vertical > code? > > In my experience, it's much easier to read and digest vertical code > compared to horizontal; Java (horribly horizontal in general) cf Go > (generally quite vertical). > > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/a6c91a61-e021-4888-8837-e9105b89537fn%40googlegroups.com.