Click here to Skip to main content
15,914,327 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: See the writing on the wall... Pin
CDP18023-May-12 12:36
CDP18023-May-12 12:36 
GeneralRe: See the writing on the wall... Pin
Brisingr Aerowing3-May-12 6:36
professionalBrisingr Aerowing3-May-12 6:36 
GeneralRe: See the writing on the wall... Pin
spotsknight3-May-12 8:43
spotsknight3-May-12 8:43 
GeneralRe: See the writing on the wall... Pin
CDP18023-May-12 12:26
CDP18023-May-12 12:26 
GeneralRe: See the writing on the wall... Pin
spotsknight4-May-12 4:37
spotsknight4-May-12 4:37 
GeneralRe: See the writing on the wall... Pin
Jörgen Andersson4-May-12 10:31
professionalJörgen Andersson4-May-12 10:31 
GeneralRe: See the writing on the wall... Pin
spotsknight4-May-12 12:31
spotsknight4-May-12 12:31 
GeneralRe: See the writing on the wall... Pin
Chris Ross 28-May-12 5:51
Chris Ross 28-May-12 5:51 
As CDP said - exceptions are named for the circumstances where you need to deal with the unexpected.

In your example "the company already having a project assigned" could perhaps be considered an error; most programmers would not, however, consider it to be an exception. So here, too, the use of exceptions to deal with the situation is inappropriate.

Given your specific example, I would venture to say that "the company already having a project assigned" is not even an error, but just a specific condition that you need to manage - and your example of showing a message to the user (second example) is consistent with that interpretation.

None - after assimilating what conditions could reasonably considered exceptions (out of memory; out of hard drive space; file not found when it really should be there; web service not responding, etc.) it becomes an interesting question as to what an 'error' actually is, and whether it's a term that's safe to use. I'd say that there is no right answer to that question - but there is definitely value in considering the question and the implications of any answer you come up with.
JokeRe: See the writing on the wall... Pin
Tom Delany3-May-12 9:51
Tom Delany3-May-12 9:51 
GeneralRe: See the writing on the wall... Pin
CDP18023-May-12 12:33
CDP18023-May-12 12:33 
GeneralRe: See the writing on the wall... Pin
RobEpworth3-May-12 18:47
RobEpworth3-May-12 18:47 
GeneralRe: See the writing on the wall... Pin
Matthys Terblanche3-May-12 21:44
Matthys Terblanche3-May-12 21:44 
GeneralRe: See the writing on the wall... Pin
Jeremy Hutchinson4-May-12 1:32
professionalJeremy Hutchinson4-May-12 1:32 
GeneralRe: See the writing on the wall... Pin
CDP18024-May-12 2:24
CDP18024-May-12 2:24 
GeneralRe: See the writing on the wall... Pin
Jeremy Hutchinson4-May-12 2:29
professionalJeremy Hutchinson4-May-12 2:29 
GeneralRe: See the writing on the wall... Pin
Dan Neely4-May-12 2:37
Dan Neely4-May-12 2:37 
GeneralRe: See the writing on the wall... Pin
CDP18024-May-12 2:41
CDP18024-May-12 2:41 
GeneralRe: See the writing on the wall... Pin
JackDingler4-May-12 4:27
JackDingler4-May-12 4:27 
GeneralRe: See the writing on the wall... Pin
bkebamc4-May-12 5:47
bkebamc4-May-12 5:47 
GeneralRe: See the writing on the wall... Pin
KP Lee5-May-12 9:50
KP Lee5-May-12 9:50 
Generalshame to my tester or me? Pin
kdgupta871-May-12 21:15
kdgupta871-May-12 21:15 
GeneralRe: shame to my tester or me? Pin
CDP18021-May-12 21:29
CDP18021-May-12 21:29 
GeneralRe: shame to my tester or me? Pin
kdgupta871-May-12 21:49
kdgupta871-May-12 21:49 
GeneralRe: shame to my tester or me? PinPopular
CDP18021-May-12 22:54
CDP18021-May-12 22:54 
GeneralRe: shame to my tester or me? PinPopular
PIEBALDconsult2-May-12 3:12
mvePIEBALDconsult2-May-12 3:12 

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.