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
-
1. The line limitation is useful. Have you ever NOT written code in a maximized window? Or on a vertical monitor?
2. Breaking up functions is good! Having functions do just thing they are named after and leaving other stuff to others is clean!
3. Nonsense variables? Well, if with sensible variables you talk about Java EE class name style, you have a whole set of other issues. If it's a nesting issue, go back to point 2. -
C0D4669025yIf a function or variable name is 80 characters long, you should really rethink what you are doing in any language.
-
A line length limit of 90 characters is really ugly. It is ten grapheme clusters more than eighty - wich is the line length limit to actually use!
-
I feel ya man, writing heavily templated code is pain with the 90 character limit, 150 characters seems to work great though
-
Any line character limit is just bullshit because it is arbitrary.
Whether the code is readable or not will depend on the size of the screen and the font size.
The right thing to do is to just break up things as they become poorly readable, depending on what the actual code is and not depending on the number of characters in a line.
10 assignment statements in a line? Break up this shit!
Some generic class declaration with inheritance? Leave this shit in one line! -
@kescherRant well if you don't use vertical monitors, and it does allow for 2 files to be open and read comfortably (no horizontal scrolling), what's the problem?
-
Umm, even a tweet is more than 140 characters, what in the world are you saying?
-
ErrorType Error = FunctionName(const NameStruct& VarName, unsigned char* From, unsigned char* To);
yes 90 character per line.. including spaces and indents..
And by breaking up I mean adding additional enter so that this one line of execution is now separated over two lines
I agree not to have more than 3 variables in a function to have clean code.
but in certain cases this make no sense to spit up functions.. in this case I'm using a library which uses long function names.
and it is using one indent of 4 spaces
should I then name my variables A, B, C? -
hitko31455y@Lensflare Also breaking up a line just because you added a few characters makes for bad git commits and harder code review as some small refactoring (e.g. renaming a variable) results in breaking up a line, changing a lot of code without actually changing any functionality.
-
As a person with impaired vision who prefers 20-22pt font, fuck people who do this with shared projects. Yes, break up that damn function. It doesn't make sense semantically that it's on multiple lines but scrolling horizontally or wrapping code lines is much, much worse. And there are people who program on 14" laptops.
-
hitko31455y@Lor-inc Way to blame other people for your own problems. Yeah it's nice of other people to consider your needs, but equally you could get a larger screen so you don't push your burden on those who have nothing to do with it. Also unless you're borderline blind, there's plenty you could do so you don't need to increase font size, like getting proper glasses or an eye surgery.
-
Short variables != Nonsense, especially in short functions.
https://kernel.org/doc/html/... -
@hitko There isn't a surgery (yet) nor glasses that would solve my problem but I'm not blind.
With a 29" display, I'm in a similar situation to people with 14" laptops.
The main question is, what is the minimum screen size that you want to make a dev dependency for your project? IMO it shouldn't be more than 14".
Related Rants
-
cdrice105"You gave us bad code! We ran it and now production is DOWN! Join this bridgeline now and help us fix this!" ...
-
johnny301when your code is a mess but everything work out in the end
-
MoboTheHobo36My Friend: Dude our Linux Server is not working anymore! Me: What? What did you do? My friend: Nothing I swe...
Rant!
Why enforce a 90 character limit in code file (C++)
It does not make readability any better..
you either break up functions that barely exceed the limits
or
start making nonsense variable names just because they are short.
rant
fml
characters
stupid
limits
why
nonsense