Click here to Skip to main content
13,667,632 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: A disturbing new trend? Pin
Mark_Wallace3-Nov-14 21:21
memberMark_Wallace3-Nov-14 21:21 
GeneralRe: A disturbing new trend? Pin
Simon O'Riordan from UK3-Nov-14 21:29
memberSimon O'Riordan from UK3-Nov-14 21:29 
GeneralRe: A disturbing new trend? Pin
PIEBALDconsult4-Nov-14 4:14
protectorPIEBALDconsult4-Nov-14 4:14 
GeneralRe: A disturbing new trend? Pin
Dan Sutton4-Nov-14 6:14
memberDan Sutton4-Nov-14 6:14 
GeneralRe: A disturbing new trend? Pin
patbob4-Nov-14 7:16
memberpatbob4-Nov-14 7:16 
GeneralRe: A disturbing new trend? Pin
Gary R. Wheeler8-Nov-14 1:34
memberGary R. Wheeler8-Nov-14 1:34 
GeneralRe: A disturbing new trend? Pin
Peter Shaw8-Nov-14 3:29
professionalPeter Shaw8-Nov-14 3:29 
GeneralCopy and Paste should be banned from a code editor Pin
Marc Clifton3-Nov-14 8:26
protectorMarc Clifton3-Nov-14 8:26 
This code (sanitized):

static public void PostSomeCodeMethod(string v1, string v2, string v3)
    {
        string xmldata = iRecord.CreateField("apicode", APICodes.SomeCode.ToString());
        xmldata += iRecord.CreateField("f1", const1);
        xmldata += iRecord.CreateField("f2", const2);
        xmldata += iRecord.CreateField("f3", v1);
        xmldata += iRecord.CreateField("f4", v2);
        xmldata += iRecord.CreateField("f5", v3);

        ErrorMessage = null;
        CallPostAPI(xmldata);


Is duplicated a dozen times. The only difference? The method name and the APICodes enumeration.

I swear, copy and paste should be banned, and there must be something we can put into the water that prevents programmers like this from ever writing another line of code.

(Not to mention the horrific way the XML data is created. Happy belated Halloween, everyone.)

Marc

GeneralRequired Response Pin
W Balboos3-Nov-14 8:45
memberW Balboos3-Nov-14 8:45 
GeneralRe: Required Response Pin
Marc Clifton3-Nov-14 8:47
protectorMarc Clifton3-Nov-14 8:47 
GeneralRe: Required Response Pin
Sander Rossel3-Nov-14 8:54
professionalSander Rossel3-Nov-14 8:54 
GeneralRe: Copy and Paste should be banned from a code editor Pin
Sander Rossel3-Nov-14 8:53
professionalSander Rossel3-Nov-14 8:53 
GeneralRe: Copy and Paste should be banned from a code editor Pin
Marc Clifton3-Nov-14 8:56
protectorMarc Clifton3-Nov-14 8:56 
GeneralRe: Copy and Paste should be banned from a code editor Pin
Eddy Vluggen3-Nov-14 9:07
professionalEddy Vluggen3-Nov-14 9:07 
GeneralRe: Copy and Paste should be banned from a code editor Pin
Sander Rossel3-Nov-14 9:28
professionalSander Rossel3-Nov-14 9:28 
GeneralRe: Copy and Paste should be banned from a code editor Pin
Ravi Bhavnani3-Nov-14 9:08
professionalRavi Bhavnani3-Nov-14 9:08 
GeneralRe: Copy and Paste should be banned from a code editor Pin
Marc Clifton3-Nov-14 9:29
protectorMarc Clifton3-Nov-14 9:29 
GeneralRe: Copy and Paste should be banned from a code editor Pin
Ravi Bhavnani3-Nov-14 11:11
professionalRavi Bhavnani3-Nov-14 11:11 
GeneralRe: Copy and Paste should be banned from a code editor Pin
Mark_Wallace3-Nov-14 21:26
memberMark_Wallace3-Nov-14 21:26 
JokeRe: Copy and Paste should be banned from a code editor Pin
Freak305-Nov-14 0:50
memberFreak305-Nov-14 0:50 
GeneralRe: Copy and Paste should be banned from a code editor Pin
Ian Shlasko3-Nov-14 9:30
professionalIan Shlasko3-Nov-14 9:30 
GeneralRe: Copy and Paste should be banned from a code editor Pin
Marc Clifton3-Nov-14 9:39
protectorMarc Clifton3-Nov-14 9:39 
GeneralRe: Copy and Paste should be banned from a code editor Pin
PIEBALDconsult3-Nov-14 10:22
protectorPIEBALDconsult3-Nov-14 10:22 
GeneralRe: Copy and Paste should be banned from a code editor Pin
Mark_Wallace3-Nov-14 21:27
memberMark_Wallace3-Nov-14 21:27 
GeneralRe: Copy and Paste should be banned from a code editor Pin
Plamen Dragiyski4-Nov-14 0:11
memberPlamen Dragiyski4-Nov-14 0: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.


Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.180820.1 | Last Updated 21 Aug 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid