Click here to Skip to main content
16,007,163 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: My boss must be a klingon Pin
CPallini6-Nov-08 10:42
mveCPallini6-Nov-08 10:42 
GeneralRe: My boss must be a klingon Pin
cpkilekofp7-Nov-08 5:40
cpkilekofp7-Nov-08 5:40 
GeneralRe: someone who does not trust arithmetic Pin
cpkilekofp7-Nov-08 5:35
cpkilekofp7-Nov-08 5:35 
GeneralRe: someone who does not trust arithmetic Pin
thema3x19-May-10 13:54
thema3x19-May-10 13:54 
GeneralTry Catch Pin
cyber-drugs3-Nov-08 22:59
cyber-drugs3-Nov-08 22:59 
GeneralRe: Try Catch Pin
CPallini3-Nov-08 23:10
mveCPallini3-Nov-08 23:10 
GeneralRe: Try Catch Pin
BillW334-Nov-08 4:24
professionalBillW334-Nov-08 4:24 
GeneralRe: Try Catch Pin
QuiJohn4-Nov-08 6:45
QuiJohn4-Nov-08 6:45 
Once, many moons ago, I got talked to by another developer because I wasn't using try catch blocks to do error handling. I checked and validated results as I went, using if/elses. No, it wasn't particularly elegant and I would do it differently now but it worked and handled failures well.

A few days later I looked at some of his code to get an idea for how to structure it using try/catch and came upon something very much like what you posted. I was horrified, but because I knew try/catch was all the rage, and I was new, I thought his was more correct and didn't say anything. The company went out of business a few months later.

(Although, to be fair, that was more likely a result of us having free arcade games in the office and spur of the moment Quake tournaments.)

It was a long time before I realized the true benefits of properly structured exception handling, thanks to some early misguidance. I'm still appalled at how it gets frequently abused though.


He said, "Boy I'm just old and lonely,
But thank you for your concern,
Here's wishing you a Happy New Year."
I wished him one back in return.

GeneralRe: Try Catch Pin
cyber-drugs4-Nov-08 23:07
cyber-drugs4-Nov-08 23:07 
GeneralRe: Try Catch Pin
cpkilekofp7-Nov-08 5:44
cpkilekofp7-Nov-08 5:44 
GeneralRe: Try Catch Pin
Kevin McFarlane5-Nov-08 23:42
Kevin McFarlane5-Nov-08 23:42 
GeneralRe: Try Catch Pin
supercat96-Nov-08 6:07
supercat96-Nov-08 6:07 
GeneralRe: Try Catch Pin
DrWheetos7-Nov-08 22:04
DrWheetos7-Nov-08 22:04 
GeneralRe: Try Catch Pin
supercat98-Nov-08 10:05
supercat98-Nov-08 10:05 
GeneralA big if Pin
ClementsDan1-Nov-08 18:42
ClementsDan1-Nov-08 18:42 
GeneralRe: A big if Pin
PIEBALDconsult2-Nov-08 3:04
mvePIEBALDconsult2-Nov-08 3:04 
AnswerRe: C/C++ or C#? [modified] Pin
Thomas Weller2-Nov-08 20:13
Thomas Weller2-Nov-08 20:13 
GeneralRe: C/C++ or C#? Pin
Nagy Vilmos2-Nov-08 22:28
professionalNagy Vilmos2-Nov-08 22:28 
GeneralRe: C/C++ or C#? Pin
PIEBALDconsult3-Nov-08 4:03
mvePIEBALDconsult3-Nov-08 4:03 
GeneralRe: C/C++ or C#? Pin
Nemanja Trifunovic3-Nov-08 8:24
Nemanja Trifunovic3-Nov-08 8:24 
GeneralRe: C/C++ or C#? Pin
Thomas Weller3-Nov-08 8:48
Thomas Weller3-Nov-08 8:48 
GeneralRe: C/C++ or C#? Pin
Nemanja Trifunovic3-Nov-08 9:11
Nemanja Trifunovic3-Nov-08 9:11 
GeneralRe: C/C++ or C#? Pin
Thomas Weller3-Nov-08 9:35
Thomas Weller3-Nov-08 9:35 
GeneralRe: C/C++ or C#? Pin
Nemanja Trifunovic3-Nov-08 9:58
Nemanja Trifunovic3-Nov-08 9:58 
GeneralRe: C/C++ or C#? Pin
Thomas Weller3-Nov-08 10:08
Thomas Weller3-Nov-08 10:08 

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.