DEV Community

Discussion on: What's the weirdest coding practice you've seen?

Collapse
 
jfrankcarr profile image
Frank Carr

Worst? Well, there's a lot of legacy VB6 code I've seen that would qualify for that. Big, monolithic, blocks of spaghetti code, inconsistent data access jumbled throughout, duplicate code, etc. The typical mess you see in corporate legacy systems.

Here's one from the olden DOS days... Way back when I first starting programming I was mostly writing MASM and C code at a company where most of the other development was QuickBASIC. Instead of using a decent text editor, they used the old BASICA interpreter to write code which required them to still use line numbers. It was painful to watch.

I was asked to debug a particular set of programs since my "terminate and stay resident" program was causing them to lock up. My boss berated my skills in front of the whole team, something every junior programmer on their first job enjoys. Here's what I found in a chunk of code that was duplicated about 5 times by the senior developer....

4000 REM Lookup Line Item
4010 GOTO 4000
4020 (call to my resident program here)