Click here to Skip to main content
15,894,825 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: Does this qualify as horror? Pin
PIEBALDconsult2-Jul-08 12:48
mvePIEBALDconsult2-Jul-08 12:48 
GeneralRe: Does this qualify as horror? Pin
PIEBALDconsult2-Jul-08 12:52
mvePIEBALDconsult2-Jul-08 12:52 
JokeRe: Does this qualify as horror? PinPopular
Paul Conrad1-Jul-08 17:22
professionalPaul Conrad1-Jul-08 17:22 
GeneralRe: Does this qualify as horror? Pin
Stephen Hewitt1-Jul-08 18:24
Stephen Hewitt1-Jul-08 18:24 
GeneralRe: Does this qualify as horror? Pin
StM0n1-Jul-08 19:31
StM0n1-Jul-08 19:31 
GeneralRe: Does this qualify as horror? Pin
Paul Conrad1-Jul-08 19:34
professionalPaul Conrad1-Jul-08 19:34 
GeneralRe: Does this qualify as horror? Pin
Spacix One2-Jul-08 4:49
Spacix One2-Jul-08 4:49 
GeneralRe: Does this qualify as horror? Pin
supercat92-Jul-08 7:40
supercat92-Jul-08 7:40 
Why should it qualify as a horror? Admittedly, the use of strings in that fashion is not terribly efficient, but since they're small and the number of operations is comparatively modest I wouldn't consider the inefficiency particularly objectionable if the code isn't executed too often (if 90% of the time is spent in 10% of the code, it wouldn't matter much if the other 90% of the code were twice as slow as it should be).

My own preference, especially if more parts were being assembled into the string, would be to either use something like a StringBuilder so as to avoid repeated allocations for the different partially-assembled strings, but I don't see anything particularly wrong with the code as given, or else (if using C++ or C#, as opposed to VB) spread one statement over multiple lines. The strings in the above example are short enough that using a simple string type is probably fine, though, and spreading statements over multiple lines isn't particularly aesthetically pleasing.
Questionread file from bottom Pin
vineeshV30-Jun-08 19:09
vineeshV30-Jun-08 19:09 
AnswerRe: read file from bottom Pin
Lee Humphries30-Jun-08 19:31
professionalLee Humphries30-Jun-08 19:31 
RantRe: read file from bottom Pin
KarstenK30-Jun-08 21:08
mveKarstenK30-Jun-08 21:08 
AnswerRe: read file from bottom Pin
Baconbutty30-Jun-08 21:54
Baconbutty30-Jun-08 21:54 
JokeRe: read file from bottom PinPopular
Mladen Janković1-Jul-08 1:15
Mladen Janković1-Jul-08 1:15 
GeneralGreat! Pin
CPallini1-Jul-08 2:15
mveCPallini1-Jul-08 2:15 
AnswerRe: read file from bottom [modified] PinPopular
killabyte30-Jun-08 23:48
killabyte30-Jun-08 23:48 
GeneralRe: read file from bottom Pin
jamie5501-Jul-08 1:16
jamie5501-Jul-08 1:16 
GeneralRe: read file from bottom Pin
Yusuf1-Jul-08 5:44
Yusuf1-Jul-08 5:44 
GeneralRe: read file from bottom Pin
Stephen Hewitt1-Jul-08 15:10
Stephen Hewitt1-Jul-08 15:10 
QuestionRe: read file from bottom Pin
killabyte1-Jul-08 17:22
killabyte1-Jul-08 17:22 
AnswerRe: read file from bottom Pin
Stephen Hewitt1-Jul-08 17:34
Stephen Hewitt1-Jul-08 17:34 
GeneralRe: read file from bottom Pin
Rage11-Jul-08 4:49
professionalRage11-Jul-08 4:49 
GeneralRe: read file from bottom [modified] Pin
killabyte11-Jul-08 14:19
killabyte11-Jul-08 14:19 
AnswerRe: read file from bottom Pin
Paul Conrad1-Jul-08 17:22
professionalPaul Conrad1-Jul-08 17:22 
AnswerRe: read file from bottom Pin
Edward Steward2-Jul-08 1:16
Edward Steward2-Jul-08 1:16 
GeneralRe: read file from bottom Pin
dybs16-Aug-08 18:29
dybs16-Aug-08 18:29 

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.