Click here to Skip to main content
12,077,333 members (48,602 online)

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: Everywhere a single Catch block used catching top Exception all times. Pin
Rob Grainger24-Jun-13 1:02
memberRob Grainger24-Jun-13 1:02 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
Jarek Kruza19-Jun-13 22:56
memberJarek Kruza19-Jun-13 22:56 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
Mohammed Hameed19-Jun-13 23:08
professionalMohammed Hameed19-Jun-13 23:08 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
Jarek Kruza20-Jun-13 2:30
memberJarek Kruza20-Jun-13 2:30 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
Rob Grainger24-Jun-13 1:04
memberRob Grainger24-Jun-13 1:04 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
Mohammed Hameed24-Jun-13 1:31
professionalMohammed Hameed24-Jun-13 1:31 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
Chris Ross 224-Jun-13 3:32
memberChris Ross 224-Jun-13 3:32 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
Rob Grainger24-Jun-13 5:08
memberRob Grainger24-Jun-13 5:08 
Yes, I always liked C++'s RAII (Resource Acquisition Is Initialization) approach for exactly this reason. Every scope in C++ acts as an implicit "using" for all names declared within it, and the destructor is implicitly called when the scope exits. This gives deterministic resource management, but does leave more room for developer mistakes than managed languages.

While "using" does allow this (to a degree) in C#, to apply it to every resource would sometimes result in a cascade of nested "using" blocks. In C++, its all automatic.

Personally, I like to think I don't need my hands held by the compiler all the time.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.

GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
V.20-Jun-13 0:25
professionalV.20-Jun-13 0:25 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
Mohammed Hameed20-Jun-13 0:56
professionalMohammed Hameed20-Jun-13 0:56 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
cjb11020-Jun-13 1:12
membercjb11020-Jun-13 1:12 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
Mohammed Hameed20-Jun-13 1:26
professionalMohammed Hameed20-Jun-13 1:26 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
V.20-Jun-13 1:31
professionalV.20-Jun-13 1:31 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
Mohammed Hameed20-Jun-13 2:11
professionalMohammed Hameed20-Jun-13 2:11 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
Richard Deeming20-Jun-13 2:36
professionalRichard Deeming20-Jun-13 2:36 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
V.20-Jun-13 2:39
professionalV.20-Jun-13 2:39 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
AnalogNerd24-Jun-13 3:26
memberAnalogNerd24-Jun-13 3:26 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
Mohammed Hameed24-Jun-13 3:37
professionalMohammed Hameed24-Jun-13 3:37 
GeneralRelational database reinvented as a flat file... Pin
johnsyd19-Jun-13 20:58
memberjohnsyd19-Jun-13 20:58 
GeneralRe: Relational database reinvented as a flat file... Pin
AlexCode19-Jun-13 21:25
professionalAlexCode19-Jun-13 21:25 
GeneralRe: Relational database reinvented as a flat file... Pin
johnsyd19-Jun-13 22:22
memberjohnsyd19-Jun-13 22:22 
GeneralRe: Relational database reinvented as a flat file... Pin
NormDroid19-Jun-13 21:43
professionalNormDroid19-Jun-13 21:43 
GeneralRe: Relational database reinvented as a flat file... Pin
AlexCode19-Jun-13 22:26
professionalAlexCode19-Jun-13 22:26 
GeneralRe: Relational database reinvented as a flat file... Pin
Richard Deeming20-Jun-13 2:32
professionalRichard Deeming20-Jun-13 2:32 
GeneralRe: Relational database reinvented as a flat file... Pin
jim lahey20-Jun-13 2:57
memberjim lahey20-Jun-13 2:57 

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.


Advertise | Privacy | Mobile
Web04 | 2.8.160212.1 | Last Updated 13 Feb 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid