Click here to Skip to main content
12,622,001 members (35,246 online)

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: Mmmm! The smell of happy users, and happy maintenence coders... Pin
OriginalGriff29-Aug-13 5:00
protectorOriginalGriff29-Aug-13 5:00 
GeneralRe: Mmmm! The smell of happy users, and happy maintenence coders... Pin
PIEBALDconsult29-Aug-13 5:54
professionalPIEBALDconsult29-Aug-13 5:54 
GeneralRe: Mmmm! The smell of happy users, and happy maintenence coders... Pin
OriginalGriff29-Aug-13 6:50
protectorOriginalGriff29-Aug-13 6:50 
GeneralRe: Mmmm! The smell of happy users, and happy maintenence coders... Pin
PIEBALDconsult29-Aug-13 15:51
professionalPIEBALDconsult29-Aug-13 15:51 
JokeRe: Mmmm! The smell of happy users, and happy maintenence coders... Pin
richcb4-Sep-13 12:28
memberrichcb4-Sep-13 12:28 
GeneralRe: Mmmm! The smell of happy users, and happy maintenence coders... Pin
Jean A Brandelero9-Sep-13 8:16
memberJean A Brandelero9-Sep-13 8:16 
GeneralRe: Mmmm! The smell of happy users, and happy maintenence coders... Pin
MarkRHolbrook6-Sep-13 4:13
memberMarkRHolbrook6-Sep-13 4:13 
GeneralIf only there were a language construct to handle this case... Pin
lewax0013-Aug-13 8:43
memberlewax0013-Aug-13 8:43 
Just stumbled across this:
int page = 1;
while (true) {
    if (page > pageCount) {
        break;
    }
 
    /* Do stuff with page */
 
    page++;
}

Considering how common it is to use an index in a loop, you'd think the language designers would have a better way of dealing with this... Laugh | :laugh:

EDIT: even better, in 2 of the 3 places using page, it uses page - 1 :facepalm:
GeneralRe: If only there were a language construct to handle this case... Pin
Rob Grainger15-Aug-13 1:10
memberRob Grainger15-Aug-13 1:10 
GeneralRe: If only there were a language construct to handle this case... Pin
lewax0015-Aug-13 4:49
memberlewax0015-Aug-13 4:49 
GeneralRe: If only there were a language construct to handle this case... Pin
Dan Neely19-Aug-13 4:24
memberDan Neely19-Aug-13 4:24 
GeneralRe: If only there were a language construct to handle this case... Pin
Rob Grainger26-Aug-13 23:27
memberRob Grainger26-Aug-13 23:27 
GeneralI just made a secret GOTO Pin
peterchen13-Aug-13 8:15
memberpeterchen13-Aug-13 8:15 
GeneralRe: I just made a secret GOTO Pin
Jacek Gajek14-Aug-13 0:40
memberJacek Gajek14-Aug-13 0:40 
GeneralRe: I just made a secret GOTO Pin
Argonia14-Aug-13 0:53
memberArgonia14-Aug-13 0:53 
GeneralRe: I just made a secret GOTO Pin
Freak3014-Aug-13 0:50
memberFreak3014-Aug-13 0:50 
GeneralRe: I just made a secret GOTO Pin
peterchen14-Aug-13 2:24
memberpeterchen14-Aug-13 2:24 
NewsSomething original Pin
Super Lloyd6-Aug-13 22:03
memberSuper Lloyd6-Aug-13 22:03 
JokeRe: Something original Pin
Argonia6-Aug-13 22:24
memberArgonia6-Aug-13 22:24 
GeneralRe: Something original Pin
Super Lloyd7-Aug-13 3:57
memberSuper Lloyd7-Aug-13 3:57 
GeneralRe: Something original Pin
BotCar6-Aug-13 23:01
memberBotCar6-Aug-13 23:01 
GeneralRe: Something original Pin
Argonia7-Aug-13 0:36
memberArgonia7-Aug-13 0:36 
GeneralRe: Something original Pin
MarkRHolbrook6-Sep-13 4:20
memberMarkRHolbrook6-Sep-13 4:20 
GeneralRe: Something original Pin
MarkRHolbrook6-Sep-13 7:18
memberMarkRHolbrook6-Sep-13 7:18 
GeneralRe: Something original Pin
AlexCode7-Aug-13 0:45
professionalAlexCode7-Aug-13 0:45 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 3 Dec 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid