Software, technology, sysadmin war stories, and more. Feed
Thursday, August 30, 2012

181 characters on a single line of code

We have a bunch of "third rail" topics in the world of programming. There are plenty of opportunities to go to war over operating systems, editors, hard tabs vs. spaces, and (of course) programming languages.

Still, even with all of those differences, I have found that almost everyone will wrap their code somewhere around the 80th column. There are natural opportunities to do this unless your identifiers are horribly long. Even in the case of Java, when some places have decided to relax their margins out to 100 characters, that's still not too far out.

What if I told you there were people writing code who apparently have no restrictions on line length? They exist, and it's out there, and I have to deal with it. Here's what I'm talking about.

$ cut -c 120- *.cc | grep -v "^$"
r, then it's good! otherwise clear it cause it's a false flag
rwrite the header

I've cut off the first one hundred and twenty characters on every line and there is still more left! The longest line I can find in all of the .cc files is 181 characters. Who honestly uses a screen that wide? I can make a rxvt which is about 250 characters wide if I throw my entire monitor at it, but why would anyone ever do this?

Stuff like this is why forks exist.