Click here to Skip to main content
16,004,271 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: Coded insults Pin
dojohansen2-Oct-12 2:24
dojohansen2-Oct-12 2:24 
GeneralRe: Coded insults Pin
Brisingr Aerowing1-Oct-12 7:08
professionalBrisingr Aerowing1-Oct-12 7:08 
GeneralRe: Coded insults Pin
JammoD871-Oct-12 23:43
JammoD871-Oct-12 23:43 
GeneralRe: Coded insults Pin
Joe_Dert20-Oct-12 20:46
Joe_Dert20-Oct-12 20:46 
GeneralRe: Coded insults Pin
Brisingr Aerowing30-Dec-12 12:48
professionalBrisingr Aerowing30-Dec-12 12:48 
GeneralFamiliarity : Trimming leading and trailing spaces from a string... Pin
Blake Miller26-Sep-12 11:26
Blake Miller26-Sep-12 11:26 
GeneralRe: Familiarity : Trimming leading and trailing spaces from a string... Pin
Jörgen Andersson26-Sep-12 20:29
professionalJörgen Andersson26-Sep-12 20:29 
GeneralRe: Familiarity : Trimming leading and trailing spaces from a string... Pin
Jecc28-Sep-12 0:46
Jecc28-Sep-12 0:46 
GeneralRe: Familiarity : Trimming leading and trailing spaces from a string... Pin
Blake Miller28-Sep-12 4:08
Blake Miller28-Sep-12 4:08 
GeneralRe: Familiarity : Trimming leading and trailing spaces from a string... Pin
RafagaX28-Sep-12 6:01
professionalRafagaX28-Sep-12 6:01 
GeneralRe: Familiarity : Trimming leading and trailing spaces from a string... Pin
Brady Kelly29-Sep-12 6:39
Brady Kelly29-Sep-12 6:39 
GeneralRe: Familiarity : Trimming leading and trailing spaces from a string... Pin
Jamercee28-Sep-12 4:23
Jamercee28-Sep-12 4:23 
GeneralRe: Familiarity : Trimming leading and trailing spaces from a string... Pin
Blake Miller28-Sep-12 4:52
Blake Miller28-Sep-12 4:52 
GeneralRe: Familiarity : Trimming leading and trailing spaces from a string... Pin
Martin081528-Sep-12 4:24
professionalMartin081528-Sep-12 4:24 
GeneralRe: Familiarity : Trimming leading and trailing spaces from a string... Pin
Chris Boss28-Sep-12 4:35
professionalChris Boss28-Sep-12 4:35 
QuestionRe: Familiarity : Trimming leading and trailing spaces from a string... Pin
Julien Villers2-Oct-12 23:57
professionalJulien Villers2-Oct-12 23:57 
GeneralRe: Familiarity : Trimming leading and trailing spaces from a string... Pin
Joe_Dert20-Oct-12 21:09
Joe_Dert20-Oct-12 21:09 
JokeParsing string to Integer with try and catch??? Pin
Marco Bertschi25-Sep-12 1:27
protectorMarco Bertschi25-Sep-12 1:27 
GeneralRe: Parsing string to Integer with try and catch??? PinPopular
Pete O'Hanlon25-Sep-12 2:04
mvePete O'Hanlon25-Sep-12 2:04 
GeneralRe: Parsing string to Integer with try and catch??? Pin
Marco Bertschi25-Sep-12 2:57
protectorMarco Bertschi25-Sep-12 2:57 
GeneralRe: Parsing string to Integer with try and catch??? Pin
dojohansen2-Oct-12 3:34
dojohansen2-Oct-12 3:34 
GeneralRe: Parsing string to Integer with try and catch??? Pin
OriginalGriff25-Sep-12 3:32
mveOriginalGriff25-Sep-12 3:32 
GeneralRe: Parsing string to Integer with try and catch??? Pin
Marco Bertschi25-Sep-12 3:36
protectorMarco Bertschi25-Sep-12 3:36 
GeneralRe: Parsing string to Integer with try and catch??? Pin
KP Lee28-Sep-12 22:17
KP Lee28-Sep-12 22:17 
AnswerRe: Parsing string to Integer with try and catch??? Pin
Marco Bertschi30-Sep-12 21:01
protectorMarco Bertschi30-Sep-12 21:01 
KP Lee

It does something, but I removed the specific code under the Parsing part.
It was not slow because it threw an exception. It was slow because it threw about 500 exceptions during the import of one single file.

However, your are right when you say that only a complete moron of a user would put a string instead of a number when a number is required.

To complete the explanation, I added the whole source code to the original post.

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.