Click here to Skip to main content
15,890,882 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: Try Fail... Pin
KP Lee18-Jun-12 21:55
KP Lee18-Jun-12 21:55 
GeneralWhy use String.Concat() ? Pin
CoperNick13-Jun-12 3:04
CoperNick13-Jun-12 3:04 
GeneralRe: Why use String.Concat() ? Pin
CoperNick13-Jun-12 3:08
CoperNick13-Jun-12 3:08 
GeneralRe: Why use String.Concat() ? Pin
StM0n13-Jun-12 5:59
StM0n13-Jun-12 5:59 
GeneralRe: Why use String.Concat() ? Pin
leppie14-Jun-12 1:55
leppie14-Jun-12 1:55 
GeneralRe: Why use String.Concat() ? Pin
Brisingr Aerowing14-Jun-12 2:12
professionalBrisingr Aerowing14-Jun-12 2:12 
GeneralRe: Why use String.Concat() ? Pin
FireDog3126218-Jun-12 3:26
FireDog3126218-Jun-12 3:26 
GeneralRe: Why use String.Concat() ? Pin
KP Lee18-Jun-12 22:59
KP Lee18-Jun-12 22:59 
If you've read anything about strings, you must have read that you should use StringBuilder instead. "some text" + "some more" + " text" is expensive. I would guess Concat gives you a performance boost similar to StringBuilder, but limited to strings. I have to admit that appending each value individually in builder is bothersome.

I know I wanted to find out how much builder helps, so I built a cpu intensive process with accounting numbers. I mixed fixed text with numbers to a string using + logic. Got the actual coding to work and changed over to StringBuilder. Processing went from 40 minutes to 20 minutes. Then I changed the logic to only use builder when I needed to save the stat strings. Cut down to 7 minutes. Then played with the process order and it went to 4 minutes. Needed to buy my second laptop in 7 years to cut it to 2 minutes. Smile | :)
GeneralWhy on earth? Pin
leppie13-Jun-12 0:07
leppie13-Jun-12 0:07 
GeneralRe: Why on earth? Pin
Sentenryu13-Jun-12 0:25
Sentenryu13-Jun-12 0:25 
GeneralRe: Why on earth? Pin
Vitaly Tomilov14-Jun-12 1:30
Vitaly Tomilov14-Jun-12 1:30 
QuestionRe: Why on earth? Pin
leppie14-Jun-12 1:33
leppie14-Jun-12 1:33 
AnswerRe: Why on earth? Pin
Vitaly Tomilov14-Jun-12 1:36
Vitaly Tomilov14-Jun-12 1:36 
GeneralRe: Why on earth? Pin
leppie14-Jun-12 1:40
leppie14-Jun-12 1:40 
GeneralAaaarg....use the namespace Pin
thatraja11-Jun-12 5:56
professionalthatraja11-Jun-12 5:56 
GeneralRe: Aaaarg....use the namespace Pin
Sentenryu11-Jun-12 6:39
Sentenryu11-Jun-12 6:39 
GeneralRe: Aaaarg....use the namespace Pin
Manfred Rudolf Bihy12-Jun-12 3:47
professionalManfred Rudolf Bihy12-Jun-12 3:47 
GeneralRe: Aaaarg....use the namespace Pin
Sentenryu12-Jun-12 4:54
Sentenryu12-Jun-12 4:54 
GeneralRe: Aaaarg....use the namespace Pin
thatraja14-Jun-12 22:45
professionalthatraja14-Jun-12 22:45 
GeneralRe: Aaaarg....use the namespace Pin
Sentenryu15-Jun-12 0:23
Sentenryu15-Jun-12 0:23 
GeneralRe: Aaaarg....use the namespace Pin
thatraja17-Jun-12 6:11
professionalthatraja17-Jun-12 6:11 
AnswerRe: Aaaarg....use the namespace Pin
Eddy Vluggen12-Jun-12 3:53
professionalEddy Vluggen12-Jun-12 3:53 
GeneralRe: Aaaarg....use the namespace Pin
Sentenryu12-Jun-12 4:43
Sentenryu12-Jun-12 4:43 
GeneralRe: Aaaarg....use the namespace Pin
PIEBALDconsult12-Jun-12 4:52
mvePIEBALDconsult12-Jun-12 4:52 
GeneralRe: Aaaarg....use the namespace Pin
Sentenryu12-Jun-12 5:11
Sentenryu12-Jun-12 5:11 

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.