• How often do you follow the line-width line?
    12 replies, posted
what i'm talking about (the line on the right): [IMG]http://i.imgur.com/y3BdmL1.png[/IMG] by default it's 80 characters. are you strict about not making lines too long? do you only break it when you have to? or do you just not give a fuck? anyways for me i try not to break it unless for example i'm printing a single line of text that happens to be long as hell, because i don't want to bother splitting it into multiple lines.
I usually don't conform to a strict length limit, but will abuse whitespace/newlines to make long statements look nice/not go off the side of my screen.
At work we follow PEP8 for Python, which has a limit for line length. On my personal projects I try and keep my lines nice and short, but aren't as strict about it.
I think what's really important is to just keep your code readable and informative, so using reasonably long lines and dividing a command between them is much better than turning the code into a carnival of aliases or abusing the security of namespaces\whatnot for the sake of making shorter lines.
Never. At work there's a soft line-length limit but at home lines are as long as they need to be.
When writing Python, I try to follow PEP8 regarding this, but it's one of the rules that are not set in stone. A small blemish does not justify the monstrosity that comes from abbreviation, or using language that is hard to understand. Writing anything else for personal use, I try to keep the code pretty, and don't worry about the line lengths. I still have my rulers (80, 100, 120 characters) visible so I know where I'm at. Edit: If you look at this quick thing I wrote at some point early last year, you can see that simple embedded C, when not doing anything complicated, will never go even near 80. [t]http://i.imgur.com/9WHODTi.png[/t]
As long as I can open 2 windows on a 16:9 screen without text going offscreen I don't newline
I soft limit to 100/120 at home but it's more of a guideline to try to turn super long expressions into something that's much easier to read and process for myself. Having that limit in mind reminds me to format super long lines.
I'm yet to really run into the problem of lines being too long
When possible I just have clang-format follow it for me.
It really depends on what i'm writing. If it's code that will only ever be seen in Visual Studio, on a Desktop - lines go well over 80 chars, but usually no more than 160. PHP, the standards I normally use say that lines "should be no longer than 80 chars" with a hard limit at 120 chars. Not a big deal - though those standards are pretty antiquated. If it's a shell script, that might need to be edited under single-user ("safe mode") on Linux, where the terminal is the default 80x25 - stick to the line limit.
These aspects of writing software are inconsequential. So no, I don't.
Yes, if a line is too long I will try to break it up into multiple smaller lines so it's readable.
Sorry, you need to Log In to post a reply to this thread.