Click here to Skip to main content
15,905,782 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: Words cannot describe my pain Pin
Megidolaon23-Feb-09 0:15
Megidolaon23-Feb-09 0:15 
QuestionRe: Words cannot describe my pain Pin
CPallini23-Feb-09 0:26
mveCPallini23-Feb-09 0:26 
GeneralRe: Words cannot describe my pain Pin
PIEBALDconsult22-Oct-08 4:23
mvePIEBALDconsult22-Oct-08 4:23 
GeneralRe: Words cannot describe my pain Pin
BillW3322-Oct-08 14:33
professionalBillW3322-Oct-08 14:33 
GeneralRe: Words cannot describe my pain Pin
PIEBALDconsult22-Oct-08 14:40
mvePIEBALDconsult22-Oct-08 14:40 
GeneralRe: Words cannot describe my pain Pin
Thomas Weller23-Oct-08 1:24
Thomas Weller23-Oct-08 1:24 
GeneralRe: Words cannot describe my pain Pin
adamsappel30-Oct-08 23:05
adamsappel30-Oct-08 23:05 
GeneralLocking horror: Am I going mad? Pin
ewan19-Oct-08 8:02
ewan19-Oct-08 8:02 
In a new body of code I've "inherited" there is a lot of code that looks something like this (simplified somewhat):

public class A
{
  private ArrayList list = new ArrayList();
  private object m_lock = new object();

  public A()
  {
    lock(m_lock)
    {
       list.Add("MyString");
    }
  }
}


Now am I going mad? That lock statement to my eye is marginally pointless. Is there ever any justification for locking on a non static, private object in a constructor?

Cheers,

E.
GeneralRe: Locking horror: Am I going mad? Pin
PIEBALDconsult19-Oct-08 15:51
mvePIEBALDconsult19-Oct-08 15:51 
GeneralRe: Locking horror: Am I going mad? Pin
Andrew Rissing24-Oct-08 3:57
Andrew Rissing24-Oct-08 3:57 
GeneralRe: Locking horror: Am I going mad? Pin
CPallini19-Oct-08 20:35
mveCPallini19-Oct-08 20:35 
GeneralRe: Locking horror: Am I going mad? Pin
Dust Signs19-Oct-08 21:05
Dust Signs19-Oct-08 21:05 
GeneralRe: Locking horror: Am I going mad? Pin
PIEBALDconsult20-Oct-08 5:42
mvePIEBALDconsult20-Oct-08 5:42 
GeneralC# - Arrays vs Arraylist Pin
snorkie15-Oct-08 8:39
professionalsnorkie15-Oct-08 8:39 
GeneralRe: C# - Arrays vs Arraylist Pin
che335815-Oct-08 11:18
che335815-Oct-08 11:18 
GeneralRe: C# - Arrays vs Arraylist Pin
snorkie16-Oct-08 4:36
professionalsnorkie16-Oct-08 4:36 
GeneralRe: C# - Arrays vs Arraylist Pin
hamityildirim15-Oct-08 18:26
hamityildirim15-Oct-08 18:26 
GeneralRe: C# - Arrays vs Arraylist Pin
leppie15-Oct-08 20:18
leppie15-Oct-08 20:18 
GeneralRe: C# - Arrays vs Arraylist Pin
snorkie16-Oct-08 4:35
professionalsnorkie16-Oct-08 4:35 
GeneralRe: C# - Arrays vs Arraylist Pin
Eddy Vluggen22-Oct-08 23:32
professionalEddy Vluggen22-Oct-08 23:32 
JokeRe: C# - Arrays vs Arraylist Pin
megaadam17-Oct-08 2:50
professionalmegaadam17-Oct-08 2:50 
GeneralRe: C# - Arrays vs Arraylist Pin
Redwan Albougha17-Oct-08 15:45
Redwan Albougha17-Oct-08 15:45 
GeneralRe: C# - Arrays vs Arraylist Pin
Paul Conrad17-Oct-08 18:20
professionalPaul Conrad17-Oct-08 18:20 
GeneralRe: C# - Arrays vs Arraylist Pin
Mike Dimmick19-Oct-08 1:34
Mike Dimmick19-Oct-08 1:34 
GeneralRe: C# - Arrays vs Arraylist Pin
hamityildirim10-Nov-08 0:24
hamityildirim10-Nov-08 0:24 

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.