Click here to Skip to main content
16,008,954 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: KISS and Structured Code Pin
Pete O'Hanlon3-Apr-09 3:38
mvePete O'Hanlon3-Apr-09 3:38 
GeneralRe: KISS and Structured Code [modified] Pin
Tristan Rhodes3-Apr-09 6:24
Tristan Rhodes3-Apr-09 6:24 
GeneralRe: KISS and Structured Code Pin
jayart6-Apr-09 0:08
jayart6-Apr-09 0:08 
GeneralRe: KISS and Structured Code Pin
Dan Neely6-Apr-09 2:25
Dan Neely6-Apr-09 2:25 
JokeRe: KISS and Structured Code Pin
Luc Pattyn6-Apr-09 4:45
sitebuilderLuc Pattyn6-Apr-09 4:45 
GeneralRe: KISS and Structured Code Pin
Dan Neely6-Apr-09 5:18
Dan Neely6-Apr-09 5:18 
GeneralRe: KISS and Structured Code Pin
Tristan Rhodes7-Apr-09 2:22
Tristan Rhodes7-Apr-09 2:22 
GeneralRe: KISS and Structured Code Pin
Luc Pattyn7-Apr-09 3:09
sitebuilderLuc Pattyn7-Apr-09 3:09 
Hi,

there is no performance hit for testing and throwing exceptions; what is slow is catching exceptions, especially so for the first one caught inside Visual Studio. But then exceptions should be used to deal with exceptional circumstances only, which does *not* mean they should be used rarely.

It would be a bad idea to use them like so:
int[] numbers=new int[100];
for (int i=0; ; i++) numbers[i]=i; // break with IndexOutOfRangeException 


Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


GeneralRe: KISS and Structured Code Pin
kfoster6-Apr-09 13:24
kfoster6-Apr-09 13:24 
GeneralRe: KISS and Structured Code Pin
Pete O'Hanlon12-Apr-09 10:40
mvePete O'Hanlon12-Apr-09 10:40 
GeneralRe: KISS and Structured Code Pin
OriginalGriff14-Apr-09 6:04
mveOriginalGriff14-Apr-09 6:04 
GeneralRe: Guess His Experience Level Pin
akyriako782-Apr-09 2:00
akyriako782-Apr-09 2:00 
JokeRe: Guess His Experience Level Pin
Pete O'Hanlon2-Apr-09 2:20
mvePete O'Hanlon2-Apr-09 2:20 
JokeRe: Guess His Experience Level Pin
Thomas Weller2-Apr-09 2:29
Thomas Weller2-Apr-09 2:29 
GeneralInitializing an array of structures PinPopular
Adrian Cole23-Mar-09 8:10
Adrian Cole23-Mar-09 8:10 
GeneralRe: Initializing an array of structures Pin
Luc Pattyn23-Mar-09 8:12
sitebuilderLuc Pattyn23-Mar-09 8:12 
AnswerRe: Initializing an array of structures Pin
Adrian Cole23-Mar-09 8:15
Adrian Cole23-Mar-09 8:15 
GeneralRe: Initializing an array of structures Pin
Luc Pattyn23-Mar-09 8:27
sitebuilderLuc Pattyn23-Mar-09 8:27 
GeneralRe: Initializing an array of structures Pin
Thomas Weller23-Mar-09 8:35
Thomas Weller23-Mar-09 8:35 
GeneralRe: Initializing an array of structures Pin
Luc Pattyn23-Mar-09 8:43
sitebuilderLuc Pattyn23-Mar-09 8:43 
GeneralRe: Initializing an array of structures Pin
Adrian Cole23-Mar-09 10:00
Adrian Cole23-Mar-09 10:00 
GeneralRe: Initializing an array of structures Pin
Fatbuddha 123-Mar-09 23:34
Fatbuddha 123-Mar-09 23:34 
GeneralRe: Initializing an array of structures Pin
VentsyV25-Mar-09 11:12
VentsyV25-Mar-09 11:12 
GeneralRe: Initializing an array of structures Pin
peterchen30-Mar-09 6:19
peterchen30-Mar-09 6:19 
GeneralRe: Initializing an array of structures Pin
Thomas Weller2-Apr-09 2:24
Thomas Weller2-Apr-09 2:24 

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.