Click here to Skip to main content
15,886,873 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: To sleep or to do 'events'. That is the question. Pin
Nagy Vilmos31-Aug-11 1:08
professionalNagy Vilmos31-Aug-11 1:08 
GeneralRe: To sleep or to do 'events'. That is the question. Pin
BillW3331-Aug-11 4:46
professionalBillW3331-Aug-11 4:46 
JokeRe: To sleep or to do 'events'. That is the question. Pin
Sander Rossel31-Aug-11 11:26
professionalSander Rossel31-Aug-11 11:26 
GeneralApostrophe's to the rescue PinPopular
Sander Rossel30-Aug-11 3:58
professionalSander Rossel30-Aug-11 3:58 
GeneralRe: Apostrophe's to the rescue PinPopular
jocstar1-Sep-11 4:02
jocstar1-Sep-11 4:02 
GeneralRe: Apostrophe's to the rescue Pin
Sander Rossel1-Sep-11 6:32
professionalSander Rossel1-Sep-11 6:32 
JokeRe: Apostrophe's to the rescue Pin
VallarasuS2-Sep-11 2:03
VallarasuS2-Sep-11 2:03 
GeneralIs this a coding horror? Pin
OriginalGriff27-Aug-11 0:09
mveOriginalGriff27-Aug-11 0:09 
I don't know - it isn't in my code anymore...
I wrote this wonder this morning, and realized I could prune it down to just the one line:
C#
private void SetRole(SMUser user, UserRole userRole, string roleName, List<string> inRoles, List<string> outRoles)
    {
    (((user.Roles & userRole) != 0) ? inRoles : outRoles).Add(roleName);
    }


I mean, yes it works. But...

It's not there anymore: I changed the whole way I handle roles for other reasons. But still, It's a bit impenetrable...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

Manfred R. Bihy: "Looks as if OP is learning resistant."

GeneralRe: Is this a coding horror? Pin
Shameel27-Aug-11 23:39
professionalShameel27-Aug-11 23:39 
GeneralRe: Is this a coding horror? PinPopular
OriginalGriff27-Aug-11 23:50
mveOriginalGriff27-Aug-11 23:50 
GeneralRe: Is this a coding horror? Pin
Julien Villers29-Aug-11 2:21
professionalJulien Villers29-Aug-11 2:21 
GeneralRe: Is this a coding horror? Pin
BillW3329-Aug-11 3:02
professionalBillW3329-Aug-11 3:02 
GeneralRe: Is this a coding horror? [modified] PinPopular
annathor30-Aug-11 0:06
annathor30-Aug-11 0:06 
QuestionRe: Is this a coding horror? Pin
Paladin200030-Aug-11 3:38
Paladin200030-Aug-11 3:38 
AnswerRe: Is this a coding horror? Pin
annathor30-Aug-11 4:48
annathor30-Aug-11 4:48 
GeneralRe: Is this a coding horror? PinPopular
Nagy Vilmos30-Aug-11 5:04
professionalNagy Vilmos30-Aug-11 5:04 
GeneralRe: Is this a coding horror? Pin
Marbry Hardin30-Aug-11 5:34
Marbry Hardin30-Aug-11 5:34 
GeneralRe: Is this a coding horror? Pin
BobJanova30-Aug-11 6:17
BobJanova30-Aug-11 6:17 
GeneralRe: Is this a coding horror? Pin
GibbleCH30-Aug-11 11:42
GibbleCH30-Aug-11 11:42 
GeneralRe: Is this a coding horror? Pin
BobJanova30-Aug-11 23:12
BobJanova30-Aug-11 23:12 
GeneralRe: Is this a coding horror? Pin
GibbleCH31-Aug-11 3:56
GibbleCH31-Aug-11 3:56 
GeneralRe: Is this a coding horror? Pin
BobJanova31-Aug-11 6:04
BobJanova31-Aug-11 6:04 
GeneralRe: Is this a coding horror? Pin
GibbleCH31-Aug-11 7:50
GibbleCH31-Aug-11 7:50 
GeneralRe: Is this a coding horror? Pin
BobJanova1-Sep-11 0:40
BobJanova1-Sep-11 0:40 
GeneralRe: Is this a coding horror? Pin
YSLGuru2-Sep-11 6:57
YSLGuru2-Sep-11 6:57 

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.