Click here to Skip to main content
15,889,877 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: It's a jungle in there Pin
Sander Rossel9-Aug-11 20:26
professionalSander Rossel9-Aug-11 20:26 
GeneralRe: It's a jungle in there Pin
Fabio Franco10-Aug-11 3:47
professionalFabio Franco10-Aug-11 3:47 
GeneralRe: It's a jungle in there Pin
Sander Rossel10-Aug-11 7:47
professionalSander Rossel10-Aug-11 7:47 
GeneralRe: It's a jungle in there Pin
Fabio Franco10-Aug-11 9:25
professionalFabio Franco10-Aug-11 9:25 
GeneralRe: It's a jungle in there Pin
Sander Rossel10-Aug-11 11:14
professionalSander Rossel10-Aug-11 11:14 
GeneralRe: It's a jungle in there Pin
Fabio Franco11-Aug-11 5:01
professionalFabio Franco11-Aug-11 5:01 
GeneralRe: It's a jungle in there Pin
Sander Rossel11-Aug-11 11:59
professionalSander Rossel11-Aug-11 11:59 
GeneralRe: It's a jungle in there Pin
cpkilekofp16-Aug-11 13:02
cpkilekofp16-Aug-11 13:02 
Fabio Franco wrote:
Is it just me or everytime someone talks about bad code, "VB" shows up? Sigh | :sigh:


It's just you - the worst code was (and may still be) written in C/C++ by former BASIC, COBOL, and FORTRAN programmers still new to Dykstra's "GoTo Considered Harmful" dictum...which didn't prevent them from abusing every feature in the language. I spent years cleaning such code, and still don't think I got everything fixed the way it should be (e.g. readable).

BASIC, COBOL, and FORTRAN all allowed really bad code to be developed, real "spaghetti" code, but recasting the same engineering in C (or, worse by two or three orders of magnitude in this age of templates, C++) permits monstrosities to be created that even the coders may not be able to understand after a month or two working on other projects. Worse, with macros, you can make C/C++ look like BASIC or FORTRAN...perhaps even COBOL, though I've never seen anyone sick enough to try that (yes, I've seen examples of the other two practices, and it just makes you ill to see it if you ever loved C).

As for On Error Resume Next....what other language system can anyone name that is as ubiquitous as BASIC, COBOL, FORTRAN, or C that allowed a non-in-line interrupt-style error handler to be constructed? Yes, the only one that comes to my mind, as well, is BASIC. On Error GoTo was a huge advance for its time; On Error Resume Next was, really, just a way to allow "old-fashioned" error handling (checking output variables and return values for error conditions) to be used or not. Most of the cocks-of-the-progamming-walk who complain about the foibles of this feature just weren't around to complain about it in 1968 when Dartmouth BASIC was released; if it seems a dated feature now, well, OF COURSE IT IS.

Hmmm, does this count as a rant? Laugh | :laugh:
GeneralRe: It's a jungle in there Pin
Fabio Franco17-Aug-11 1:36
professionalFabio Franco17-Aug-11 1:36 
GeneralRe: It's a jungle in there Pin
GibbleCH10-Aug-11 3:48
GibbleCH10-Aug-11 3:48 
GeneralRe: It's a jungle in there Pin
Sander Rossel10-Aug-11 7:57
professionalSander Rossel10-Aug-11 7:57 
GeneralRe: It's a jungle in there Pin
Bernhard Hiller9-Aug-11 20:32
Bernhard Hiller9-Aug-11 20:32 
GeneralRe: It's a jungle in there Pin
BobJanova10-Aug-11 1:36
BobJanova10-Aug-11 1:36 
GeneralRe: It's a jungle in there Pin
Amar Chaudhary10-Aug-11 2:50
Amar Chaudhary10-Aug-11 2:50 
GeneralRe: It's a jungle in there Pin
Member 776995910-Aug-11 8:36
Member 776995910-Aug-11 8:36 
GeneralRe: It's a jungle in there Pin
Br.Bill10-Aug-11 6:58
Br.Bill10-Aug-11 6:58 
GeneralRe: It's a jungle in there [modified] Pin
RobCroll14-Aug-11 3:29
RobCroll14-Aug-11 3:29 
GeneralRe: It's a jungle in there Pin
GibbleCH15-Aug-11 5:31
GibbleCH15-Aug-11 5:31 
GeneralRe: It's a jungle in there Pin
richard_k15-Aug-11 21:34
richard_k15-Aug-11 21:34 
GeneralMessage Removed Pin
8-Aug-11 4:13
professionalN_tro_P8-Aug-11 4:13 
GeneralRe: Validation fails so lets not use it Pin
fjdiewornncalwe9-Aug-11 3:28
professionalfjdiewornncalwe9-Aug-11 3:28 
GeneralRe: Validation fails so lets not use it Pin
thoiness1-Sep-11 4:55
thoiness1-Sep-11 4:55 
GeneralRe: Validation fails so lets not use it Pin
Shameel9-Aug-11 4:38
professionalShameel9-Aug-11 4:38 
GeneralRe: Validation fails so lets not use it Pin
Chris Berger9-Aug-11 6:18
Chris Berger9-Aug-11 6:18 
GeneralRe: Validation fails so lets not use it Pin
Lutosław11-Aug-11 23:18
Lutosław11-Aug-11 23:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.