Worst source code EVER
-
Okay, last day or so ago, I asked what your favorite programming job was. Now, what is the worst, nastiest, ugliest source code you ever saw and what made it so horribly bad? Not commented (heh heh yeah, as if) or one-letter (or zero-letter?) variable names? Written in a dead programming language that should be dead, but your client is still using it for some God-awful reason? The list goes on...so spew!
Sincerely Yours, Brian Hart
-
Okay, last day or so ago, I asked what your favorite programming job was. Now, what is the worst, nastiest, ugliest source code you ever saw and what made it so horribly bad? Not commented (heh heh yeah, as if) or one-letter (or zero-letter?) variable names? Written in a dead programming language that should be dead, but your client is still using it for some God-awful reason? The list goes on...so spew!
Sincerely Yours, Brian Hart
At the least the code written for the Obfustacted Perl Contest was intentionally awful. Here's an example :-
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;printLooks more like a dump of compiled code than source...
-
Okay, last day or so ago, I asked what your favorite programming job was. Now, what is the worst, nastiest, ugliest source code you ever saw and what made it so horribly bad? Not commented (heh heh yeah, as if) or one-letter (or zero-letter?) variable names? Written in a dead programming language that should be dead, but your client is still using it for some God-awful reason? The list goes on...so spew!
Sincerely Yours, Brian Hart
I was hired to port a case management system for intellectual properties (patents, trademarks, etc) to Java/EE. It was written in Power Basic (Sybase 3.5 GL language) by someone who learned programming in C64 basic. I have not seen such clutter before in my life. I found huge blocks of code that literally could've been removed, countless dependencies on global variables, ugly SQL (they often stored their queries in the database - WTF?). Such a mess. I still have nightmares. On several occasions, my design decisions were overridden by their management. One case involved user role management. I proposed the standard role/object/model that is well understood. They agreed, but refused to understand basic set theory. An empty set of access rights would mean "all access to everything" according to them. I responded that is a bad idea, and makes security administration overly complex, and potentially insecure. They would not understand (even after countless of negative use cases). I implemented their stupid ideas. Later on they did not want to pay for my work on the role management, because "it was implemented badly". WTF? They said I did not implement it according to their specifications. Guess what? The "specifications" was my original design! I told them I don't do business with liars, and we went to court. I got half in a settlement. If I had wanted 100% of what they owed, the case would've taken at least one more year. I don't want to spend time in court, I want to create, so I grabbed the 50% and vowed to myself not to fall into that trap again. I was screwed royally on that gig. Code wise and business wise. I have also encountered code for an installer driver that was spaghetti in several dimensions. Structure wise, and thread wise! The code had bugs that the original authors could not track down in 6 months. I spent two weeks with a colleague trying to track it down. I just gave up and kept bugging the management until I was approved to ditch the code, and rewrite it. It turned out that another division in the company had written a really good installer driver, so the story had a good ending!
-- Kein Mitleid Für Die Mehrheit
-
For me, Worst code I see everyday is Catch block with no statements
// ♫ 99 little bugs in the code, // 99 bugs in the code // We fix a bug, compile it again // 101 little bugs in the code ♫
I think they are excellent. They weed out the pros from the wannabes. Just fire the wannabes, and hire new people. Continue until all empty catch blocks are gone!
-- Kein Mitleid Für Die Mehrheit
-
Probably the VB.net I had to work on last year... but there was also the this C code I wrote back in '94...
#define begin {
#define end }
#define then /**/
#define mod %
#define and &&
#define or ||:-O
I think I know what your first programming language is... :-D
-- Kein Mitleid Für Die Mehrheit
-
Okay, last day or so ago, I asked what your favorite programming job was. Now, what is the worst, nastiest, ugliest source code you ever saw and what made it so horribly bad? Not commented (heh heh yeah, as if) or one-letter (or zero-letter?) variable names? Written in a dead programming language that should be dead, but your client is still using it for some God-awful reason? The list goes on...so spew!
Sincerely Yours, Brian Hart
When I first started my current job, I was hired as a contractor to help the guy currently on the project. Talking to him, he sounded fairly sharp, if a little vague at times. After I found something that looked like this:
#define ENDCAS1 case 23: \
DoThing();\
break;\
case 36:\
DoThing2();\
break;\
default:\
DoThing3();\switch (operation)
{
case 1:
DoThis();
break;
case 14:
DoThat();
ENDCAS1
}in his code, I knew better.
Software Zen:
delete this;
-
Okay, last day or so ago, I asked what your favorite programming job was. Now, what is the worst, nastiest, ugliest source code you ever saw and what made it so horribly bad? Not commented (heh heh yeah, as if) or one-letter (or zero-letter?) variable names? Written in a dead programming language that should be dead, but your client is still using it for some God-awful reason? The list goes on...so spew!
Sincerely Yours, Brian Hart
Code that forced Oracle tables to behave like ISAM files
Ger
-
For me, Worst code I see everyday is Catch block with no statements
// ♫ 99 little bugs in the code, // 99 bugs in the code // We fix a bug, compile it again // 101 little bugs in the code ♫
Oh, yeah, on the assignment I just started there are lots of those... :sigh: One in particular is around an access to a Dictionary -- in case the key doesn't exist I guess. Personally, I'd check with ContainsKey, but not the guy who wrote this.
-
I think I know what your first programming language is... :-D
-- Kein Mitleid Für Die Mehrheit
The second time I took a course in C, the textbook was "C as a Second Language, For Native Speakers of Pascal", I still have it right here. (But BASICplus was my first programming language.)
-
"The data was imported daily from SAP" But wait... I thought SAP did everything. Aren't all of those annoying little side-apps with their interface and import requirements supposed to just go away after a successful SAP implementation? And shouldn't costly, difficult-to-manage programmers be a thing of the past? Or was I misled on these points?
SAP requires costly, difficult-to-manage programmers be available in very large numbers so that one may be sacrificed daily to appease the beast! The same thing goes for Oracle ERP too!
-
Code that forced Oracle tables to behave like ISAM files
Ger
Oracle was implemented on IBM mainframes using VSAM! ;P
-
Okay, last day or so ago, I asked what your favorite programming job was. Now, what is the worst, nastiest, ugliest source code you ever saw and what made it so horribly bad? Not commented (heh heh yeah, as if) or one-letter (or zero-letter?) variable names? Written in a dead programming language that should be dead, but your client is still using it for some God-awful reason? The list goes on...so spew!
Sincerely Yours, Brian Hart
-
Okay, last day or so ago, I asked what your favorite programming job was. Now, what is the worst, nastiest, ugliest source code you ever saw and what made it so horribly bad? Not commented (heh heh yeah, as if) or one-letter (or zero-letter?) variable names? Written in a dead programming language that should be dead, but your client is still using it for some God-awful reason? The list goes on...so spew!
Sincerely Yours, Brian Hart
A MS Access app(lol) that a accountant wrote over some years. It looked a excel documents and another access database all over the network using mapped drives. It produced a huge excel document that all the executives used every day. Oh and the excel documents were created by our own programs which we had full access to the database so I have yet to understand why this was created.
-
ON ERROR RESUME Nothing more, nothing less...
Software Kinetics Wear a hard hat it's under construction
Metro RSSAnd its more verbose but equally horrible Java cousin:
try {
mystery1();
mystery2();
mystery3();
mystery4();
theRestOfTheProgram();
} catch(Exception e) {};I've been bitten by that a few times, testing something that is not behaving as it should, but not producing any error messages. What's the point of having exceptions, and just as importantly, a managed language with automatic line-numbered stack traces etc, if you're going to suppress all of that goodness? :omg:
-
Okay, last day or so ago, I asked what your favorite programming job was. Now, what is the worst, nastiest, ugliest source code you ever saw and what made it so horribly bad? Not commented (heh heh yeah, as if) or one-letter (or zero-letter?) variable names? Written in a dead programming language that should be dead, but your client is still using it for some God-awful reason? The list goes on...so spew!
Sincerely Yours, Brian Hart
I had to check on some Visual Basic code a few month ago, and saw a funcion called
isNada(obj)
The function returns true if the obj = Nothing I'm no saying that the funcion is wrong, but the mix of languages just pissed me of, if he just called it isNothing, isNull or esNada maybe I'll just smile a little
Saludos!! ____Juan
-
Okay, last day or so ago, I asked what your favorite programming job was. Now, what is the worst, nastiest, ugliest source code you ever saw and what made it so horribly bad? Not commented (heh heh yeah, as if) or one-letter (or zero-letter?) variable names? Written in a dead programming language that should be dead, but your client is still using it for some God-awful reason? The list goes on...so spew!
Sincerely Yours, Brian Hart
Brian C Hart wrote:
Now, what is the worst, nastiest, ugliest source code you ever saw
I'm still writing it :-D Danny
-
Okay, last day or so ago, I asked what your favorite programming job was. Now, what is the worst, nastiest, ugliest source code you ever saw and what made it so horribly bad? Not commented (heh heh yeah, as if) or one-letter (or zero-letter?) variable names? Written in a dead programming language that should be dead, but your client is still using it for some God-awful reason? The list goes on...so spew!
Sincerely Yours, Brian Hart
There was this code they wrote a SQL Server stored procedure just for completing a string with zeroes to the left until its maximum length, in pseudo code it was like this:
if value.Length < 2
value = "0000000" + value
else
if value.Length < 3
value = "000000" + value
else
if value.Length < 4
value = "00000" + value
else
if value.Length < 5
value = "0000" + value
else
if value.Length < 6
value = "000" + value
else
if value.Length < 7
value = "00" + value
else
if value.Length < 8
value = "0" + valueWhen I saw this, I was like :omg: and wondered what else I was going to find :~. I feared that I would :(( on the course of this project and really hoped no to :sigh: along the way. In the end I had a lot of :doh:
"To alcohol! The cause of, and solution to, all of life's problems" - Homer Simpson
-
ON ERROR RESUME Nothing more, nothing less...
Software Kinetics Wear a hard hat it's under construction
Metro RSSI once had to take over a VB6 project (maybe 300 modules, each a few hundred lines) which had "On Error Resume Next" at the start of each and every routine. There were errors being thrown (and ignored) everywhere. I spent days just unraveling the circular references :sigh:. In critical places, I was able to add proper error handling (or at least check Err.Number to see if something important was being ignored) but did not have time to address them all. Truth be known, after a while, I got to LIKE "On Error Resume Next" :-D. Maybe it was Stockholm Syndrome, but it seemed like there was a certain..."freedom" in knowing the code just will not stop. Kind of like being a passenger an automobile accident. Once stuff starts happening, there is not a lot you can do until the big crunch at the end. :omg:
-
Okay, last day or so ago, I asked what your favorite programming job was. Now, what is the worst, nastiest, ugliest source code you ever saw and what made it so horribly bad? Not commented (heh heh yeah, as if) or one-letter (or zero-letter?) variable names? Written in a dead programming language that should be dead, but your client is still using it for some God-awful reason? The list goes on...so spew!
Sincerely Yours, Brian Hart
About a decade ago, I was a consultant at a data-mining company where most of the software "developers" were self-taught programmers with PhDs in other areas. One of the programs resulting from this had a 40-page C++ function! This company's software was unreliable, and was constantly crashing and being patched. Another place I worked at had convoluted C# code with no comments in their main system. The simplest modifications required a goddamn research project to trace the interactions among multiple files/classes. The owner of the company told me when he had the software written, he told the developer not to bother with comments to speed up development; "we don't need those!". And he wondered why bug fixes and new features took so long to add!
-
Okay, last day or so ago, I asked what your favorite programming job was. Now, what is the worst, nastiest, ugliest source code you ever saw and what made it so horribly bad? Not commented (heh heh yeah, as if) or one-letter (or zero-letter?) variable names? Written in a dead programming language that should be dead, but your client is still using it for some God-awful reason? The list goes on...so spew!
Sincerely Yours, Brian Hart