While coding, how many columns do you format for?
What is a sensible maximum number of characters per line of code?
Do people still live by the 80 column rule?
The 80 column limit, still useful?
By code margins I am referring to the lines that guide how long a particular line of code is. Different IDEs have different language for this device, I believe Visual Studio calls them 'gutters'.
That being said, is there a particular standard to the length code margins? My IDE (Netbeans) has 80 by default but I was wondering if there was any rhyme or reason to that default.
We've been using 80 columns for over 80 years, thanks to IBM's punch cards. It's the default text mode on a PC, and it's the default size of a terminal window. Keeping your lines under the 80 column limit means they can be displayed without wrapping in those environments.
I believe the Visual Studio default is 120 columns (although that can be changed), which in my opinion makes more sense given the LongVerboseDotNetCompliant naming conventions. When working in an IDE, it's pretty common to maximize it, so an 80-column limit tends to waste space unless you have a lot of sidebars open.
I happen to prefer 72 (when writing HTML, Python, etc.), which allows my code to fit in a standard terminal with room to turn on line numbers.