• How often do you follow the line-width line?
    16 replies, posted
what i'm talking about (the line on the right): http://i.imgur.com/y3BdmL1.png 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. THANK Cristiano
The 80-character line limit is a legacy thing from way back and has some historical significance. For the most part I have to follow the line limit since I sometimes work with a 4-split workspace and each split hits a bit over 80 characters per line anyway. I also do it as a courtesy to people reading my code that's in the same situation I am or that has a small monitor. Personally, it also looks pleasing to the eyes. For comments, I usually always follow the 80-character line limit unless it only goes over by a few characters. For code, I'm a bit more lenient and I split it up if a one-liner is really long, like 2 lines long.
literally never
Also never I just toggle word wrap on demand
I don't really pay attention to line length unless I get an extremely long line, which should be split if possible to make it more readable, or I'm using an editor that doesn't seem to have word wrap. (Game Maker Studio 2 appears to have this issue unless I'm just blind and overlooked it somewhere.)
Not really, it's a thing of the past and setting it to 80 chars is ridiculous since 24" monitors have become the standard. I still try to write neat enough code so it fits but if it really is a bit longer then it is. As long as I don't go opening 20 brackets in a single function I'm fine with it.
i use vertical monitors at work so i try not to make super long lines. i dont have a hard character limit but when i have to scroll horizontally for code i just put it on a new line
You're right it's mostly a thing of the past. However the pep-8 standard for python code formatting specifies 72 characters still. https://www.python.org/dev/peps/pep-0008/#maximum-line-length
I tend to limit myself to 80-100 character lines. It's not about the code fitting within your monitor or your text editor, it's about readable code and making life easier for whoever has to review your code, because those guys will usually have to do a side-by-side comparison of before and after - having code too big to fit will just make them cry (or you know, berate you for not doing your job properly and making everyone's life a little harder like an amateur). There's a reason for most code styles enforcing a 80-char limit, after all. It also makes code way cleaner most of the time, and gives you legacy support for free, so what's not to like?
Readability is more important to me than out dated standards.
Not unless it's really really long but even having 200+ characters on a line is fine on today's screens.
My company's standard was the line width of the default github diff windows
all my code is on one line
I just use Prettier and it auto formats when I save. I also brought this into our some of our projects at work. Saves lots of time between developers & different editors. also hooked it up to our pre-commit so all files share same code styles.
❓❓❓
On github when you preview code, the default width of the code window is like 120 characters, so we tried to keep our code within that
Sorry, you need to Log In to post a reply to this thread.