Click here to Skip to main content
15,891,033 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: Don't they know what an array is? Pin
VickyC#21-Nov-09 15:16
VickyC#21-Nov-09 15:16 
GeneralRe: Don't they know what an array is? Pin
Member 448708322-Nov-09 0:11
Member 448708322-Nov-09 0:11 
GeneralRe: Don't they know what an array is? Pin
Shameel24-Nov-09 23:42
professionalShameel24-Nov-09 23:42 
GeneralRe: Don't they know what an array is? Pin
dojohansen25-Nov-09 2:21
dojohansen25-Nov-09 2:21 
JokeRe: Don't they know what an array is? Pin
PIEBALDconsult25-Nov-09 16:40
mvePIEBALDconsult25-Nov-09 16:40 
GeneralRe: Don't they know what an array is? Pin
supercat93-Dec-09 10:03
supercat93-Dec-09 10:03 
GeneralRe: Don't they know what an array is? Pin
dojohansen4-Dec-09 1:02
dojohansen4-Dec-09 1:02 
GeneralRe: Don't they know what an array is? Pin
Timothy Byrd23-Dec-09 12:51
Timothy Byrd23-Dec-09 12:51 
I hate to admit it, but I've found code like that here from a previous developer. It's also in C#, but the delimiter is a newline. Maybe you have our old developer?

public string FormatBarContent(string foo1,
    string foo2, string f003,
    // ...
    string foo14,
    )
{
    StringBuilder sb=new StringBuilder();
    sb.Append(foo1);
    sb.Append("\n");
    sb.Append(foo2);
    sb.Append("\n");
    // ...
    sb.Append(foo14);
//    sb.Append("\n");
    return sb.ToString();
}


And some of the foo's have been converted from numbers to strings. The routine that gets this string immediately Split()'s it and parses the numbers back into numbers. None of the data ever needs to leave the current thread. Don't they know what a struct is?

-- T
GeneralWhy? Why?!! WHY!!!! PinPopular
Jeremy Hutchinson11-Nov-09 9:19
professionalJeremy Hutchinson11-Nov-09 9:19 
GeneralRe: Why? Why?!! WHY!!!! Pin
Sundance Kid11-Nov-09 18:49
Sundance Kid11-Nov-09 18:49 
GeneralRe: Why? Why?!! WHY!!!! Pin
Corinna John20-Nov-09 0:38
Corinna John20-Nov-09 0:38 
GeneralRe: Why? Why?!! WHY!!!! Pin
VickyC#21-Nov-09 15:21
VickyC#21-Nov-09 15:21 
GeneralRe: Why? Why?!! WHY!!!! Pin
Jeremy Hutchinson24-Nov-09 7:27
professionalJeremy Hutchinson24-Nov-09 7:27 
GeneralRe: Why? Why?!! WHY!!!! Pin
Mycroft Holmes25-Nov-09 18:32
professionalMycroft Holmes25-Nov-09 18:32 
GeneralThis is a pleasure to read. Pin
Wes Jones5-Nov-09 5:56
Wes Jones5-Nov-09 5:56 
GeneralRe: This is a pleasure to read. Pin
Nagy Vilmos6-Nov-09 4:09
professionalNagy Vilmos6-Nov-09 4:09 
GeneralRe: This is a pleasure to read. Pin
David Skelly6-Nov-09 5:00
David Skelly6-Nov-09 5:00 
GeneralRe: This is a pleasure to read. Pin
Wes Jones6-Nov-09 5:28
Wes Jones6-Nov-09 5:28 
GeneralRe: This is a pleasure to read. Pin
Jeremy Hutchinson11-Nov-09 9:06
professionalJeremy Hutchinson11-Nov-09 9:06 
GeneralRe: This is a pleasure to read. Pin
Wes Jones12-Nov-09 7:45
Wes Jones12-Nov-09 7:45 
QuestionRe: This is a pleasure to read. Pin
Lutosław16-Nov-09 23:14
Lutosław16-Nov-09 23:14 
AnswerRe: This is a pleasure to read. Pin
Wes Jones23-Nov-09 5:11
Wes Jones23-Nov-09 5:11 
GeneralRe: This is a pleasure to read. Pin
Shameel23-Nov-09 4:54
professionalShameel23-Nov-09 4:54 
GeneralRe: This is a pleasure to read. Pin
Wes Jones23-Nov-09 5:11
Wes Jones23-Nov-09 5:11 
GeneralRe: This is a pleasure to read. Pin
Shameel23-Nov-09 6:36
professionalShameel23-Nov-09 6:36 

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.