Click here to Skip to main content
15,915,839 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: Empty catches’ blocks Pin
ScottM13-Jun-07 23:04
ScottM13-Jun-07 23:04 
GeneralRe: Empty catches’ blocks Pin
NormDroid3-Jun-07 23:08
professionalNormDroid3-Jun-07 23:08 
GeneralRe: Empty catches’ blocks Pin
Mike Dimmick4-Jun-07 1:45
Mike Dimmick4-Jun-07 1:45 
GeneralRe: Empty catches’ blocks Pin
Dave Kreskowiak4-Jun-07 4:19
mveDave Kreskowiak4-Jun-07 4:19 
GeneralRe: Empty catches’ blocks Pin
Sameer Alibhai4-Jun-07 13:12
Sameer Alibhai4-Jun-07 13:12 
GeneralRe: Empty catches’ blocks Pin
Dave Kreskowiak4-Jun-07 14:09
mveDave Kreskowiak4-Jun-07 14:09 
GeneralRe: Empty catches’ blocks Pin
ScottM14-Jun-07 20:04
ScottM14-Jun-07 20:04 
GeneralRe: Empty catches’ blocks Pin
Paul Conrad5-Jun-07 5:29
professionalPaul Conrad5-Jun-07 5:29 
GeneralRe: Empty catches’ blocks Pin
Rage4-Jun-07 5:02
professionalRage4-Jun-07 5:02 
GeneralRe: Empty catches’ blocks [modified] Pin
ScottM14-Jun-07 20:00
ScottM14-Jun-07 20:00 
GeneralRe: Empty catches’ blocks Pin
DavidNohejl4-Jun-07 22:52
DavidNohejl4-Jun-07 22:52 
GeneralRe: Empty catches’ blocks Pin
ScottM14-Jun-07 22:59
ScottM14-Jun-07 22:59 
GeneralRe: Empty catches’ blocks Pin
DavidNohejl4-Jun-07 23:20
DavidNohejl4-Jun-07 23:20 
GeneralRe: Empty catches’ blocks Pin
Dan Neely5-Jun-07 2:17
Dan Neely5-Jun-07 2:17 
GeneralRe: Empty catches’ blocks Pin
Kevin McFarlane11-Jun-07 2:42
Kevin McFarlane11-Jun-07 2:42 
GeneralRe: Empty catches’ blocks Pin
PIEBALDconsult5-Jun-07 4:00
mvePIEBALDconsult5-Jun-07 4:00 
GeneralRe: Empty catches’ blocks Pin
Dave Kreskowiak5-Jun-07 4:22
mveDave Kreskowiak5-Jun-07 4:22 
GeneralRe: Empty catches’ blocks Pin
PIEBALDconsult5-Jun-07 4:43
mvePIEBALDconsult5-Jun-07 4:43 
GeneralRe: Empty catches’ blocks Pin
Kevin McFarlane11-Jun-07 2:37
Kevin McFarlane11-Jun-07 2:37 
GeneralRe: Empty catches’ blocks Pin
Kevin McFarlane11-Jun-07 2:32
Kevin McFarlane11-Jun-07 2:32 
GeneralRe: Empty catches’ blocks Pin
Fabio Zanetta19-Jun-07 0:11
Fabio Zanetta19-Jun-07 0:11 
General"Clever" classic VB trick Pin
Paul Reynolds29-May-07 15:34
Paul Reynolds29-May-07 15:34 
GeneralRe: "Clever" classic VB trick Pin
Mike Dimmick29-May-07 23:12
Mike Dimmick29-May-07 23:12 
Follow the white rabbit...

VB6 wouldn't compile Debug.Print statements into the final code, and therefore wouldn't compile in the expression being evaluated either. Therefore if you were in the environment the division by zero would cause an error to be raised but you'd resume at the next statement, and the error number would be set to something other than 0, but in the compiled code the line causing the error wouldn't be present, so the problem wouldn't occur.

A debug build of the VB.NET code would cause the error to occur and the operation would return True. A release build should not. See the documentation for ConditionalAttribute.

The C# compiler tends to have better diagnostics and won't allow you to compile division by a literal zero. You'd have to use a variable containing the value 0.

Stability. What an interesting concept. -- Chris Maunder

GeneralRe: "Clever" classic VB trick Pin
Ian MacLean31-May-07 9:06
Ian MacLean31-May-07 9:06 
GeneralRe: "Clever" classic VB trick Pin
Anton Afanasyev1-Jun-07 4:46
Anton Afanasyev1-Jun-07 4:46 

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.