• (cs)

    Soooo... this programmer is part of the "Local Variables Considered Harmful"-camp?

  • (cs)

    It's code like this that we can show to non-technical people and they will be in awe of our technical knowledge.  It'll just look like gibberish to them, but we know enough about what's going on to make it seem like it's NOT gibberish to us.

    But other than that, truly truly horrible.  The goggles, they do nothing, or so I hear.

  • (cs)

    (Beavis/Butthead-style chuckle)
    titS                 : array['A'..'U'] of string;

  • Craig H. (unregistered) in reply to Ytram

    This really is bad.  The fact that anyone said "It should be very clear" Is mind boggling.  I can only image how awful the rest of the code looks.  I would be a little more forgiving if the variable names were readable, but this just makes my head hurt.

    Lets just hope they don't include files that used these global variables.

  • Koen (unregistered) in reply to Craig H.

    That's not code, that's art..

  • (cs) in reply to Koen

    It boggles my mind that some people name variables well in one place (stop_key, wait_key) but so so badly in other places (wtf is a tol_lgd, or any of those other _lgd vars?)

    Simply removing the vowels does NOT a good variable name make. Maybe this guy came from the DOS world and doesn't think the language supports variable names longer than 8 characters?

  • (cs)

    Ok, you win!  I surrender!  I am going to not pursue my career as a pascal -> atari programmer

  • (cs)

    {attenuation bezogen}

    ahh, this makes it all clear now ?!?!

    maybe if they named their variables as follows it would have been better

    blah1
    blah2
    ...
    blah2000000

  • Guido (unregistered)

    Perhaps "it's clear" simply because someone took the time to space things out into nice columns...

  • Plutor (unregistered)

    This made me yell "holy crap" at my monitor at work.  That doesn't happen too often around here.  Good job.

  • (cs) in reply to mrsticks1982
    mrsticks1982:
    {attenuation bezogen}

    ahh, this makes it all clear now ?!?!

    maybe if they named their variables as follows it would have been better

    blah1
    blah2
    ...
    blah2000000


    I'd prefer that naming scheme over the provided one....
  • (cs) in reply to Athas

    That's got to be the nastiest Pascal code ever written, and we haven't even SEEN the implementation code yet.

  • Anonymous (unregistered)

    This reminds me from an old code where, because some design constraints, a coleague had to declare global variables to report generation. So far, so good. The problem was that all (100+) reports shared the same variables. No need to say maintenance was incredible painful.

    Thanks God he wasn't used to labels, exothic OO designs and code generation/snippets.

  • (cs)

    I can see nightmares after this. Maby i should stop reading tdwtf.

  • (cs)
    Alex Papadimoulis:
    "Don't worry," the original programmer reassured him, "everything should be clear."

    Should be, but is not.


    <font size="2">var
    ...
      Mshudder,cmdKhelping,running,Fpicked,idp_ok,hrm_ok,

    <font size="3">The first variable name on the above line is very appropriate.

    Sincerely,

    Gene Wirchenko
    </font>
    </font>
  • (cs)

    I think you mean "wary", not "weary".  Wary means you're cautious or suspicious about it.  Weary means you're tired of it.  Thus he was wary of the code beforehand and then weary of it after working with it for a while.

  • (cs)

    blinkblink*

  • ZeePain! (unregistered)

    Gag This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers.  Or something. 

    Don't bother trying to figure out every one. It looks like it's mostly platform specific nonsense anyway. Just try to come away with the general idea, and re-write the bugger. Better. Please.

  • (cs)

    I would like to point out the excellent use of commenting, which helps to clear up any possible misconceptions of what the variables are for.

    Some of my faves: unused, abskfldr,  and prbzn_slice.

    I am so glad that it's got _slice in the name, I would never have known that the prbzn wasn't a full prbzn.

    A long time ago, I read in a 6809 assembly programming manual that there is a special hell for people who code without comments...
    This is a whole 'nother level...

  • Jonathan Thompson (unregistered) in reply to christoofar

    You think that's bad?  At least all the globals are in one easy-to-find spot, and Pascal is a very tightly typed language that doesn't allow you to cast from one type to another!

    I've got C code I've had to work with here at work that not only has naming similar to this (or worse) with over 300 global variables (those are just the ones I'm aware of in the largest single area of declaration: I've not counted all the others!) and the original developer has a habit of not using unions at all, instead choosing to cast everything thrown into a variable into the particular types at will, and calling all the variables cast into that void * par....

    I've seen something even worse than that in C++, though, in my more distant past, that makes both this example and what I see here at this employer seem reasonable by comparison for variable naming....

     

    I'll leave it to the readers' imagination as to what could be worse than what I've stated I've got to look at currently, and imagine what I've seen in the past (I was very thankful I wasn't given the assignment to work with that code!)

  • (cs) in reply to RandomEngy
    RandomEngy:
    I think you mean "wary", not "weary".  Wary means you're cautious or suspicious about it.  Weary means you're tired of it.  Thus he was wary of the code beforehand and then weary of it after working with it for a while.


    Or in this case, weary of it after looking at it for a few seconds. ;)
  • (cs) in reply to Jonathan Thompson
    Anonymous:

    I've got C code I've had to work with here at work that not only has naming similar to this (or worse) with over 300 global variables (those are just the ones I'm aware of in the largest single area of declaration: I've not counted all the others!) and the original developer has a habit of not using unions at all, instead choosing to cast everything thrown into a variable into the particular types at will, and calling all the variables cast into that void * par....



    I'll bet there are over 300 variables in that gawd-awful declaration, and like your project, this may in fact only be the largest single area of declaration...

    I just love the fact that there is a global integer variable named 'i'.
    Just think, you will never need to declare your loop variable again!!!

    To avoid collisions where a loop that uses 'i' calls another function that loops with 'i', be sure to stack 'i' and restore it when your function exits.  In fact, I bet there is a stack in that declaration somewhere, just for this!
  • Matt (unregistered)

    Looks more like ASCII art than Pascal code

  • (cs)

    Of course the real WTF here is that he used magic numbers.

    This:

    mtx5cod              : array[0..7] of string;

    Should properly be rewritten as

    <font size="2">const SEVEN: int = 7;</font>

    <font size="2">

    mtx5cod              : array[0..SEVEN] of string;
    </font>

    (my pascal syntax is rusty and I don't know if that would even compile, having a non-literal in an array declaration). BUT IT WOULD BE MUCH CLEANER.
  • Name? (unregistered)

    Kids, what's the problem?

    This is how things were done when I was young. You had to be a PROGRAMMER in order to write a program, not some mouse-pusher, gui-clicker pansy. And when you had to write a PROGRAM in quiche-eater Pascal you made at least sure that it was structured like FORTRAN. For men, not for quiche-eaters.

  • (cs) in reply to Ytram

    Ytram:
    It's code like this that we can show to non-technical people and they will be in awe of our technical knowledge.  It'll just look like gibberish to them, but we know enough about what's going on to make it seem like it's NOT gibberish to us.

    But other than that, truly truly horrible.  The goggles, they do nothing, or so I hear.

    So, what you're saying is that we don't really have to have computer hacking skills. We just need to pretend we do....sweet.

  • A Concerned Reader (unregistered)

    Can you please base64 these kind of posts and put a little warning sign next to it
    (like a 200x200 red alert animated gif?)

    Thank you

    -- be wearing two eye-patches for the next week at least

  • (cs) in reply to Koen
    Anonymous:
    That's not code, that's art..


    I don't know about that.  But I guess to someone,  anything could be considered art.

    .jc
  • Baldrick (unregistered)

    Oh my God, this can't be happening. This really isn't true. Nominate this guy for the white house.

  • (cs) in reply to Manni
    Manni:
    It boggles my mind that some people name variables well in one place (stop_key, wait_key) but so so badly in other places (wtf is a tol_lgd, or any of those other _lgd vars?)


    There may even be a logic to the names, but if not documented, it is lost.

    Simply removing the vowels does NOT a good variable name make. Maybe this guy came from the DOS world and doesn't think the language supports variable names longer than 8 characters?

    Hey!  Some of those variable names are twelve characters long!  He even used underscores to separate, uh, words.  They are words, right?

    Sincerely,

    Gene Wirchenko

  • poss (unregistered) in reply to Gene Wirchenko

    Gene Wirchenko:
    Alex Papadimoulis:
    "Don't worry," the original programmer reassured him, "everything should be clear."

    Should be, but is not.

    We hear phrases like "It should work" or "It should be doing something" so often around here, "should" has been declared a swear word. We're thinking of having a "should jar", and putting 10c in everytime we hear that word...

  • (cs)

    Sooo, uh, what does the program do, Unkie Andy?  It looks like it's taking several data files and tranforming one to the other, and that the data inside them, having variables with parts like pitch, dsp, and orch, must be related to sound or music.  Porting this to a newer platform will prove interesting, I believe.  Oh, and somehow there's a GUI involved, hence mouse_ok, mouse_hidden, mouse_forbidden.  On the other hand, it could simply be an incantation to summon demons.

  • what name? (unregistered) in reply to Name?

    This looks pretty normal to me.  In the real world, where all real programs are written in FORTRAN, we are used to hard copies of common block declarations that when printed (for documentation sake, to please the QA people) stand at approx 4 feet tall.

    FORTRAN coders eat barbed wire

  • (cs) in reply to Name?

    Anonymous:
    Kids, what's the problem?

    This is how things were done when I was young. You had to be a PROGRAMMER in order to write a program, not some mouse-pusher, gui-clicker pansy. And when you had to write a PROGRAM in quiche-eater Pascal you made at least sure that it was structured like FORTRAN. For men, not for quiche-eaters.

     

    Bet this post was from the orignal coder of this crap. [<:o)]

  • Mike J (unregistered) in reply to dabocla
    dabocla:
    Anonymous:
    That's not code, that's art..


    I don't know about that.  But I guess to someone,  anything could be considered art.

    Well, GG Allen used to dump on stage, spread it on himself, then throw it at the audience and THAT was considered art.

    ...

    Considering that, it seems that GG Allen was probably the author of this code.

    -This weeks one degree of separation brought to you by the letters w, t, f and the number 42 (represented by named constant EIGHT).

  • Ekevu (unregistered) in reply to sinistral
    sinistral:
    Sooo, uh, what does the program do, Unkie Andy?  It looks like it's taking several data files and tranforming one to the other, and that the data inside them, having variables with parts like pitch, dsp, and orch, must be related to sound or music.  Porting this to a newer platform will prove interesting, I believe.  Oh, and somehow there's a GUI involved, hence mouse_ok, mouse_hidden, mouse_forbidden.  On the other hand, it could simply be an incantation to summon demons.

    Somehow, these bowling scores came to my mind. But I don't think so.
  • Ekevu (unregistered) in reply to Kodi
    Kodi:
    Bet this post was from the orignal coder of this crap. [<:o)]

    Score: 3, Flamebait
  • (cs)

    I think we've found the first program that uses ROT13 to obfuscate the code....

  • Mike J (unregistered) in reply to Hugo
    Hugo:
    I think we've found the first program that uses ROT13 to obfuscate the code....

    And it probably uses ROT26 for data security...

  • (cs)

    <FONT face=Tahoma>must... pretend... i did NOT see this [+o(][+o(]</FONT>

  • (cs) in reply to poss
    Anonymous:

    Gene Wirchenko:
    Alex Papadimoulis:
    "Don't worry," the original programmer reassured him, "everything should be clear."

    Should be, but is not.

    We hear phrases like "It should work" or "It should be doing something" so often around here, "should" has been declared a swear word. We're thinking of having a "should jar", and putting 10c in everytime we hear that word...



    Make it dollar!

    Having heard the word too much, years ago, I came up with a definition for "should":

    Present Tense: When you want to make a statement for which there is little logical support, but you still want to make the statement for reasons of pride, moral indignation, etc., use the present tense of "should".  e.g. "This should work."

    Past Tense: When the unknown or unaccounted-for factors sneak up behind you and kick you hard in the butt as you so richly deserve, use the past tense.  Adopt a mournful expression and moan, "It should have worked."

    Sincerely,

    Gene Wirchenko

  • (cs) in reply to what name?

    Anonymous:
    This looks pretty normal to me.  In the real world, where all real programs are written in FORTRAN, we are used to hard copies of common block declarations that when printed (for documentation sake, to please the QA people) stand at approx 4 feet tall.

    FORTRAN coders eat barbed wire

    I remember coding for fun as a teenager back in the 80's. Everything I wrote wound up looking like that - and I got the impression from reading other people's code that was pretty typical. I think that was the reason I initially decided not to go into IT.

    I was out of the loop for many years and ventured back in when Java was starting out. I was pleasantly surprised to learn that Java allowed you to escape that sort of pit.

    Seeing this code brings back all sorts of memories both fond (Ultima III, Bard's Tale, Archon, Might and Magic) and unpleasant (Corey Hart, Duran Duran, Huey Lewis and the News). Probably because I was listening to the latter while playing the former.

  • (cs)

    Yeah, that's the point where you just have to give up on "porting" and start on "Rewriting from scratch". Use the program for a while, spec out what it does, and work from that spec rather than working from the original source code.

  • Kyle Bennett (unregistered)

    everything should be clear

    That was not meant as a reassurance, it was the complete requirements doc for the porting project. 


  • Mike5 (unregistered)

    He must have heard the "Pascal forces you to write nice code" line once too often, and decided to prove it wrong.

    Mike5

  • (cs)

    It's clear with the goggles on.

  • (cs)

    considering there was no OOP in the good old Pascal days, I don't see much problem with this code, but of course for these days "programmers" it hurts the eyes

  • (cs) in reply to poss
    Anonymous:

    Gene Wirchenko:
    Alex Papadimoulis:
    "Don't worry," the original programmer reassured him, "everything should be clear."

    Should be, but is not.

    We hear phrases like "It should work" or "It should be doing something" so often around here, "should" has been declared a swear word. We're thinking of having a "should jar", and putting 10c in everytime we hear that word...



    Around here we like to say "in theory it will work..."  The people in support threatened to put out a jar for just that reason.


  • (cs) in reply to OneFactor

    Never coded for fun, just for dosh.

    I have been coding in java for the last three years (after 15 years of FORTRAN 77, non of your girly FORTRAN 90 rubbish), and it just doesn't feel like "real" programming. 

    I just don't enjoy coding unless it's on a green screen monitor, and you have to count the indentation spaces.

  • K-otik (unregistered)

    This could have been expressed so much more elegant in the k language.

    http://www.kx.com/a/k/examples/xml.k

    (This will get you started: http://www.kuro5hin.org/?op=displaystory;sid=2002/11/14/22741/791 )

Leave a comment on “Don't Worry, Everything Should Be Clear”

Log In or post as a guest

Replying to comment #:

« Return to Article