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
-
Agred20367yYes. Can I give you more than ++? Cause what you are saying is true and everyone should read this.
-
I haven't come across anything like that yet but I do see this in Java a bit too often:
this.that.magic.thisThatDoMagic();
😫😫😫 -
@Condor your loop has lot of moving parts my friend!! Switch to an internal iterator where ever you can!
-
karnivol1097yyea the worst is when the test uses that stuff, some programming classes are a joke at my uni
-
@Michelle i have seen other end of spectrum in method making!
getThisObjectAfterValidatingUserAgainstNewTypeOfAuthUsingCustomImplementationAndAsyncOperationNowIForgotWhatIAmDoing -
Wack63117yI actually forgot the stack you're working on. If I remember it correctly, there was a JS rant a while ago. If you're talking about js, check out this project: http://jsnice.org it can help to make sence of (about?) shit code!
-
@Wack
It was Java actually. I don't recall making a JavaScript rant. I'm pretty sure that was someone else. -
@Condor
It's the same thing.
Vague method, variable, and function names are all the same.
It's all equally annoying. Though, this was my mistake. I should have used all three terms for clarification.
My most sincere apologies. -
Cyanite85577yI used zo do this.
It was the worst xD
Picked up a four-year-old project and didnt understand anything. -
neriald14527y@Condor method would be similar to function more than variable and you’d agree that naming a func with a letter is bigger sin than a variable.
Also if you’d name your for loop iterator something longer than a letter I’d slap you, unless somehow (god knows why) you’re using more than 2 nested for loops and you need some clarification. -
Depends on the language and context.
In Haskell and Go variables are often single letters, because when they represent super abstract but idiomatic concepts it makes sense. In Go you continuously use polymorphic readers and writers, so you call them w and r.
I think letters like i and j are often fine as indexes as well, especially when no other name makes sense because it's really just a generic, integer index. In many iterative languages they're so common that it's easy to read.
It's all about idioms. If M is the idiomatic way to use a testing mock in a language, it will appear so often across the code that it will become semantically useful.
It's a problem when you start calling methods "usr.dlt" instead of "user. delete" just for the sake of saving letters.
And the worst sin: calling a method "product.setDescription" when it also calculates the vat percentage, sends a mail to an admin, and kills two random kittens. -
w4tsn35017y@Michelle I'm talking about code golf 😊 where it is a really good idea to use a,b,c as function names 😋
-
bashlord4397yThe the examples in the book for the data structures class at my school are full of this shit. Damn you Sedgewick and Wayne!
-
gitlog62067yI perfectly agree.
When given proper and descriptive sometimes our teaching assistants suspect that we copied it. Like why??? -
Makes sense for some algorithms, e.g. to calculate Easter Sunday: https://dzone.com/articles/...
If you name your methods a, b, c, x, z, etc
Then I hate you.
If the idiot wants me to help then use proper method names!
rant