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
-
Programmer from the other side of the syntax spectrum here. Do you seriously prefer white space over curly brackets? Semi colons I can live without thought.
-
mundo0349118yThose single letter variables are just counters, it does not matter (in my opinion) like
shit.map!{|s| s.reduce(:-)}
You can tell I am reducing each element in shit.
#yolo
(The nested loops are indeed shit, i would asume that shit can be reduced too ) -
mundo0349118y@jallman112 for x on shit, elements in shit.. I mean. Yeah it could be better
Like for stuff on shit
Or for corn_pieces on shit
But still readable, no? -
sbrm12358yWTF, I guess it's coded by a person who hates coding...
@JavaRules I guess I'm in the middle of the spectrum.
I use both Java and Python. Though it takes time to change my zone... -
Also is the fact that there is only one gap spacing that code out, part of the python way? If my C-style code was all condensed like that, my eyes would fall out.
-
@mundo03 I just meant, if you're going to use single-letter variable names as loop counters, at least use a sequence that makes sense.
Use x y z, s t u, a b c, things in order alphabetically, so it's easier to match the counter with the loop level.
If it makes the rest of the code easier to read, I'm OK with 1 letter variables. -
@JavaRules, I wouldn't call any of this example "the Python way."
6 lines of conditions in a single if statement?
Using a counter to loop over the length of keys and then referring to the keys by index, when you could just loop over the keys?
I agree with @baxos, this is shitcode in any language, and should be rewritten if it going to stay maintainable.
But I'd still rather have my code formatting match how it's actually going to execute, instead of having to track down a misplaced "}" in code that's appears visually nested correctly but isn't.
It's like having comments that no longer match the actual code. They become lies. :-) -
SHA-25614468y@mundo03 if it would be
for key in key_list:
it would be way more readable imho
but if it is just
for i in range(10):
then idgaf
Related Rants
Please for the love of god name your variables in a sensible way! How the FUCK am I supposed to read your shitcode if you decide to write 6 (!!!) nested loops with variables each named by exactly one character. With no comments whatsoever!
I would rather crack password hashes than this nonsense.
undefined
scientific paper
just kill me please
code quality