- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
"For loops? Of course I know what loops are for!"
Admin
The WTF of the coder seems to be hiding inside the WTF of the language for me.
Admin
Cobal programmers give me gas... or... well... this one just did.
Admin
But what happens if there's a June 31 one of those years? Huh?
Admin
You know there is something special in your code when it includes a global variable named "stirfry"
Admin
COBOL: 5 decades of giving dimwit programmers the illusion of competence.
Admin
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.
Admin
TRWTF is global variables </facepalm>
Admin
Never mind. That boundary actually works okay.
Admin
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;
}
Admin
Dim nnnnoooo As Comment
Admin
I call shenanigans. Real COBOL programmers only type in all caps.
Admin
This makes two Remy Porter articles in a row with no HTML comments. And that, my friends, is the real WTF.
Admin
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.
Admin
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.
Admin
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 ____...
Admin
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.
Admin
Dim ffffuuuu
Admin
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.
Admin
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.
Admin
Once again it shows the stupidity of the American date format.
Admin
Admin
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.
Admin
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.
Admin
Admin
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.
Admin
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.
Admin
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.
Admin
Why the OO red herring? It's not like there's an object oriented language in this story.
Admin
+1!
Admin
That's far too clear. For nested loops, you need to first start with i, then l, then j (for added job security).
Admin
Admin
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.
What a nightmare that would've been.
Admin
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.
Admin
Admin
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)
Admin
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
Admin
Admin
Um no, you use i, j, k and sometimes m as generic counters.
(cue religious war akin to camelCase versus name_with_underscore)
Admin
I think you're confusing FORTRAN with COBOL. And doing it incorrectly.
Admin
Admin
Should have gotten the COBOL programmer a license for a .NET COBOL compiler, because VB.NET wasn't WTF enough for s/he/it.
Admin
More EBiggotry ... eh?
Admin
Double-click the pretty print code for lulz.
Admin
n nnn, nnnn, hey hey hey, good bye!
Admin
Admin
Everyone know many big systems developed by big company like IBM still run on COBOL. COBOL: giving lot of business to developers in India.
Admin
Your honor, I rest my case.
Admin
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.
Admin
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.