• Pacifisto (unregistered)

    "For loops? Of course I know what loops are for!"

  • Dennis (unregistered)

    The WTF of the coder seems to be hiding inside the WTF of the language for me.

  • (cs)

    Cobal programmers give me gas... or... well... this one just did.

  • Warren (unregistered)

    But what happens if there's a June 31 one of those years? Huh?

  • Accalia.de.Elementia (unregistered)

    You know there is something special in your code when it includes a global variable named "stirfry"

  • (cs)

    COBOL: 5 decades of giving dimwit programmers the illusion of competence.

  • Ron (unregistered) in reply to Warren

    I don't think that will be a problem very often. However, if the test date is either 6/30 or 7/1, then the answer will be wrong by as much as 20 years.

  • Rodnas (unregistered)

    TRWTF is global variables </facepalm>

  • Ron (unregistered) in reply to Ron

    Never mind. That boundary actually works okay.

  • cobalistic (unregistered)

    Even without object oriented programming, this programmer doesn't even understand the concept of data types. Also, he couldn't even give the function a clear name like strGetCurrentFiscalYear.

    CAPTCHA: incassum

    switch(myval) { incassum 1: // do something here break; incassum 2: // do something here break;

    }

  • Ana (unregistered)

    Dim nnnnoooo As Comment

  • Smug Unix User (unregistered)

    I call shenanigans. Real COBOL programmers only type in all caps.

  • (cs)

    This makes two Remy Porter articles in a row with no HTML comments. And that, my friends, is the real WTF.

  • Bob (unregistered)

    I don't get the COBOL reference. COBOL tends toward verbosity. Unless you're using the indicators...

    I would have thought that regular WTF readers would have grown out of the "language x is bad" mentality. There are few bad languages but many bad programmers. There's little correlation between the two. Apart from PHP.

  • Diego (unregistered) in reply to Accalia.de.Elementia
    Accalia.de.Elementia:
    You know there is something special in your code when it includes a global variable named "stirfry"

    It's actually strFY, which I guess means str(ing)F(iscal)Y(ear). The thing I wonders is what value does date3 have, I can't see an assignment anywhere.

  • Diego (unregistered) in reply to Diego
    Diego:
    Accalia.de.Elementia:
    You know there is something special in your code when it includes a global variable named "stirfry"

    It's actually strFY, which I guess means str(ing)F(iscal)Y(ear). The thing I wonders is what value does date3 have, I can't see an assignment anywhere.

    I correct myself, I found the assignment for date3. I'm getting old, I get easily confused betwen date1, date2, date3 or n-nn-nnnn-nnnnnnnnnnnnnnnnn. At least he didn't name variables _, __ or ____...

  • (cs)

    Actually... it simply looks like novice code to me. It takes practice for a mind to refactor code so that it makes sense while creating it, and then experience to produce it with meaningfully named variables and such. This is the kind of thing that I would expect from a noob. I have trouble believing that his/her COBAL code was much better. This may be an example of someone who goes through the motions but clearly does not understand what they are doing.

  • John Hensley (unregistered)

    Dim ffffuuuu

  • Zapp Brannigan (unregistered)

    I've seen COBOL coders code in VB and this doesn't look very COBOL-like. The easiest way to tell is that some COBOLers have trouble with event oriented GUI. This programmer could just be a generic idiot.

  • (cs) in reply to Diego
    Diego:
    Diego:
    Accalia.de.Elementia:
    You know there is something special in your code when it includes a global variable named "stirfry"

    It's actually strFY, which I guess means str(ing)F(iscal)Y(ear). The thing I wonders is what value does date3 have, I can't see an assignment anywhere.

    I correct myself, I found the assignment for date3. I'm getting old, I get easily confused betwen date1, date2, date3 or n-nn-nnnn-nnnnnnnnnnnnnnnnn. At least he didn't name variables _, __ or ____...

    The confusion arises from the fact that date2 should be endOfPreviousFY and date3 should be startOfNextFY, which is what makes the < and > correct.

    Well, perhaps that should be "less brutally incorrect"...

    The worst, I think, is that the function returns an empty string or a NULL or something equally unsuitable if the year in PRF_strFY is before the year in strTest_Date.

  • some dude in Europa (unregistered)

    Once again it shows the stupidity of the American date format.

  • the beholder (unregistered) in reply to Some Jerk
    Some Jerk:
    Actually... it simply looks like novice code to me. It takes practice for a mind to refactor code so that it makes sense while creating it, and then experience to produce it with meaningfully named variables and such. This is the kind of thing that I would expect from a noob. I have trouble believing that his/her COBAL code was much better. This may be an example of someone who goes through the motions but clearly does not understand what they are doing.
    Maybe, but isn't he supposed to have that practice and mainly experience? He's a freaking COBOL coder, FFS! Anybody who works on it is near or past his sixties and have been using it since his early or mid-twenties.
  • radarbob (unregistered)

    Its not COBOL the language, its the mind set. Once upon a time.... Coming into a shop that had moved the code base from UNISYS mainframe to PCs, I discovered our compiler supported COBOL 85 so I used the newer COBOL standard for a significant project. You should have seen the shock, yes, shock I say, on a couple of co-workers when they saw the code. No, it was not the "impressive, cool" kind, rather the "what the hell is this!" kind.

    The mainframe is a very isolating environment, if you know what I mean. That and a managerial in-breeding program makes for a very deeply rutted coding shop. And there are very common, classic "forms" in COBOL due the the nature (and limitations) of the language and the task at hand - generally sequential processing of very large record sets.

  • Mainframe Web Dev (unregistered)

    This doesn't look like COBOL / CICS in any fashion.

    I would expect a function to create a data structure and a separate function for moving data into that structure.

    Or possibly, some bizare attempt of avoiding conditional statements since Cobol guys tend to write a log of JCL.

    Or maybe an implementation of the PICTURE command to format a string.

    Sorry, not seeing the COBOL influence here.

  • (cs)
    Dim n As Integer Dim nn As Integer Dim nnn As Integer Dim nnnn As Integer
    C'mon... Everyone knows you use x, y, z, and sometimes a as generic counters.
  • (cs) in reply to the beholder
    the beholder:
    Some Jerk:
    Actually... it simply looks like novice code to me. It takes practice for a mind to refactor code so that it makes sense while creating it, and then experience to produce it with meaningfully named variables and such. This is the kind of thing that I would expect from a noob. I have trouble believing that his/her COBAL code was much better. This may be an example of someone who goes through the motions but clearly does not understand what they are doing.
    Maybe, but isn't he supposed to have that practice and mainly experience? He's a freaking COBOL coder, FFS! Anybody who works on it is near or past his sixties and have been using it since his early or mid-twenties.

    Not really. There were plenty of psuedo-geeks in the 80s using cobal for BBS systems and dial-in RPGs and such. You will find that there are plenty of COBAL hacks in their 30s and 40s, who likely bought all of them source code magazines and books so they could make their own game of snake and whatever else.

    I guess the other explaination is that (s)he never actually understood coding to begin with... but instead learned specific patterns to use in specific situations, and his/her mind is too limited to produce something more elegant.

  • (cs)

    I used to do a lot of training. A big part of my job was teaching state employees, who had done COBOL for longer than I had been alive, to do Java, C++ and .NET (not all at the same time). It's not COBOL that's a problem, but COBOL programmers are built into their habits. The idea of modeling an application as a collection of things and not a collection of steps is a really hard thing to grasp if you have 30 years of practice working the other way.

  • Accalia.de.Elementia (unregistered) in reply to Diego
    Diego:
    Diego:
    Accalia.de.Elementia:
    You know there is something special in your code when it includes a global variable named "stirfry"

    It's actually strFY, which I guess means str(ing)F(iscal)Y(ear). The thing I wonders is what value does date3 have, I can't see an assignment anywhere.

    I correct myself, I found the assignment for date3. I'm getting old, I get easily confused betwen date1, date2, date3 or n-nn-nnnn-nnnnnnnnnnnnnnnnn. At least he didn't name variables _, __ or ____...

    strFY is the correct name, however i think stirfry nicely encapsulates the effect of code that relies on global variables like this on a developer's brain.

  • Some Jerk (unregistered)

    Why the OO red herring? It's not like there's an object oriented language in this story.

  • (cs) in reply to Bob
    Bob:
    I would have thought that regular WTF readers would have grown out of the "language x is bad" mentality. There are few bad languages but many bad programmers. There's little correlation between the two. Apart from PHP.

    +1!

  • (cs) in reply to PiisAWheeL

    That's far too clear. For nested loops, you need to first start with i, then l, then j (for added job security).

  • foxyshadis (unregistered) in reply to Some Jerk
    Some Jerk:
    Actually... it simply looks like novice code to me. It takes practice for a mind to refactor code so that it makes sense while creating it, and then experience to produce it with meaningfully named variables and such. This is the kind of thing that I would expect from a noob. I have trouble believing that his/her COBAL code was much better. This may be an example of someone who goes through the motions but clearly does not understand what they are doing.
    The Cabal is going to revoke your Code Card if you don't stop calling COBOL that.
  • Clayton (unregistered) in reply to PiisAWheeL
    PiisAWheeL:
    Dim n As Integer Dim nn As Integer Dim nnn As Integer Dim nnnn As Integer
    C'mon... Everyone knows you use x, y, z, and sometimes a as generic counters.

    As a one-time COBOL programmer, my immediate fear upon seeing these was that they were carry-overs from part of the ENVIRONMENT DIVISION's WORKING-STORAGE SECTION. I'm a little sad (but mostly happy), to not see them shoehorned into a huge formatting mess.

    if( year < 10 ) { n = year } else if( year < 100 ) { nn = year } ...

    What a nightmare that would've been.

  • (cs) in reply to foxyshadis
    foxyshadis:
    The Cabal is going to revoke your Code Card if you don't stop calling COBOL that.

    HE HE HE. Maybe if they give it a new name... people will start using it again :p

    Spelling wasn't always listed among my strengths... but I am good enough with respect to consistency that it more or less offsets the problem.

  • (cs) in reply to PiisAWheeL
    PiisAWheeL:
    C'mon... Everyone knows you use x, y, z, and sometimes a as generic counters.
    You are TRWTF.
  • fa2k (unregistered)

    It guarantees the ex-Cobol programmer some work in year PRF_strFY+21, when it starts returning NULL (or whatever the default return value in VB is)

  • ByNagesh (unregistered)

    I saw this code before at a presentation given by Nagesh in HyperaBad ... All US companies with outsourced IT now have code like this.

    Soon, congress will change Fiscal year definitions (at the last moment, offcourse) because of problems with leap years

  • sagaciter (unregistered) in reply to PiisAWheeL
    PiisAWheeL:
    Dim n As Integer Dim nn As Integer Dim nnn As Integer Dim nnnn As Integer
    C'mon... Everyone knows you use x, y, z, and sometimes a as generic counters.
    For counting loops I use the prefix LI (loop iterator) for clarity, i.e. lI1, lI2, ...
  • (cs) in reply to PiisAWheeL

    Um no, you use i, j, k and sometimes m as generic counters.

    (cue religious war akin to camelCase versus name_with_underscore)

  • dkallen (unregistered) in reply to PiisAWheeL
    PiisAWheeL:
    Dim n As Integer Dim nn As Integer Dim nnn As Integer Dim nnnn As Integer
    C'mon... Everyone knows you use x, y, z, and sometimes a as generic counters.

    I think you're confusing FORTRAN with COBOL. And doing it incorrectly.

  • (cs) in reply to dkallen
    dkallen:
    PiisAWheeL:
    Dim n As Integer Dim nn As Integer Dim nnn As Integer Dim nnnn As Integer
    C'mon... Everyone knows you use x, y, z, and sometimes a as generic counters.

    I think you're confusing FORTRAN with COBOL. And doing it incorrectly.

    Fortran? Cobol? I make php alphabet soup with those variables.

  • kbiel (unregistered)

    Should have gotten the COBOL programmer a license for a .NET COBOL compiler, because VB.NET wasn't WTF enough for s/he/it.

  • (cs) in reply to kbiel

    More EBiggotry ... eh?

  • Some Jerk (unregistered)

    Double-click the pretty print code for lulz.

  • Minos (unregistered)

    n nnn, nnnn, hey hey hey, good bye!

  • (cs) in reply to sagaciter
    sagaciter:
    PiisAWheeL:
    Dim n As Integer Dim nn As Integer Dim nnn As Integer Dim nnnn As Integer
    C'mon... Everyone knows you use x, y, z, and sometimes a as generic counters.
    For counting loops I use the prefix LI (loop iterator) for clarity, i.e. lI1, lI2, ...
    +1, very evil, but not very original.
  • (cs) in reply to PedanticCurmudgeon
    PedanticCurmudgeon:
    COBOL: 5 decades of giving dimwit programmers the illusion of competence.

    Everyone know many big systems developed by big company like IBM still run on COBOL. COBOL: giving lot of business to developers in India.

  • PedanticCurmudgeon (unregistered) in reply to Nagesh
    Nagesh:
    PedanticCurmudgeon:
    COBOL: 5 decades of giving dimwit programmers the illusion of competence.

    Everyone know many big systems developed by big company like IBM still run on COBOL. COBOL: giving lot of business to developers in India.

    Your honor, I rest my case.

  • (cs) in reply to Bob
    Bob:
    I would have thought that regular WTF readers would have grown out of the "language x is bad" mentality. There are few bad languages but many bad programmers. There's little correlation between the two. Apart from PHP.

    It isn't a matter of one language being worse than another, it's a matter of a developer coming from one language and treating the new language like it's the old one. Coding python like it's C#, coding Ruby like it's Javascript, etc.

  • Spewin Coffee (unregistered) in reply to Bob

    TRWTF is your incredibly false assumption that PHP is a bad language and all programmers who write in PHP are writing bad code. I will agree with anyone that says that PHP makes it easy to write bad code because you can do the same thing about 25 different ways of which only two of those ways is correct. Although, the same can be said of C++ and other languages that hand you powerful tools to work with. In the hands of a novice, you get crap output for both of the languages I mentioned because it takes years to master which of the 25 different ways to accomplish a task is the correct approach.

    There are many bad languages (APL, Prolog, LISP, COBOL, any assembly language, Ruby without Rails, etc.) and many bad programmers - the latter are what this site is dedicated to exposing to the world. Worse Than Fails happen any time you mix the two. If you think otherwise, you haven't been programming as long as I have. Interestingly, I can generally identify bad programmers a mile away by how poorly they use whitespace, where they place their comments, variable and function names, and the content of the comments. Basically, is the code elegant or not? That tells me more about their coding and personal habits (including hygiene) than anything else.

    Your inane comment, Bob, indicates you might be a bad programmer. Or at least clueless.

Leave a comment on “Globally Fiscal Year”

Log In or post as a guest

Replying to comment #:

« Return to Article