Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I do 100 limit because screw old punch card standards. Nobody uses them anymore and I need the SPACE.
-
I like 80 because I like to have files open side by side in vim without lines wrapping. No other good reason though.
-
Root826026y100 because 80 doesn't fit some lines or complex declarations.
Also anything past ~110 is just getting too long. -
sceiler726yWhatever the width is when I have navigation and other panels open on the left and right side of the editor. Think about Intellij and visual studio. Usually it comes down to 120 (27" monitor).
-
80 'cause it makes people use typedef in c++ for commenly used types like a smart pointer to a class.
reduces
std::shared_ptr<MyClass> ptr;
to
MyClass::ptr_t; -
drifter36yDepends on language. For Java 120 for me. I don't think this matter that much, most IDEs can reformat code to your preference anyway.
-
No fans of everything on a single line?
Seriously though: About 80, not more than 2 levels of indentation, and I try to stick to a 20-10-10 rule as well: 20 lines per method, 10 methods per class, 10 classes per "module".
Roughly.
I hate hard CI-enforced limits on any of it though, sometimes code is easier to read on a single line, sometimes methods should be 50 lines because it really doesn't make sense to abstract things away. -
totoxto2516y200 so I can use long and intuitive function names like shouldBathroomTripBeScheduledAfterLunchBecauseYouDrankCoffee()
-
For Java I use 80, with a 10 size font. Means I can have to windows with code open side by side, and I don't have to be madly switching between a couple. And if I run the 80 limit, split the declaration into a couple lines.
Looks neater, except when it's a 2 line if statement... Those are kinda ugly... -
Fradow9166yOn one hand, PEP 8 mandates a 79 characters.
On the other hand, PyCharm allows 120 characters.
But I'm a practical programmer, so I don't adhere to strict rules over just doing what's right.
And I'm not about to make something weird like cutting a http link in half just to respect rules made in an ancient time where a terminal would only display 80 characters.
I still try to keep things under 120 characters, but if a line takes 125 or 130, so be it. -
is that really a thing? I don't care about the limit, I care about being able to read the damn code. If the line is too long either I'm doing something wrong or that IF statement can be broken down to either multiple lines or just rewrite my conditions in-case applicable I just never care about that grey vertical line Android Studio shows ...
-
jonii25346yI have to do 80 with RPG, which annoys me; So I usually use 128 when I can, feels like freedom to me.
-
I usually aim for 80 but some lines just require more. So 90 is usually a hard max for me.
-
@bittersweet we have someone who writes SQL like that; all queries are three lines:
SELECT ....
FROM ....
WHERE ...
No matter what else is added; CASE, JOIN, GROUP BY, it is always three lines. -
I do 79!
79 is for ensuring that it can be displayed on very old machines. Also, in modern landscape monitors you can put up to 3 terminal windows, effectively doing a 3way diff properly.
If you have a hbig enough screen you can even put two terminals this way in portrait orientation
79
Related Rants
Let's have a real debate.
Not Linux vs Windows vs Mac.
Not Vim vs Emacs.
Not ASP.NET vs Spring Frameworks.
NO.
CHARACTER LIMIT. 80, 100, or 120+ and WHY.
rant
challenge
punch cards
debate