Click here to Skip to main content
15,884,298 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: Austin Danger Powers Pin
AspDotNetDev13-Apr-11 3:50
protectorAspDotNetDev13-Apr-11 3:50 
GeneralRe: Austin Danger Powers Pin
G-Tek13-Apr-11 5:27
G-Tek13-Apr-11 5:27 
GeneralRe: Austin Danger Powers Pin
Paladin200013-Apr-11 6:32
Paladin200013-Apr-11 6:32 
GeneralRe: Austin Danger Powers Pin
Paladin200013-Apr-11 4:13
Paladin200013-Apr-11 4:13 
GeneralRe: Austin Danger Powers Pin
G-Tek13-Apr-11 4:29
G-Tek13-Apr-11 4:29 
AnswerRe: Austin Danger Powers Pin
DragonsRightWing22-Apr-11 7:16
DragonsRightWing22-Apr-11 7:16 
GeneralRe: Austin Danger Powers Pin
_Erik_13-Apr-11 5:16
_Erik_13-Apr-11 5:16 
GeneralRe: Austin Danger Powers Pin
AspDotNetDev13-Apr-11 6:46
protectorAspDotNetDev13-Apr-11 6:46 
Indeed, that may act very similar. However, here are two problems I see with that code:
  1. What if, for whatever reason, a user has two consecutive spaces in their first name? Given the variety of cultures, I wouldn't discount this.
  2. This version creates several extra and unnecessary strings.
  3. Unnecessary CPU time spent scanning the name parts (first/middle/last) for space to replace.


Still, with how compact it is, I'd say those are fine trade offs.
This is not the age of reason, this is the age of flummery, and the day of the devious approach. Reason’s gone into the backrooms where it works to devise means by which people can be induced to emote in the desired direction.

GeneralRe: Austin Danger Powers Pin
TorstenFrings13-Apr-11 23:09
TorstenFrings13-Apr-11 23:09 
GeneralRe: Austin Danger Powers Pin
AspDotNetDev20-Apr-11 7:08
protectorAspDotNetDev20-Apr-11 7:08 
GeneralRe: Austin Danger Powers Pin
TorstenFrings20-Apr-11 23:32
TorstenFrings20-Apr-11 23:32 
GeneralRe: Austin Danger Powers Pin
AspDotNetDev21-Apr-11 7:56
protectorAspDotNetDev21-Apr-11 7:56 
GeneralRe: Austin Danger Powers Pin
Jassim Makki16-Apr-11 5:43
Jassim Makki16-Apr-11 5:43 
GeneralRevolutionary new way to iterate indexable collections. Who needs to know how many elements they have? PinPopular
Vladimir Svyatski9-Apr-11 2:24
professionalVladimir Svyatski9-Apr-11 2:24 
GeneralRe: Revolutionary new way to iterate indexable collections. Who needs to know how many elements they have? PinPopular
Uros Calakovic9-Apr-11 6:55
Uros Calakovic9-Apr-11 6:55 
GeneralRe: Revolutionary new way to iterate indexable collections. Who needs to know how many elements they have? Pin
BillW3312-Apr-11 3:06
professionalBillW3312-Apr-11 3:06 
GeneralLong Post! Re: Revolutionary new way to iterate indexable collections. Who needs to know how many elements they have? [modified] Pin
Keith Barrow16-Apr-11 6:34
professionalKeith Barrow16-Apr-11 6:34 
GeneralRe: Long Post! Re: Revolutionary new way to iterate indexable collections. Who needs to know how many elements they have? Pin
Vladimir Svyatski18-Apr-11 5:54
professionalVladimir Svyatski18-Apr-11 5:54 
GeneralRe: Long Post! Re: Revolutionary new way to iterate indexable collections. Who needs to know how many elements they have? Pin
Keith Barrow18-Apr-11 6:43
professionalKeith Barrow18-Apr-11 6:43 
GeneralRe: Revolutionary new way to iterate indexable collections. Who needs to know how many elements they have? Pin
DragonsRightWing22-Apr-11 7:44
DragonsRightWing22-Apr-11 7:44 
GeneralI frequently type un-compilable code or comments to myself... Pin
puromtec16-Apr-11 15:13
puromtec16-Apr-11 15:13 
GeneralRe: I frequently type un-compilable code or comments to myself... Pin
Sander Rossel6-Apr-11 19:38
professionalSander Rossel6-Apr-11 19:38 
GeneralRe: I frequently type un-compilable code or comments to myself... Pin
Jyothikarthik_N6-Apr-11 21:38
Jyothikarthik_N6-Apr-11 21:38 
GeneralRe: I frequently type un-compilable code or comments to myself... Pin
Sander Rossel7-Apr-11 6:51
professionalSander Rossel7-Apr-11 6:51 
GeneralRe: I frequently type un-compilable code or comments to myself... Pin
BillW337-Apr-11 7:23
professionalBillW337-Apr-11 7:23 

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.