Click here to Skip to main content
15,894,180 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.

 
JokeRe: A function that does... nothing... :-). Pin
Niklas L24-May-10 23:29
Niklas L24-May-10 23:29 
GeneralRe: A function that does... nothing... :-). Pin
cpkilekofp4-Jun-10 10:59
cpkilekofp4-Jun-10 10:59 
GeneralRe: A function that does... nothing... :-). Pin
Jeroen De Dauw23-May-10 22:23
Jeroen De Dauw23-May-10 22:23 
GeneralRe: A function that does... nothing... :-). Pin
Chris Boden24-May-10 3:39
Chris Boden24-May-10 3:39 
GeneralRe: A function that does... nothing... :-). Pin
OriginalGriff23-May-10 23:31
mveOriginalGriff23-May-10 23:31 
GeneralRe: A function that does... nothing... :-). Pin
PIEBALDconsult24-May-10 5:27
mvePIEBALDconsult24-May-10 5:27 
GeneralRe: A function that does... nothing... :-). Pin
supercat924-May-10 6:31
supercat924-May-10 6:31 
GeneralRe: A function that does... nothing... :-). Pin
Luc Pattyn24-May-10 7:03
sitebuilderLuc Pattyn24-May-10 7:03 
There is nothing wrong with an explicit "do nothing". A NOP (No Operation) instruction exists in most micro-processor instruction sets, so you can replace a normal instruction (with N bytes of code), by one or a number of NOP instructions without having to move the instructions that follow.

Similarly, you can create a NOP method, so you can have an array of delegates, some of them possibly just calling your "does nothing" method.

And finally, such a stub can be used to add breakpoints, logging, or whatever is appropriate in the application domain.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

GeneralJoining stuff, the hard way Pin
Jeroen De Dauw22-May-10 19:48
Jeroen De Dauw22-May-10 19:48 
GeneralRe: Joining stuff, the hard way Pin
PIEBALDconsult23-May-10 6:41
mvePIEBALDconsult23-May-10 6:41 
GeneralRe: Joining stuff, the hard way Pin
Jeroen De Dauw23-May-10 6:54
Jeroen De Dauw23-May-10 6:54 
GeneralBut...wait, what? PinPopular
JHizzle20-May-10 5:23
JHizzle20-May-10 5:23 
GeneralRe: But...wait, what? Pin
PIEBALDconsult20-May-10 6:17
mvePIEBALDconsult20-May-10 6:17 
GeneralRe: But...wait, what? Pin
scotchfaster20-May-10 7:01
scotchfaster20-May-10 7:01 
GeneralRe: But...wait, what? Pin
Robert Rohde20-May-10 19:12
Robert Rohde20-May-10 19:12 
GeneralRe: But...wait, what? Pin
Thomas Krojer20-May-10 20:59
Thomas Krojer20-May-10 20:59 
GeneralRe: But...wait, what? Pin
JHizzle20-May-10 22:18
JHizzle20-May-10 22:18 
GeneralRe: But...wait, what? Pin
Robert Rohde21-May-10 5:02
Robert Rohde21-May-10 5:02 
GeneralRe: But...wait, what? Pin
supercat924-May-10 6:40
supercat924-May-10 6:40 
GeneralRe: But...wait, what? Pin
Chris Meech21-May-10 1:34
Chris Meech21-May-10 1:34 
GeneralSide-effects are bad Pin
leppie25-May-10 1:27
leppie25-May-10 1:27 
GeneralRe: But...wait, what? Pin
Hired Mind13-Jul-10 10:50
Hired Mind13-Jul-10 10:50 
GeneralLogical genius! Pin
Simone Serponi19-May-10 3:01
Simone Serponi19-May-10 3:01 
GeneralRe: Logical genius! Pin
Dr.Walt Fair, PE19-May-10 5:19
professionalDr.Walt Fair, PE19-May-10 5:19 
GeneralRe: Logical genius! Pin
Chris Boden19-May-10 5:40
Chris Boden19-May-10 5:40 

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.