Friday, March 21, 2014

Who Prints Source Code Anymore?

As I am writing code, of course I find that my style reflects many decades of pet peeves and wants from writing code.  And nowadays, the programming editor is doing the formatting for me.  It adds spaces around the equal signs, indents, capitalizes, and more.  It allows me to build in self-documentation that pops up as I use my own code.  It is really a huge convenience, and greatly speeds up productivity.

But one thing occurred to me, as I type long lines the editor just scrolls around.  No problem, but then I am wont to go back, make the long lines shorter and go onto the next line, so that they are more readable without scrolling.  Great, but where did that come from?

Back in the old days when they came up with conventions for making code lines span multiple lines in the source file, it was primarily to control where the line breaks when you print it out, and also to reduce horizontal scrolling in the editor.  While the latter need is much reduced nowadays with wider screens, it's kind of funny to think the main reason was to make printed-out code more readable.  Thinking back to all my programming days throughout the decades, how many times did I print?  A lot in the old days, and never in the past what, 15 years or more?

So really, this is a fundamental Human trait - creatures of habit, with practices that stick around long after they are not only no longer necessary, but an actual hindrance.

No comments:

Post a Comment