Click here to Skip to main content
15,896,153 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: 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 
GeneralRe: What did he want to lock? Pin
bougiefever14-Jun-10 11:19
bougiefever14-Jun-10 11:19 
GeneralFML, Edition 6580 Pin
Wes Jones8-Jun-10 13:56
Wes Jones8-Jun-10 13:56 
GeneralRe: FML, Edition 6580 Pin
Luc Pattyn8-Jun-10 14:33
sitebuilderLuc Pattyn8-Jun-10 14:33 
GeneralRe: FML, Edition 6580 Pin
Wes Jones8-Jun-10 14:58
Wes Jones8-Jun-10 14:58 
GeneralRe: FML, Edition 6580 Pin
Jeroen De Dauw8-Jun-10 19:49
Jeroen De Dauw8-Jun-10 19:49 
Generaluseless... Pin
Noman Aftab6-Jun-10 21:53
Noman Aftab6-Jun-10 21:53 
GeneralRe: useless... Pin
Jeroen De Dauw6-Jun-10 22:55
Jeroen De Dauw6-Jun-10 22:55 
GeneralRe: useless... Pin
J4amieC6-Jun-10 23:44
J4amieC6-Jun-10 23:44 
GeneralRe: useless... Pin
supercat97-Jun-10 6:08
supercat97-Jun-10 6:08 
GeneralRe: useless... PinPopular
J4amieC7-Jun-10 6:31
J4amieC7-Jun-10 6:31 
GeneralRe: useless... Pin
supercat97-Jun-10 8:52
supercat97-Jun-10 8:52 
GeneralRe: useless... Pin
PIEBALDconsult8-Jun-10 3:21
mvePIEBALDconsult8-Jun-10 3:21 

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.