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
-
@dindin God don't get me started on the enter key. I can't take it when another colleague does this:
if (thing) {
// do something
}
else {
// something else
}
when it is so much nicer to do
} else { -
acz09033905yMy unrequested advice: don't spend too much time and effort worrying about things that make no difference.
Sure, we all have our preferences. I, for example, hate to have to hit the Shift key, so I would love to never use caps or underscores and name all my variables something-like-this. But then I would be constrained to using only Lisp or Scheme for ever. No other languages I know of support dashes (= minus signs) in variable names. I also have very specific preferences regarding spaces and things like that.
But those are MY preferences, and like me, everyone else is entitled to have THEIR preferences, even if they differ from mine.
If you don't want to hate this job, just accept that when you work in a team, you just have to accept the team's style and try to be consistent with it. -
Xirate3215y@halfflat Well, it makes it simpler to just add the next line to quickly check something if you have your braces ready, that's what I thought when they made me do that :v
-
We follow the PSR rules which recommend certain code styles
Ofcourse we have our githooks and IDE's to do the dirty work :) -
kleopi8705y@halfflat imagine:
some intern gets the code, wants to print a message before returning, goes behind your if()
presses enter, adds a print line.
and suddenly you have a
if(thing)
print();
return;
and suddenly you have a program that aborts in every case, without anyone noticing immediately. -
eeee31225ySetup ktlint (https://ktlint.github.io/) on CI and have a laugh at your colleague.
The most important reason for proper and consistent formatting is that it helps reading the code. It's only humans who read code. The compiler just parses and interprets it and doesn't care about formatting. Humans care, because humans at some point will have to read the code to extend it or fix bugs in it. -
Still better than tabbing and aligning all the braces to the right of the screen.. o.O
Related Rants
Today I was trying to convince a colleague that:
fun example(){
if(thing){
//Do something
}
}
Is stupid because it should be
fun example() {
if (thing) {
//Do something
}
}
It's the small things that are the most frustrating
rant
do you even know how the spacebar works 🤦
kotlin