• barbie (unregistered)
    Comment held for moderation.
  • Sylver (unregistered)

    //Create comment

    Ok, this doesn't look optimal.

  • DonaldK (unregistered)

    //Here,are,all,the,comments //in,no,particular,order

  • An Old Hacker (unregistered)

    Yep. I can see where this is going: // Create all variables int prbx1, prbx2, prbx3, prbx4, prbx5, prbx6, prby1, prby2, prby3, prby4, prby5, prby6, prbx7, prby7; ...

    if (prbx1 > prby6)

    What's the problem? It compiles fine. I created the variables, didn't I?

  • Sock Puppet #5 (unregistered)

    I remember doing a directed study, which basically evolved into a translation of a program written by a guy who--although he was in the CS department--probably would have rather been in Mathematics. Why did he need it translated? Because he could no longer find a distribution of the ancient FORTRAN compiler he was using. I hit the school library for reference materials, and when I cracked the book I found a used punch-card functioning as a bookmark. This was the first sign that something was wrong.

    Long story short, I ended up tweaking a converter tool for a younger version of FORTRAN, and there was lots of generated code like this.

  • Unappreciative Bastard (unregistered)

    Alex Pompadilililimous - Last week (or the week before) I complained about the timeliness of your postings. I retract that comment; thank you for your promptness this week.

  • pel (unregistered)

    I've seen stuff like that so many times it is not even funny. Now where did I put that hard liquor?

  • gramie (cs)

    Nice touch that they even spelled "gauge" wrong as a variable name!

  • brazzy (cs)

    Ah yes, the "every character is precious" school of variable naming. I once saw a program by someone who combined this with hungarian notation, eliminating all domain meaning from the variable names. The best part was that he was quite proud how much useful information this scheme conveyed...

  • definitely who you think I am (unregistered)

    "A few months later, the same ____ called to see if I'd be interested in an interview. One thing led to another, and I ended up taking ___________"

    Whatever you fill in the blank with is a product of your imagination, not mine.

  • frits (cs)

    Let me postulate on the antipatterns/code smells this may contain:

    • Primitive Obsession.
    • Accumulate and Fire.
    • Java.*

    * When the developer clearly meant to use C.

  • Warren (unregistered)

    This code is self-documenting.

    What it documents is the coder's lack of "real world" experience.

  • QJo (unregistered) in reply to brazzy
    brazzy:
    Ah yes, the "every character is precious" school of variable naming. I once saw a program by someone who combined this with hungarian notation, eliminating all domain meaning from the variable names. The best part was that he was quite proud how much useful information this scheme conveyed...

    The really, really frightening thing here is that the variable names are just meaningful enough to convey the information that this appears to be an application for controlling a nuclear reactor.

  • douchie (unregistered)

    TRWTF is that he repeats int all the time. What a waste of space!

  • Sam (unregistered)
    Comment held for moderation.
  • frits (cs) in reply to QJo
    QJo:
    brazzy:
    Ah yes, the "every character is precious" school of variable naming. I once saw a program by someone who combined this with hungarian notation, eliminating all domain meaning from the variable names. The best part was that he was quite proud how much useful information this scheme conveyed...

    The really, really frightening thing here is that the variable names are just meaningful enough to convey the information that this appears to be an application for controlling a nuclear reactor.

    OMG, I think your right.

  • GFK (cs)

    Now that's organization! I have all my variables in one file, all my constants in an other, and all my functions in a third one. Can't get lost.

    Reminds my of that friend who had brought back his first computer to Wal-mart one month after buying it, because it wouldn't start. I told him he could have come to me first, and asked him about the issue he had had. He told me he didn't understand what happened, he was "sorting his files" when it just stopped working.

    He had grouped all the files he could find in his hard drive by file extension, in separated folders located in the root of C:. It probably stopped working when he was moving all these .dll files that were everywhere... His way of solving Windows Millenium dll hell, I guess!

  • Matthew (unregistered)

    I can actually top this. The previous developer on a legacy application I support used nonsense like this for his global variables, and single letters for his local variables. It was just his "style." Oh, and it's VB6.

    Although, given his working conditions I can almost understand. He majorly underestimated the cost of a project and ended up falling several months behind. My company hired more contractors whose only job was sitting there and watching him code. Can't imagine anybody's code would be very beautiful in that situation...

  • some guy (unregistered)
    Comment held for moderation.
  • frits (cs) in reply to barbie
    barbie:
    Re "what the $#@~! are they?"

    but... it's all in the comments! Why, it's "x,y locations of pumps and valves"

    Further proof that developers don't read code comments.

    With a name like "barbie", I'm betting your not a developer (I joke).

  • Sock Puppet #5 (unregistered) in reply to QJo
    QJo:
    brazzy:
    Ah yes, the "every character is precious" school of variable naming. I once saw a program by someone who combined this with hungarian notation, eliminating all domain meaning from the variable names. The best part was that he was quite proud how much useful information this scheme conveyed...

    The really, really frightening thing here is that the variable names are just meaningful enough to convey the information that this appears to be an application for controlling a nuclear reactor.

    Why would they have a nuclear reactor at a University? Did you read the article?

  • Chernobyl Charlie (unregistered) in reply to frits
    frits:
    QJo:
    brazzy:
    Ah yes, the "every character is precious" school of variable naming. I once saw a program by someone who combined this with hungarian notation, eliminating all domain meaning from the variable names. The best part was that he was quite proud how much useful information this scheme conveyed...

    The really, really frightening thing here is that the variable names are just meaningful enough to convey the information that this appears to be an application for controlling a nuclear reactor.

    OMG, I think your right.

    Oh .. oh my. I wonder what university this is? Hopefully one with a very small reactor.

  • Sam (unregistered) in reply to Sock Puppet #5
    Sock Puppet #5:
    Why would they have a nuclear reactor at a University? Did you read the article?
    Research reactors exist.
  • QJo (unregistered) in reply to frits
    Comment held for moderation.
  • boog (unregistered) in reply to frits
    frits:
    QJo:
    brazzy:
    Ah yes, the "every character is precious" school of variable naming. I once saw a program by someone who combined this with hungarian notation, eliminating all domain meaning from the variable names. The best part was that he was quite proud how much useful information this scheme conveyed...

    The really, really frightening thing here is that the variable names are just meaningful enough to convey the information that this appears to be an application for controlling a nuclear reactor.

    OMG, I think you're right.
    That's highly unlikely.

  • boog (unregistered) in reply to Sam
    frits' sock puppet:
    Sock Puppet #5:
    Why would they have a nuclear reactor at a University? Did you read the article?
    Research reactors exist.
    That's highly unlikely.
  • Chernobyl Charlie (unregistered) in reply to Sock Puppet #5
    Comment held for moderation.
  • [noun] [verb] [location] (unregistered) in reply to definitely who you think I am
    definitely who you think I am:
    "A few months later, the same ____ called to see if I'd be interested in _________. One thing led to another, and I ended up taking ___________"

    Whatever you fill in the blank with is a product of your imagination, not mine.

    FTFY

  • someone (unregistered)
    Comment held for moderation.
  • steveC (unregistered) in reply to Sock Puppet #5
    Comment held for moderation.
  • frits (cs) in reply to Sock Puppet #5
    Sock Puppet #5:
    Why would they have a nuclear reactor at a University? Did you read the article?

    4/10. It would have been 9/10 if you used a less ridiculous handle.

  • brazzy (cs) in reply to Sock Puppet #5
    Sock Puppet #5:
    Why would they have a nuclear reactor at a University? Did you read the article?
    In case you are not joking: the first nuclear reactor ever build was constructed in an abandoned racquets court at the University of Chicago, and it's not all that unusual for universities with large phsyics departments to have small research reactors.
  • beginend (cs)

    sorry for playing dumb... but besides the horrible naming and the lack of commenting, does anything speak against declaring your variables in one place, at the top? what makes that bad style per se?

  • fu2uf (unregistered) in reply to some guy
    Comment held for moderation.
  • brazzy (cs) in reply to frits
    frits:
    QJo:
    brazzy:
    Ah yes, the "every character is precious" school of variable naming. I once saw a program by someone who combined this with hungarian notation, eliminating all domain meaning from the variable names. The best part was that he was quite proud how much useful information this scheme conveyed...

    The really, really frightening thing here is that the variable names are just meaningful enough to convey the information that this appears to be an application for controlling a nuclear reactor.

    OMG, I think your right.

    Let's hope it's a simulation.

  • Someone who can't be bothered to login from work (unregistered) in reply to Chernobyl Charlie
    Comment held for moderation.
  • QJo (unregistered) in reply to beginend
    beginend:
    sorry for playing dumb... but besides the horrible naming and the lack of commenting, does anything speak against declaring your variables in one place, at the top? what makes that bad style per se?

    Off the top of my head: encapsulation suffers. A big long method with lots and lots of variables smells bad to start with. But when the variables are declared near where they're used it makes it easier to control their scope. If you then declare those variables inside their control structures, it makes it less possible to make the mistake of overwriting a needed value of a variable with another one.

  • siax turbyl rodiny (unregistered)

    Hey, I think I can read my name in there!

  • ReadyFred (unregistered)

    I think I worked out what's wrong.

    The first two lines, the comment style is different.

    The first line, there's a // at the end of the line, in the second there's not.

    That's the real WTF, innit?

  • beginend (cs) in reply to QJo
    QJo:
    beginend:
    sorry for playing dumb... but besides the horrible naming and the lack of commenting, does anything speak against declaring your variables in one place, at the top? what makes that bad style per se?

    Off the top of my head: encapsulation suffers. A big long method with lots and lots of variables smells bad to start with. But when the variables are declared near where they're used it makes it easier to control their scope. If you then declare those variables inside their control structures, it makes it less possible to make the mistake of overwriting a needed value of a variable with another one.

    Ok, a method with that many local variables smells so bad it'll probably make you puke. But the rest is really a matter of taste and discipline, I guess. Having to declare all variables in one place (as in Pascal) forces you to think very thoroughly about what kind of data you really need to have locally, and it can thus (if it's done well) lead to much clearer code. It also reduces the risk of unnecessary and redundant declarations and subseqeuntly allocations, esp. in long methods.

  • QJo (unregistered) in reply to siax turbyl rodiny
    siax turbyl rodiny:
    Hey, I think I can read my name in there!

    That is so cool. Siax Turbyl Rodiny. New meme! New meme!

  • Tim Reynolds (unregistered)

    When I was a freshman in high school I wrote a space invaders clone without functions or arrays in qbasic. It had:

    MON1X, MON1Y ... MON32X, MON32Y defined.

    I became an expert at <backspace> <number> <down> <repeat>. I was pretty proud.

  • beginend (cs) in reply to An Old Hacker
    An Old Hacker:
    Yep. I can see where this is going: // Create all variables int prbx1, prbx2, prbx3, prbx4, prbx5, prbx6, prby1, prby2, prby3, prby4, prby5, prby6, prbx7, prby7; ...

    if (prbx1 > prby6)

    What's the problem? It compiles fine. I created the variables, didn't I?

    My compiler of choice would actually warn me about declared but uninitialized variables. Do you not get that with Java?

  • QJo (unregistered) in reply to beginend
    beginend:
    An Old Hacker:
    Yep. I can see where this is going: // Create all variables int prbx1, prbx2, prbx3, prbx4, prbx5, prbx6, prby1, prby2, prby3, prby4, prby5, prby6, prbx7, prby7; ...

    if (prbx1 > prby6)

    What's the problem? It compiles fine. I created the variables, didn't I?

    My compiler of choice would actually warn me about declared but uninitialized variables. Do you not get that with Java?

    I'm wondering what possible business logic would require that you compare the X position of right-hand pump number 1 with the Y position of right-hand pump number 6. Oh I see, if someone's picked it up and moved it east rather further than the northernmost pump is northwards, it means we've got a felon in the compound. Seal the exits.

  • Sock Puppet #5 (unregistered) in reply to frits
    frits:
    Sock Puppet #5:
    Why would they have a nuclear reactor at a University? Did you read the article?

    4/10. It would have been 9/10 if you used a less ridiculous handle.

    I was serious...I suppose I stand corrected (although the one guy who posted the dubious Wikipedia link didn't use the url tag, so I'm too lazy to check it out).

    I was using common sense: is nuclear technology something I want ungraduated physics students playing around with? In my school, several of the physics classes I took had the correct answers circulated, even on public websites. I alerted the professors each time I discovered this, and they never seemed to mind. Perhaps the purpose was to help the athletic program...at any rate, are those the kids you want working on reactors nestled in a large concentration of people?

    Second, do I want Iranian exchange students getting-to-know the inner workings of our nuclear reactors?

    Third, have you seen what many of the professors are capable of? I know you've been visiting this site long enough.

    Fourth, what's wrong with my pseudonym? I was thinking of registering under this name.

  • Sock Puppet #5 (unregistered) in reply to beginend
    beginend:
    An Old Hacker:
    Yep. I can see where this is going: // Create all variables int prbx1, prbx2, prbx3, prbx4, prbx5, prbx6, prby1, prby2, prby3, prby4, prby5, prby6, prbx7, prby7; ...

    if (prbx1 > prby6)

    What's the problem? It compiles fine. I created the variables, didn't I?

    My compiler of choice would actually warn me about declared but uninitialized variables. Do you not get that with Java?

    Java™ goes a step further and gives you a compiler error.

  • swim (unregistered) in reply to QJo
    QJo:
    brazzy:
    Ah yes, the "every character is precious" school of variable naming. I once saw a program by someone who combined this with hungarian notation, eliminating all domain meaning from the variable names. The best part was that he was quite proud how much useful information this scheme conveyed...

    The really, really frightening thing here is that the variable names are just meaningful enough to convey the information that this appears to be an application for controlling a nuclear reactor.

    You're not allowed to use Java for a nuclear reactor. It's in the license.

    "not designed or intended for use in the design, construction, operation or maintenance of any nuclear facility."

    Seriously, I'm not making that up.

  • Zemm (cs) in reply to Sam
    Sam:
    (Sorry.)

    I like that alot.

  • SQLDave (cs)

    I thought rodDowny was Robert Downy Jr.'s brother.

  • Too much free time (unregistered)
    Comment held for moderation.

Leave a comment on “The Alumni Variables”

Log In or post as a guest

Replying to comment #:

« Return to Article