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
-
@12bitfloat this is some nice code. Except those floating semicolons maybe, they seem a bit off
-
And, of course, native language instead of English. Why would you introduce empty lines AND keep curly braces in the same line as the operation? Perfect example of NOT good code.
-
@darthkebab Oh god thank you. Writing code in languages other than english bothers me so much
-
@12bitfloat throws + return code = javadoc gang-rape.
I'm not a Java guy. But this smells like the WC after one hour session of a special ex-colleague with a special diet. -
@darthkebab Throws and returns is fine (this is still Java lol) the formatting is beyong anything though
-
@12bitfloat really? I'd expect an exception description in the throws segment. And the border case -1 in the return section.
-
else is not an independent construct. It is a part of if-else. So why do you put else in a separate line, giving it its own block, same indentation level as all other independent constructs and visually detatch it from if? WHY.??
That ternary does not need excesdive parentheses. They neither add any value nor make code any readable. On the contrary - they polute it. And jamming it all into a single line - ... Oh boy. It'd work for short ternaries, no doubt. But now it is just an ugly line that requires more parsing than it should.
if( -> if (. Add some spacing between components. You might not see it as a problem now, but after a while gluing them all together make code look like pebbles at the seashore. Each on top of other, no order, no clarity. -
@darthkebab actually, that's the first time i had no issue reading a ternary expression containing more than one word on either side
-
@netikras I've been programming for 10 years my dude, I know what my code looks like
-
@netikras Else on the same line as the closing brace with 2 space indentation makes the else have the same vertical alignment as the code in it's block. I'd much rather have else aligned consistently with the rest of the statements which also has the bonus of being a line longer, spacing everything further apart and thus making it easier to read
-
@12bitfloat that's why 2-space indents is not enough :) 4 is and always has been the way. Even tab usually has the same length as 4 spaces. Well at least it used to be that way, until programming became 'cool' and some hipsters wanted to be 'unique' with their own indents: 2, 1, 3, 6, 8 spaces and so on.
Related Rants
Fuck forced coding conventions in uni, especially if they are as stupid as Google's Java Conventions. They are a disgrace to nice code but we will have to use them going forward
Stupid spaces everywhere. Else on the same line, wtaf. And don't even get me started on indentation with fucking spaces. Tabs are superior in every single way fite me irl
rant
fuck
google
coding conventions
java
fite me