Click here to Skip to main content
15,899,754 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.

 
JokeRe: Clever For-loop Pin
leppie24-Jun-08 6:06
leppie24-Jun-08 6:06 
GeneralRe: Clever For-loop Pin
supercat924-Jun-08 6:30
supercat924-Jun-08 6:30 
GeneralRe: Clever For-loop Pin
Tristan Rhodes24-Jun-08 23:05
Tristan Rhodes24-Jun-08 23:05 
GeneralRe: Clever For-loop Pin
supercat925-Jun-08 6:26
supercat925-Jun-08 6:26 
GeneralRe: Clever For-loop Pin
John R. Shaw24-Jun-08 9:20
John R. Shaw24-Jun-08 9:20 
JokeRe: Clever For-loop Pin
Ariel Kazeed26-Jun-08 23:38
Ariel Kazeed26-Jun-08 23:38 
GeneralRe: Clever For-loop Pin
Paul Conrad1-Jul-08 19:31
professionalPaul Conrad1-Jul-08 19:31 
GeneralCobol Horror PinPopular
_Maxxx_23-Jun-08 17:23
professional_Maxxx_23-Jun-08 17:23 
I just found this board, and just had to share...

A programmer had the job of writing a routine to perform calculations based upon fees over time (the detail's not important - essentially she needed to know the number of days between two dates, and apply an algorithm something like 'for the first 30 days, a fee of 10c per day, up to 45 days, 25c per day, from 46 through to 100 45c per day)

Now, there's 1001 ways to do it - but I couldn't believe that she produced a huge Cobol program to do it.

It contained a huge array of constants, called January1984, February1984 etc. etc. etc. wach one being the number of days in that month.
Then she had an
If FromDateMonth = "January" and FromDateYear = 1984
Subtract DateDay from January1984 Giving calcDays.
Else If FromDateMonth = "February" and FromDateYear = 1984
Subtract DateDay from February1984 Giving calcDays

etc.
etc.

for every month of every year for about ten years.

THEN she repeated the same set of If's for the end date.
THEN she repeated the same set of If's, in a loop, for each month in between!

I couldn't believe that any programmer could be quite so dumb! When asked, she just said she couldn't think of a better way of doing it! (Oh, it had taken her nearly two weeks to do - I had estimated a day, and allowed her a week, as she was new to the company, though not to Cobol)

And sure, I should have looked at the code before she got so far - but she wasn't a junior (and she never became a senior)

(Oh and excuse my code - it's been a long time since I did Cobol and can't really remmeber the syntax)

Take a chill pill, Daddy-o

.\\axxx
(That's an 'M')

JokeRe: Cobol Horror Pin
Nelek23-Jun-08 21:55
protectorNelek23-Jun-08 21:55 
JokeRe: Cobol Horror Pin
CPallini23-Jun-08 22:15
mveCPallini23-Jun-08 22:15 
GeneralRe: Cobol Horror Pin
VentsyV24-Jun-08 5:22
VentsyV24-Jun-08 5:22 
GeneralRe: Cobol Horror Pin
_Maxxx_24-Jun-08 11:31
professional_Maxxx_24-Jun-08 11:31 
GeneralRe: Cobol Horror Pin
RichardM126-Jun-08 15:01
RichardM126-Jun-08 15:01 
GeneralRe: Cobol Horror Pin
_Maxxx_26-Jun-08 15:04
professional_Maxxx_26-Jun-08 15:04 
GeneralRe: Cobol Horror Pin
BillW3329-Aug-08 9:02
professionalBillW3329-Aug-08 9:02 
GeneralRe: Cobol Horror Pin
leppie24-Jun-08 6:11
leppie24-Jun-08 6:11 
GeneralRe: Cobol Horror Pin
_Maxxx_24-Jun-08 12:28
professional_Maxxx_24-Jun-08 12:28 
GeneralRe: Cobol Horror Pin
leppie24-Jun-08 22:55
leppie24-Jun-08 22:55 
GeneralRe: Cobol Horror Pin
_Maxxx_25-Jun-08 12:18
professional_Maxxx_25-Jun-08 12:18 
GeneralRe: Cobol Horror Pin
Pete O'Hanlon27-Jun-08 11:56
mvePete O'Hanlon27-Jun-08 11:56 
GeneralRe: Cobol Horror Pin
Paul Conrad1-Jul-08 19:31
professionalPaul Conrad1-Jul-08 19:31 
GeneralA real gem. Pin
Tom Delany23-Jun-08 12:16
Tom Delany23-Jun-08 12:16 
GeneralRe: A real gem. Pin
Paul Conrad23-Jun-08 13:40
professionalPaul Conrad23-Jun-08 13:40 
GeneralRe: A real gem. Pin
leppie23-Jun-08 20:59
leppie23-Jun-08 20:59 
RantRe: A real gem. Pin
Tom Delany24-Jun-08 3:58
Tom Delany24-Jun-08 3:58 

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.