Click here to Skip to main content
15,922,155 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: A gem. Pin
Jeroen De Dauw14-Jun-10 3:33
Jeroen De Dauw14-Jun-10 3:33 
GeneralRe: A gem. Pin
Tsuda Kageyu14-Jun-10 3:46
Tsuda Kageyu14-Jun-10 3:46 
GeneralRe: A gem. Pin
harold aptroot14-Jun-10 5:49
harold aptroot14-Jun-10 5:49 
GeneralRe: A gem. Pin
Dan Mos18-Jun-10 16:20
Dan Mos18-Jun-10 16:20 
GeneralCheck input for Alfanumeric... Pin
ddecoy10-Jun-10 2:04
ddecoy10-Jun-10 2:04 
GeneralRe: Check input for Alfanumeric... Pin
NickPace10-Jun-10 3:50
NickPace10-Jun-10 3:50 
GeneralRe: Check input for Alfanumeric... Pin
Jason Vetter10-Jun-10 4:21
Jason Vetter10-Jun-10 4:21 
GeneralRe: Check input for Alfanumeric... Pin
OriginalGriff10-Jun-10 4:41
mveOriginalGriff10-Jun-10 4:41 
GeneralRe: Check input for Alfanumeric... Pin
supercat910-Jun-10 8:39
supercat910-Jun-10 8:39 
GeneralRe: Check input for Alfanumeric... Pin
ddecoy10-Jun-10 21:44
ddecoy10-Jun-10 21:44 
GeneralRe: Check input for Alfanumeric... Pin
Dr.Walt Fair, PE14-Jun-10 6:43
professionalDr.Walt Fair, PE14-Jun-10 6:43 
GeneralWhat did he want to lock? PinPopular
Tsuda Kageyu8-Jun-10 18:53
Tsuda Kageyu8-Jun-10 18:53 
GeneralRe: What did he want to lock? Pin
leppie8-Jun-10 19:53
leppie8-Jun-10 19:53 
GeneralRe: What did he want to lock? Pin
Stanciu Vlad9-Jun-10 3:17
Stanciu Vlad9-Jun-10 3:17 
GeneralRe: What did he want to lock? Pin
Jeroen De Dauw9-Jun-10 4:56
Jeroen De Dauw9-Jun-10 4:56 
GeneralRe: What did he want to lock? Pin
Andrew Rissing9-Jun-10 4:12
Andrew Rissing9-Jun-10 4:12 
GeneralRe: What did he want to lock? Pin
NavnathKale9-Jun-10 8:24
NavnathKale9-Jun-10 8:24 
GeneralRe: What did he want to lock? Pin
David Skelly9-Jun-10 22:37
David Skelly9-Jun-10 22:37 
GeneralRe: What did he want to lock? Pin
Daniel Grunwald10-Jun-10 6:58
Daniel Grunwald10-Jun-10 6:58 
GeneralRe: What did he want to lock? Pin
supercat910-Jun-10 8:52
supercat910-Jun-10 8:52 
Daniel Grunwald wrote:
That's the only possible explanation.


I'm amazed at how many people seem to think that the way to avoid problems with concurrent access to an object is to arbitrarily pick something kinda-sorta related to that object and lock it. They see all the warnings about the risks of locking publicly-available objects and try to avoid doing that, despite the fact that if a lock must be held between calls to an objects methods or properties, it must be publicly available. To be sure, it's often best if things can be arranged so a lock needn't/won't be held while running 'outside' code, but when it's necessary one shouldn't try to avoid exposing the lock.
GeneralRe: What did he want to lock? Pin
Gary R. Wheeler13-Jun-10 11:41
Gary R. Wheeler13-Jun-10 11:41 
GeneralRe: What did he want to lock? Pin
supercat914-Jun-10 6:08
supercat914-Jun-10 6:08 
GeneralRe: What did he want to lock? Pin
Gary R. Wheeler14-Jun-10 13:51
Gary R. Wheeler14-Jun-10 13:51 
GeneralRe: What did he want to lock? Pin
supercat915-Jun-10 5:47
supercat915-Jun-10 5:47 
GeneralRe: What did he want to lock? Pin
peterchen10-Jun-10 3:26
peterchen10-Jun-10 3:26 

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.