- 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
So... I suppose that would make it half a line in perl?
Admin
Admin
The RWTF is Java...
Seriously you'd never find a VB programmer stupid enough to write code like this.
It's because everyone who writes in Java has the IQ of a monkey...
Admin
Imagine something exactly like this, but written in vb6. That's the program I was hired to work on. Everything looks like this.
The function that I'm currently working on takes a record from a database and puts it into a file for the user to upload. In this function the user validates the data for the current record, writes various different reports, moves the data, and performs company based checks.
Here's a psudo-code breakdown of how it works.
open itemtable recordset recordset.movefirst for i=1 to recordset length if validate_data_condition1 then ect... till all data is validated end if if itemtable!Itemtype = 2 then if reportType = 1 then blablabla elseif reportType = 2 then blablabla else if companyNumber=1234567 dosomething specific end if elseif itemtype = 34 then if reporttype = 4 blablabla end if end if select * from item_sub_table where itemtable.index = itemsubtable.index do ect..... next
There are functions that are over 70 printed pages that I haven't even started to work on. That's 70 pages at times new roman, single spaced, no wordwrap (yes a lot of it flows off the end of the page and is lost), font size 8.
At least i'm feeding my family.
Admin
Don't sell those monkeys short!
-NotAn
Admin
If you feed it through a player piano, out comes "The William Tell Overture".
Admin
Using && is the coding equivalent of juicing.
Admin
Exactly. I about lost my lunch following that thing.
Admin
The "not having to maintain it" part sounds nice, and is the philosophy that the other 20 or 30 people to work on it before me thought (and they were right!). This thing comes from a long legacy of copy/pasted mangled code, undocumented acronyms (wtf is a BLIM?), and "TODO: delete this before production" comments dating back to 1996.
That's why mine's going to look like arse. The original is such an unreadable, unmaintainable POS that there's no way to tell what stuff still needs to be there or not, without some input from the business guys who will actually be using the thing.
Admin
:-(
the sad thing is I'm trying to clean up code that looks like this right now... and it is what currently generates our invoices!
Admin
lol. I believe it.
Admin
Yeah, you certainly don't want the domain (business) experts providing input into what the end product is like. That could put some maintenance programmers out of a job... :(
Admin
This reminds me of a song:
wara ningyo ni, wara ningyo ni, wara ningyo ni gossun gossun gosun kugi~!!
yi er san yi er san one two three one two three ichi ni san, yi er san yi er san one two three one two three ichi ni san, yi er san yi er san one two three one two three ichi ni san,
eins zwei guten morgen yi er yi er ichi ichi ichi ichi
hi fu mi hi fu mi hi fu mi hi fu mi hi hi fu hi fu mi hi fu mi hi fu mi hi fu mi hi hi fu hi fu mi hi fu mi hi fu mi hi fu mi hi hi fu hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi fu mi yo hi fu mi yo
...
don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu (kanji naiwa)
don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu don-tsu (itaku naiwa)
chiki-ti chiki-ti chiki-ti chiki-ti chiki-ti chiki-ti chiki-ti chiki-ti ugigi ugigi ugigi ugigi ugigi ugigi ugigi ugigi
Shanghai Shanghai Shanghai Shanghai Hourai Hourai Hourai Hourai France Hollands Tibet Kyoto London Russia Orleans!
kirai kirai, lovin' (an a an an a an~) dare ga dare ga, can't be alive without you
doushite, naze ka~shi~ra~ (an a an an) wh-why why don't I miss you alot for-ever~
shiranai wa, sonna mahou omoi wa tsuta~eta~ra~ ko~wa~re~cha~u~
anata towa chigau kara hitono kokoro made kantan ni~ nu~sumana~ide~~
Admin
You seem to have misinterpreted (or I missed sarcasm on your part). I want their input. Just don't have it. "Well, you have the version that's there now. Just do the same thing it's doing." I'm glad they reminded me how simple it is.
Admin
Wait, where did anyone say it worked?
Admin
Hahaha... that's hilarious - VB programmers not being stupid enough for stuff like that, gimme a break...
Sorry, but aside the fact that there are morons in all parts of the industry (and anywhere else, at that) and that any language can be abused in terrible ways if you are dumb enough, the most disastrous flapdoodle I've seen in program code was either done in older host languages or in VB...
This might stem from the fact that you can do nonsense in VB that Java (like other OO languages) does not even have keywords and/or constructs for.
Now be honest - you have never used another language than Basic/VB on another OS than Windows, right? ;o)
Admin
Spot on. But I'm even more worried about that big try/catch statement enclosing the whole code. Perhaps it is there to achieve the same result as this ingenious construct that I once encountered:
Yes, 600 LOC in one try/catch, and yes, the catch-block was empty... and yes, you perhaps guessed it already: That guy did not know about the return-statement and wanted to leave the method right there in the middle....
Considering all that it is somewhat less surprising that he did not know about the throw-statement and had to craft his NullPointerException "by hand" ;o))
Admin
Does not look that bad to me, really. At least not if it was machine-generated from some algorithm language like state charts or matlab. Seen code like that, and actually computed the number of paths through a generated monstrosity that had many many billions of possible paths. 700 nested conditionals has a phenomenal complexity.
Admin
And then an actually skilled programmer comes along, looks at the Java original and where it's called and notices that if you generalize and simplify the calling classes a bit, you don't even need that method... ending up with -20 lines for the method (it's eliminated, and he saved code in the calling classes too).
Admin
Out of curiosity, did you determine the Cyclomatic Complexity of this method? http://en.wikipedia.org/wiki/Cyclomatic_complexity
I know there are tools that will do this for you.
Admin
Admin
Wait! I've played this game! ASCII man's falling down a rocky cliff and you have to move him around. Forget what it's called though.
Admin
Hardly. I got my BS in CS using C++ for all my programming classes. Took C#, Java, OpenGL (using C++), and finally VB as electives. My 3 years professionally programming since then have taught me that the programming language has no impact on what really matters in programming. "Can you think logically or not?".
Admin
Once again, in English this time? lol... like that prove that... go get your sarcasm detector repaired...
Admin
I forgot Perl in Unix... and tons of VMS work prior to my degree. :) So wrong on all counts.
Admin
Agreed. People will act like somebody who's an expert in a particular language is a better candidate for a job because they know the ins and outs better than a n00b. But, at least from my experience, 95% of the hurdles you run into aren't a result of your lack of knowledge about a language, rather the batshit crazy code that your predecessor left you with. And it doesn't matter what language he wrote it in. It will always suck.
I guess if you're making something totally new from scratch, getting a bunch of guys who are really good in a particular language might be helpful to keep WTFs down to a minimum, though.
Admin
It's only 7 characters in perl:
@ if; ‽
Admin
That's what I said, amongst other things:
You were the one who was over-generalizing, mind you. And it was not the least bit sarcastic or funny, if that might have been your intent.
Ah, so you like to take this out over the number of languages, quality of education and length of career? ;o)
Ok. I've got nearly 20 computer languages under my belt, starting with Assembler and ranging to object oriented and functional languages and furthermore specialized languages for parallel computing, neural networks etc.
And yes, I also did Basic and VB, so I know what I'm talking about.
I've been using all those on several different platforms and operating systems in around 15 years of professional development and consulting in various branches of the IT industry.
The fact that you know 3 or 4 (if you count OpenGL ...) languages does make your generalization non the wiser.
And concerning your ridicule of brazzy's comment:
ever thought about the fact that not all people here are native speakers?BTW, I'm not an (english) native speaker. How about you? ;o)
Admin
That looks pretty much like the software I had to maintain for two years. Only it was written in Delphi. 5. By a guy who taught himself Delphi with one of those infamous 'teach yourself in 24-hours' books.
To make matters worse, it was a very specific laboratory-oriented application (calculating concentrations of chemical compounds in ICP-AES/OES, GC-MS, LC-MS and GC-MS/TOF data), I didn't know anything about what it was supposed to do, it contained 125 forms and more than 150,000 lines of code, and most functions were > 1000 lines. It fully supported the 'magic pushbutton' antipattern and the guy who wrote it left the company before I started on it.
Ah, the times I still worked there...
Admin
I have also used a variety of programming languages, some long before college, and also have almost exactly 3 years of professional experience. But I disagree. The ability to think logically is necessary but insufficient for writing good programs in a short amount of time. While a true fool can write serial WTFs in every language, even a genius programmer will have a hard time implementing a complex application in assembler, for instance. I'm not even talking about languages that are inherently deficient, i.e. that will not allow you to write a good program in any amount of time. (By "good", I mean at least: correct, feature complete, efficient and easy to use. I left portability out of this list because it may not be essential for a given purpose, but I still value it highly.)
Admin
Most likely this started out as a short method, but through years of maintainers adding code snippets here and code snippets there, it grew into this beast.
Admin
I once had to maintain some PL/SQL code like that which was called by a VB program. Instead of updating the code, I spent a about a month figuring out what it did and replaced it with a SQL cursor and a fetch loop in VB. This code had been a royal PITA for everyone for years. Few things at work were more fun then issuing the following request to the DBAs:
DROP package xxxxx; DROP package yyyyy; DROP package zzzzz;
Gone. Just gone. I think I got a few free beers for that one...
Admin
Your english is fine, its your assertions that are retarded.
You accuse me of having only ever programmed in VB on Windows then accuse me of making it about experience? You brought it up. I was only responding to you... but then you probably wanted to bring it up so you can talk about your experience. Too bad that in this industry, Old Programmer != Good Programmer. In fact I'd be willing to bet that, more often than not, Old Programmer = Horrible Programmer unable to grasp new concepts/languages/ideas/skills :P
You say "Hahaha" in responce to my comment THEN dictate to me that my comment was neither funny nor sarcastic THEN state that you're unsure of my intent. Isn't sarcasm determined by the person talking and funny determined by the individual?
I am a native english speaker as well as bilingual... and I don't feel the least bit bothered by laying into brazzy (or you)... and I won't until he (or you) can show me instances of him (or you) getting on to other posters for saying "TRWTF is VB."
On a final note... If you really think the problem is that people get onto VB because of what you can write in that language that Java won't let you do... why don't they voice the same complaints against Assembly, Binary, C++, etc. Its really not the language, you can write crap in any language. It's the person using it. Thus it shouldn't be "TRWTF is VB/Java/C++/etc."
Admin
But the programmer doesn't often determine the language being used. What matters is the Programmer and how they can logically wield the tools given. They are the one that either uses or abuses the language, whatever it may be. As proved by this WTF, you can write crap in any language. Now, for bonus points, tell me how VB.Net is "inherently deficient" when compared to Java/C#/etc.?
Admin
If I promise not to code while under the influence, can I have some? Actually, maybe not, I'd be very tempted to replace the sugar in the managers tea...
Admin
"Finally" indeed...
Admin
nasty! It's synchronized too - so more like a time trial than the peloton! one rider at a time please...
Admin
It looks like us readers aren't the only ones still getting used to the new new new name for the site. The QuadraSort link is to worsethanfailure.com!
Admin
I feel ill... really ill. I read this while coding and repeating my mantra - less than 30 lines per function please. Refactor! Oh Power above save us.
Admin
Finally indeed.
Admin
Doh, beaten like a red-headed stepchild.
Admin
The finally{} at the end makes this one quite poetic. Never saw a better place for "finally", neither from the perspective of coder or reader :-)
Admin
The last statement is exactly what I felt when I read it.
Finally.
Admin
Uh... This looks like code I once wrote!!! (Dear god forgive me!)
Admin
Obviously, this code is implementing some Enterprise Business Logic (tm) ...
Admin
Admin
Admin
Slowly and painfully.
Admin
Say what you like: At least the guy knows about try/catch. -both- my suppliers debug their code by inserting printf() at interesting points in the program. (oddly enough, they refuse to debug issues that can't be reproduced within a few minutes)
Admin
That "finally" at the end is just perfect.