Click here to Skip to main content
15,887,746 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: Most Unhelpful Message Ever Pin
Chad3F7-Sep-13 12:40
Chad3F7-Sep-13 12:40 
GeneralRe: Most Unhelpful Message Ever Pin
pasztorpisti7-Sep-13 13:09
pasztorpisti7-Sep-13 13:09 
GeneralRe: Most Unhelpful Message Ever Pin
BillW3330-Aug-13 5:35
professionalBillW3330-Aug-13 5:35 
GeneralRe: Most Unhelpful Message Ever Pin
pasztorpisti7-Sep-13 0:34
pasztorpisti7-Sep-13 0:34 
QuestionWhich code you suggest? Pin
Rajesh Anuhya24-Jul-13 20:04
professionalRajesh Anuhya24-Jul-13 20:04 
AnswerRe: Which code you suggest? PinPopular
NeverJustHere24-Jul-13 21:02
NeverJustHere24-Jul-13 21:02 
GeneralRe: Which code you suggest? Pin
Reelix25-Jul-13 21:36
Reelix25-Jul-13 21:36 
GeneralRe: Which code you suggest? Pin
KP Lee26-Jul-13 17:21
KP Lee26-Jul-13 17:21 
Reelix wrote:
You left out the ;
Laugh | :laugh:
Well, the benefit of your first option is that it is faster as has already been mentioned. Sometimes built-in's are faster.
For that reason you might want to look at the built-in function. I read that someone thought the bubble sort put in an article was very efficient. I'm going "Oh G.., save us from inexperienced programmers" Built the bubble sort, a slightly more efficient version, and my binary sort routine I (re)wrote after seeing that #%#$@. I stopped testing performance of the bubble sort at 200K (over 2 minutes) I threw in the built in sort routine too. Both were sorting 200K in sub-second times. After getting up there in size, the built-in was performing in about 2/3 the time my routine was.
In Big O, the bubble was N^2 and time tests matched that estimated. I stopped testing mine at 150M (space ran out at 200M) Built-in 29 seconds, mine 49 seconds, slightly faster than 2/3. I estimated the bubble would finish in 750 squared times 130 seconds.
AnswerRe: Which code you suggest? Pin
_Damian S_24-Jul-13 21:02
professional_Damian S_24-Jul-13 21:02 
AnswerRe: Which code you suggest? PinPopular
Ingo25-Jul-13 3:42
Ingo25-Jul-13 3:42 
AnswerRe: Which code you suggest? Pin
ZurdoDev25-Jul-13 4:48
professionalZurdoDev25-Jul-13 4:48 
GeneralRe: Which code you suggest? PinPopular
OriginalGriff25-Jul-13 5:04
mveOriginalGriff25-Jul-13 5:04 
GeneralRe: Which code you suggest? Pin
ZurdoDev25-Jul-13 5:11
professionalZurdoDev25-Jul-13 5:11 
GeneralRe: Which code you suggest? Pin
Sentenryu25-Jul-13 7:15
Sentenryu25-Jul-13 7:15 
GeneralRe: Which code you suggest? Pin
ZurdoDev25-Jul-13 7:32
professionalZurdoDev25-Jul-13 7:32 
GeneralRe: Which code you suggest? Pin
OriginalGriff25-Jul-13 8:26
mveOriginalGriff25-Jul-13 8:26 
GeneralRe: Which code you suggest? Pin
ZurdoDev25-Jul-13 8:28
professionalZurdoDev25-Jul-13 8:28 
GeneralRe: Which code you suggest? Pin
OriginalGriff25-Jul-13 8:31
mveOriginalGriff25-Jul-13 8:31 
GeneralRe: Which code you suggest? Pin
ZurdoDev25-Jul-13 8:35
professionalZurdoDev25-Jul-13 8:35 
GeneralRe: Which code you suggest? Pin
Andrew Leeder25-Jul-13 22:34
Andrew Leeder25-Jul-13 22:34 
GeneralRe: Which code you suggest? Pin
OriginalGriff25-Jul-13 22:50
mveOriginalGriff25-Jul-13 22:50 
GeneralRe: Which code you suggest? Pin
SortaCore25-Jul-13 23:15
SortaCore25-Jul-13 23:15 
GeneralRe: Which code you suggest? PinPopular
OriginalGriff25-Jul-13 23:22
mveOriginalGriff25-Jul-13 23:22 
GeneralRe: Which code you suggest? Pin
SortaCore25-Jul-13 23:39
SortaCore25-Jul-13 23:39 
GeneralRe: Which code you suggest? Pin
Stefan_Lang26-Jul-13 0:19
Stefan_Lang26-Jul-13 0:19 

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.