Click here to Skip to main content
13,559,423 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: Interesting / strange code picked up from pluralsight training (functional programming) Pin
Marc Clifton20-Mar-18 7:13
protectorMarc Clifton20-Mar-18 7:13 
GeneralRe: Interesting / strange code picked up from pluralsight training (functional programming) Pin
BillWoodruff20-Mar-18 18:07
mentorBillWoodruff20-Mar-18 18:07 
GeneralRe: Interesting / strange code picked up from pluralsight training (functional programming) Pin
Marc Clifton20-Mar-18 7:22
protectorMarc Clifton20-Mar-18 7:22 
GeneralRe: Interesting / strange code picked up from pluralsight training (functional programming) Pin
raddevus20-Mar-18 7:25
mvpraddevus20-Mar-18 7:25 
JokeCustomise my static without a ctor Pin
SortaCore17-Mar-18 9:06
memberSortaCore17-Mar-18 9:06 
GeneralRe: Customise my static without a ctor Pin
0x01AA17-Mar-18 9:25
professional0x01AA17-Mar-18 9:25 
GeneralRe: Customise my static without a ctor Pin
SortaCore17-Mar-18 11:59
memberSortaCore17-Mar-18 11:59 
GeneralRe: Customise my static without a ctor Pin
David O'Neil17-Mar-18 16:25
professionalDavid O'Neil17-Mar-18 16:25 
Why does the struct have to have a static copy of itself in it? Why can't you just do:
struct client {
    std::string username;
    int id; // 0+ OK
}

static client theInstance;
theInstance.username = "<DUMMY>";
...

GeneralRe: Customise my static without a ctor Pin
Jon McKee18-Mar-18 14:26
professionalJon McKee18-Mar-18 14:26 
GeneralDaylight saving bug? Or working as designed? Pin
James VT12-Mar-18 8:44
memberJames VT12-Mar-18 8:44 
GeneralRe: Daylight saving bug? Or working as designed? Pin
Tim Carmichael12-Mar-18 9:31
memberTim Carmichael12-Mar-18 9:31 
GeneralRe: Daylight saving bug? Or working as designed? Pin
PIEBALDconsult12-Mar-18 12:33
protectorPIEBALDconsult12-Mar-18 12:33 
GeneralRe: Daylight saving bug? Or working as designed? Pin
Tim Carmichael12-Mar-18 14:41
memberTim Carmichael12-Mar-18 14:41 
GeneralRe: Daylight saving bug? Or working as designed? Pin
W Balboos14-Mar-18 1:31
memberW Balboos14-Mar-18 1:31 
GeneralRe: Daylight saving bug? Or working as designed? Pin
PIEBALDconsult14-Mar-18 13:31
protectorPIEBALDconsult14-Mar-18 13:31 
GeneralRe: Daylight saving bug? Or working as designed? Pin
megaadam14-Mar-18 0:57
professionalmegaadam14-Mar-18 0:57 
GeneralRe: Daylight saving bug? Or working as designed? Pin
den2k8814-Mar-18 1:19
professionalden2k8814-Mar-18 1:19 
GeneralRe: Daylight saving bug? Or working as designed? Pin
kmoorevs14-Mar-18 5:22
memberkmoorevs14-Mar-18 5:22 
GeneralRe: Daylight saving bug? Or working as designed? Pin
den2k8814-Mar-18 5:26
professionalden2k8814-Mar-18 5:26 
JokeCode of the Day!! Pin
Ehsan Sajjad12-Mar-18 8:18
mvpEhsan Sajjad12-Mar-18 8:18 
GeneralRe: Code of the Day!! Pin
Marc Clifton12-Mar-18 9:19
protectorMarc Clifton12-Mar-18 9:19 
GeneralRe: Code of the Day!! Pin
Ehsan Sajjad12-Mar-18 23:07
mvpEhsan Sajjad12-Mar-18 23:07 
GeneralRe: Code of the Day!! Pin
RickZeeland12-Mar-18 9:37
mvpRickZeeland12-Mar-18 9:37 
GeneralRe: Code of the Day!! Pin
Ehsan Sajjad12-Mar-18 23:06
mvpEhsan Sajjad12-Mar-18 23:06 
GeneralRe: Code of the Day!! Pin
OriginalGriff14-Mar-18 6:46
protectorOriginalGriff14-Mar-18 6:46 

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 |
Web04-2016 | 2.8.180515.1 | Last Updated 27 May 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid