74
Baxos
7y

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.

Comments
  • 7
    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.
  • 4
  • 3
    Those 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 )
  • 0
    @mundo03 Still. y, z, k? m, n, s?
  • 0
    @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?
  • 0
    It makes me sad seeing people abuse for-loops.
  • 0
    WTF, 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...
  • 0
    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.
  • 2
    this many nested loops are a warning flag by themselves 😁
  • 1
    @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.
  • 1
    @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. :-)
  • 0
    Very self documented
  • 0
    @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
Add Comment