Click here to Skip to main content
15,440,341 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: smart way to detect if System.Boolean true or false Pin
Tallmaris15-Mar-11 1:23
MemberTallmaris15-Mar-11 1:23 
GeneralRe: smart way to detect if System.Boolean true or false Pin
OriginalGriff15-Mar-11 1:27
mveOriginalGriff15-Mar-11 1:27 
GeneralRe: smart way to detect if System.Boolean true or false Pin
Rick Shaub15-Mar-11 7:51
MemberRick Shaub15-Mar-11 7:51 
GeneralRe: smart way to detect if System.Boolean true or false Pin
Bernhard Hiller14-Mar-11 3:50
MemberBernhard Hiller14-Mar-11 3:50 
GeneralRe: smart way to detect if System.Boolean true or false Pin
Baruch2322-Mar-11 14:39
professionalBaruch2322-Mar-11 14:39 
GeneralException handling PinPopular
Thallian3-Mar-11 19:57
MemberThallian3-Mar-11 19:57 
GeneralRe: Exception handling Pin
musefan3-Mar-11 22:19
Membermusefan3-Mar-11 22:19 
GeneralRe: Exception handling Pin
Sander Rossel3-Mar-11 23:29
professionalSander Rossel3-Mar-11 23:29 
Example of what I have seen...

VB
Try
' This code starts up a form.
Catch oE as Exception
' Do nothing. If the form does not start you'll notice soon enough.
End Try


The comment in the Catch is taken almost literally from the code!
I found it when I pasted a new form in the application and it did not start up. Well, at least the Catch was right in that I noticed soon enough Laugh | :laugh:
Don't really know what oE is. I guess ex was not obvious enough Poke tongue | ;-P

Even worse is when I am forced to use company classes that catch and handle errors without giving them back. They usually log an error, end of story. How am I supposed to notify the user about any errors if my classes do not give me back an Exception? Confused | :confused:
The worst part is that the application usually lacks any form design making class A depend on B and C, B on C and A, and C on A and B. So when I change a class (like removing unnecessary Catch blocks or rethrowing an Exception)... Well, who knows what might happen Frown | :(
It's an OO world.

GeneralRe: Exception handling Pin
musefan4-Mar-11 0:30
Membermusefan4-Mar-11 0:30 
JokeRe: Exception handling Pin
_Erik_4-Mar-11 1:50
Member_Erik_4-Mar-11 1:50 
GeneralRe: Exception handling Pin
GenJerDan4-Mar-11 4:10
MemberGenJerDan4-Mar-11 4:10 
JokeRe: Exception handling Pin
Sander Rossel4-Mar-11 8:41
professionalSander Rossel4-Mar-11 8:41 
GeneralRe: Exception handling Pin
Bernhard Hiller4-Mar-11 4:37
MemberBernhard Hiller4-Mar-11 4:37 
GeneralRe: Exception handling Pin
Dalek Dave4-Mar-11 13:23
professionalDalek Dave4-Mar-11 13:23 
GeneralRe: Exception handling Pin
Jörgen Andersson6-Mar-11 20:09
professionalJörgen Andersson6-Mar-11 20:09 
GeneralRe: Exception handling Pin
Ramalinga Koushik11-Mar-11 0:33
MemberRamalinga Koushik11-Mar-11 0:33 
GeneralRe: Exception handling Pin
Ramalinga Koushik11-Mar-11 0:32
MemberRamalinga Koushik11-Mar-11 0:32 
GeneralRe: Exception handling Pin
RobCroll4-Mar-11 15:52
MemberRobCroll4-Mar-11 15:52 
GeneralRe: Exception handling Pin
Sander Rossel6-Mar-11 12:31
professionalSander Rossel6-Mar-11 12:31 
GeneralRe: Exception handling Pin
RobCroll6-Mar-11 15:29
MemberRobCroll6-Mar-11 15:29 
GeneralRe: Exception handling Pin
Sander Rossel6-Mar-11 20:16
professionalSander Rossel6-Mar-11 20:16 
GeneralRe: Exception handling Pin
Quirkafleeg15-Mar-11 1:23
MemberQuirkafleeg15-Mar-11 1:23 
GeneralRe: Exception handling Pin
RobCroll15-Mar-11 1:57
MemberRobCroll15-Mar-11 1:57 
GeneralRe: Exception handling Pin
Member 9615-Mar-11 12:04
MemberMember 9615-Mar-11 12:04 
GeneralUnnecessary Commented Code Pin
Monjurul Habib3-Mar-11 10:21
professionalMonjurul Habib3-Mar-11 10: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.