Skip to content

The Weird and The Wonderful

It was the best of code, it was the worst of code. Coding Horrors, Worst Practices, and flashes of brilliance

This category can be followed from the open social web via the handle the-weird-and-the-wonderful@forum.codeproject.com

1.8k Topics 20.7k Posts
  • Comparing objects? SIMPLE!

    java question
    2
    0 Votes
    2 Posts
    0 Views
    _
    TorstenH. wrote: C-Programmer trying to code Java Or maybe a .NET programmer (C# probably) who failed to find that Java "instanceof" operator is the equivalent to the C# "is" operator.
  • When professionals don't think

    csharp css linq tutorial question
    11
    0 Votes
    11 Posts
    0 Views
    M
    You had me at the word "Manager". Explains it all. I am half a manager now, and my code has been deteriorating at an alarming rate.
  • seeing a student code

    database security
    9
    0 Votes
    9 Posts
    1 Views
    K
    and also setup oracle server in windows is hell of a job.
  • Can you top that?

    c++ css com help question
    8
    0 Votes
    8 Posts
    0 Views
    L
    Top that? Easily. Here is just one of endlessly many similar static methods in an application I just replaced (including comments and documentation): public static int DoSomethingWithBunnies(int auswahl, string artnr, string artbez, string lnam, string lnr, string lartnr, string wg, string mkenz, string ean, string gab, bool ges, bool bug, bool bau, bool eks, int stanort, string uid) { // You don't want to see what comes here } Edit: It's not the number of parameters that's the problem here. Much worse that all methods are static, usually at least 1000 lines of the worst spaghetti code long and often redundant. There are at least two more versions of this particular method here with '2' and '3' added to the name with little to no apparent differences in the copied code. All without any comments except for those I added or any documentation. "I have what could be described as the most wide-open sense of humor on the site, and if I don't think something is funny, then it really isn't." - JSOC, 2011 ----- "Friar Modest never was a prior" - Italian proverb
  • The Clever Trevor School of Programming....

    6
    0 Votes
    6 Posts
    0 Views
    P
    Or maybe VB is such a well designed language that stupid mistakes are really obvious, and thus are more frequently ofund and posted *snicker* FILETIME to time_t | FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy
  • Wonderful naming

    json question
    11
    0 Votes
    11 Posts
    0 Views
    B
    I'd rather think of The Onion's E-Toilet. See here: http://www.theonion.com/articles/new-etoilet-to-revolutionize-online-shitting,633/[^]
  • Regitration Activation Mail

    com lounge
    8
    0 Votes
    8 Posts
    1 Views
    OriginalGriffO
    Jörgen Andersson wrote: I think you need to get a girlfriend who doesn't ask for your credit card number. Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
  • Secure enrcyption function

    security
    9
    0 Votes
    9 Posts
    1 Views
    V
    You know, this function is so great that it will crash the application if "dat" is long enough (longer than 130 symbols).
  • Cannot Upload file with Internet Explorer 7

    10
    0 Votes
    10 Posts
    0 Views
    _
    I know how to fix it. Instead of the message: "You cannot upload files with Internet Explorer 7. Please use a newer browser like IE6, IE8 or Firefox" Show this one: "You cannot upload files with your current browser. Try another one." :laugh: Hey, you will never be able to upload files, but at least your message is not cheating.
  • Programming Hell

    json question announcement
    8
    0 Votes
    8 Posts
    0 Views
    L
    And, as this is the hall of shame, GOTO HELL; ___________________________________________ .\\axxx (That's an 'M')
  • System.Windows.Shell namespace

    question csharp java dotnet linux
    6
    0 Votes
    6 Posts
    1 Views
    L
    Trollslayer wrote: How else do you legitimately access those features? Hmm, you are right. Anyway it must be placed somewhere or we are back to interop. The best place for that would be a 2nd party .NET library -- not in the framework itself. The same with GDI/WPF. Who uses both GDI and WPF? If GDI was in a separate lib from the beginning there wouldn't such a mess today. A designer would choose a technology for GUI and data storage and wouldn't have to reference all former/future technologies. But this is just my opinion. Ouch. Kombadibilidy. Greetings - Jacek
  • I don't care about your naming convention, just be consistent [modified]

    21
    0 Votes
    21 Posts
    2 Views
    J
    His name is probably the only Hungarian name that CAN be pronounced. Man, do they know how to mess up names, or what? :~ -- Kein Mitleid Für Die Mehrheit
  • Performance Genius

    docker performance question announcement
    21
    0 Votes
    21 Posts
    22 Views
    Y
    Lol... that was a typo. Thanks Adrian0. :thumbsup:
  • Obsure ASP.Net Bug?

    csharp html asp-net visual-studio sysadmin
    10
    0 Votes
    10 Posts
    1 Views
    A
    Oh, I gotcha. Yeah, that is annoying. I usually use an asp:Literal tag to get around that. [WikiLeaks Cablegate Cables]
  • Function that just to fill an empty space ....

    database oracle
    10
    0 Votes
    10 Posts
    0 Views
    J
    PL-SQL supports overloading... List of common misconceptions
  • Government IT Hiring

    database sysadmin oop career html
    20
    0 Votes
    20 Posts
    3 Views
    M
    This explains much. I've always suspected that the lunatics are running the asylum. Now I know where NMCI came from.
  • Reassuring?

    com data-structures testing tools question
    9
    0 Votes
    9 Posts
    0 Views
    F
    At least that part is reassuring. :) I wasn't, now I am, then I won't be anymore.
  • Magic Numbers

    10
    0 Votes
    10 Posts
    0 Views
    A
    That is organisationally crap on so many levels. :doh: Anna :rose: Tech Blog | Visual Lint "Why would anyone prefer to wield a weapon that takes both hands at once, when they could use a lighter (and obviously superior) weapon that allows you to wield multiple ones at a time, and thus supports multi-paradigm carnage?"
  • At least this one was easy to refactor...

    code-review
    7
    0 Votes
    7 Posts
    0 Views
    E
    What I find deeply disturbing by this and other examples of bad coding is that these people get paid for writing this rubbish. Furthermore, what is more frightening is the fact that they could be writing code for safety systems or banking systems or who knows what else. No bloody wonder the software industry puts a NO WARRANTIES EXPRESSED OR IMPLIED notice into every EULA D'Oh! They're not even sure it's going to work. Can you imagine buying a new car and the manufacturer said that there were no warranties? Nobody can get the truth out of me because even I don't know what it is. I keep myself in a constant state of utter confusion. - Col. Flagg
  • Naming ! ! !

    sales
    10
    0 Votes
    10 Posts
    1 Views
    H
    We worked with a third party application designed in France - all the database table names were French abbreviations or acronyms. The "Authorized List" table was called ASS. Imagine the SQL when we desired to create a new record in that table: "INSERT INTO ASS ..." :laugh: