4 ms·
If you strictly adhere to a ~100 column width then you can easily fit 3 files side by side on a mainstream monitor. People complain about useful practices and c
by d110af5ccf 5y ago
If you strictly adhere to a ~100 column width then you can easily fit 3 files side by side on a mainstream monitor. People complain about useful practices and characterize them as antiquated rather than taking the time to appreciate that not everyone uses the same workflow.
- encryptluks2 5y agoSetting a fixed width is not one that I agree with. You can enable line wrapping in pretty much every text editor.
- cerved 5y agoRemember that long lines aren't just a problem for display. Longer lines might indicate that the code is either nested too deep, likely too complicated. Or poorly named withUnreadableRidicouslyLongWeirdWhatsGoingOnHereName. It's also problematic if the line ends up doing too much, ie. lots of chained method, since VCS track changes per line. While editors do a good job at word wrapping, they're not always excellent. Humans may do a better job. Note that the kennels style guide isn't fixed at 80 characters but strongly preferred. "Coding style is all about readability and maintainability using commonly available tools. The limit on the length of lines is 80 columns and this is a strongly preferred limit. Statements longer than 80 columns will be broken into sensible chunks, unless exceeding 80 columns significantly increases readability and does not hide information. Descendants are always substantially shorter than the parent and are placed substantially to the right. The same applies to function headers with a long argument list. However, never break user-visible strings such as printk messages, because that breaks the ability to grep for them."
- d110af5ccf 5y agoI'm late to respond, but automatic line wrapping completely butchers code formatting and creates a difficult to skim mess. I also don't understand why fixed width would cause any issues in practice. The only time I find myself coming anywhere near 80 characters is for API calls with way too many arguments (I'm looking at you, OpenGL). Even then, the fault arguably lies with me for my tendency to use overly descriptive variable names. And anyway, it's trivial to split such calls across multiple lines such that it actually improves the overall readability.