Click here to Skip to main content
15,880,725 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: Just a C++ tutorial Pin
Vladimir Svyatski10-Jul-12 8:32
professionalVladimir Svyatski10-Jul-12 8:32 
GeneralSmall & Usefull.. Pin
_Amy30-Jun-12 9:55
professional_Amy30-Jun-12 9:55 
GeneralImma Switch, Imma Switch, Imma Imma Imma Switch Pin
AspDotNetDev27-Jun-12 15:31
protectorAspDotNetDev27-Jun-12 15:31 
GeneralRe: Imma Switch, Imma Switch, Imma Imma Imma Switch Pin
Brisingr Aerowing27-Jun-12 16:07
professionalBrisingr Aerowing27-Jun-12 16:07 
GeneralIs it? Has it changed? What about now? PinPopular
Arthur F Souza26-Jun-12 9:01
Arthur F Souza26-Jun-12 9:01 
GeneralRe: Is it? Has it changed? What about now? Pin
ZurdoDev26-Jun-12 9:26
professionalZurdoDev26-Jun-12 9:26 
GeneralRe: Is it? Has it changed? What about now? Pin
KP Lee3-Jul-12 20:45
KP Lee3-Jul-12 20:45 
GeneralRe: Is it? Has it changed? What about now? Pin
Brisingr Aerowing26-Jun-12 9:40
professionalBrisingr Aerowing26-Jun-12 9:40 
D'Oh! | :doh: is all I can say.

I think the coder forgot to call the TurnBrainOn() function before he started.

C#
public class Coder: Employee{

     public override bool Initialize(IInitializeContext init){

          //init.TurnBrainOn(this); <-- Need to call this!

         //Other initialization goes here

     }

     public string WriteCode(ICodeInfo info, ICodeContext ctxt){

     //TODO: Uncomment this!
     //if (!this.IsBrainOn){

     //throw new BrainNotReadyException(this);

     //}
     
     //Rest of implementation goes here.

     }

//Rest of implementation goes here.

}

C#
public class SysAdmin : Employee
{

     public override void DoWork(IWorkItem workItem)
     {
          if (workItem.User.Type == UserType.NoLearn){
             throw new NoIWillNotFixYourComputerException(new Luser(workItem.User));
          }else{
               base.DoWork(workItem);
          }
     }

}


modified 26-Jun-12 16:16pm.

JokeRe: Is it? Has it changed? What about now? Pin
Paul Conrad30-Jun-12 13:50
professionalPaul Conrad30-Jun-12 13:50 
GeneralRe: Is it? Has it changed? What about now? Pin
TorstenH.27-Jun-12 1:28
TorstenH.27-Jun-12 1:28 
GeneralRe: Is it? Has it changed? What about now? Pin
Bernhard Hiller28-Jun-12 21:45
Bernhard Hiller28-Jun-12 21:45 
GeneralRe: Is it? Has it changed? What about now? Pin
Rajeev Jayaram28-Jun-12 23:25
Rajeev Jayaram28-Jun-12 23:25 
GeneralRe: Is it? Has it changed? What about now? Pin
RafagaX2-Jul-12 7:53
professionalRafagaX2-Jul-12 7:53 
GeneralRe: Is it? Has it changed? What about now? Pin
Rajeev Jayaram5-Jul-12 10:39
Rajeev Jayaram5-Jul-12 10:39 
GeneralRe: Is it? Has it changed? What about now? Pin
Bassam Abdul-Baki30-Jun-12 4:36
professionalBassam Abdul-Baki30-Jun-12 4:36 
GeneralRe: Is it? Has it changed? What about now? Pin
A. A. J. Rodriguez9-Jul-12 5:17
A. A. J. Rodriguez9-Jul-12 5:17 
GeneralRe: Is it? Has it changed? What about now? Pin
Rajesh R Subramanian30-Jun-12 10:01
professionalRajesh R Subramanian30-Jun-12 10:01 
GeneralRe: Is it? Has it changed? What about now? Pin
AspDotNetDev30-Jun-12 10:55
protectorAspDotNetDev30-Jun-12 10:55 
GeneralRe: Is it? Has it changed? What about now? Pin
Mycroft Holmes30-Jun-12 15:41
professionalMycroft Holmes30-Jun-12 15:41 
GeneralRe: Is it? Has it changed? What about now? Pin
greldak1-Jul-12 21:37
greldak1-Jul-12 21:37 
GeneralRe: Is it? Has it changed? What about now? Pin
Jonathan C Dickinson2-Jul-12 0:26
Jonathan C Dickinson2-Jul-12 0:26 
GeneralRe: Is it? Has it changed? What about now? Pin
svella2-Jul-12 4:09
svella2-Jul-12 4:09 
GeneralSet selected value... PinPopular
Sandeep Mewara26-Jun-12 8:31
mveSandeep Mewara26-Jun-12 8:31 
GeneralRe: Set selected value... Pin
fjdiewornncalwe26-Jun-12 8:38
professionalfjdiewornncalwe26-Jun-12 8:38 
GeneralRe: Set selected value... Pin
Sandeep Mewara26-Jun-12 8:59
mveSandeep Mewara26-Jun-12 8:59 

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.