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
  • Threading horror

    5
    0 Votes
    5 Posts
    3 Views
    G
    That was a funny comment for sure, but... unless he had raised his thread's priority above most other threads in the system, the o/s would preemptively schedule other threads to run, so both processors would still be doing some useful work.
  • Iterating an Enum?

    question
    6
    0 Votes
    6 Posts
    3 Views
    P
    notmasteryet wrote: It is not multiple return you should worry about. That's about maintainability, not performance. notmasteryet wrote: Knowing when not to use try-catch is priceless Have you read this[^] article?
  • Do not trust a computer...

    tutorial
    2
    0 Votes
    2 Posts
    3 Views
    L
    notmasteryet wrote: startbit = Math.Ceiling(startbit / 16) * 16 Typical and terrible VB approach. :/ Greetings - Gajatko Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
  • C and Machine Code horror

    performance
    7
    0 Votes
    7 Posts
    4 Views
    S
    Timothy Baldwin wrote: As for discouraging reverse-engineering, this code is published under the GNU General Public Licence If it weren't for the comments, that might explain it. BTW, would the GPL require the release of source code for things like p-code which is interpreted by the rest of the program? What if the source code for the p-code never existed (because it was hand-generated)?
  • C# bool datatype horror [modified]

    csharp learning
    9
    0 Votes
    9 Posts
    3 Views
    T
    u r a champion to judge others?????/
  • 'Item': member names cannot be the same as their enclosing type

    csharp help
    29
    0 Votes
    29 Posts
    11 Views
    R
    Thanks Camilo, I already know that, but I post this since it has some taste of horror. :rolleyes: Best wishes, Redwan Al-Bougha
  • SQL trigger fun

    database question announcement
    6
    0 Votes
    6 Posts
    3 Views
    A
    You forgot this :) Bob Ashfield Consultants Ltd
  • Another Horror

    28
    0 Votes
    28 Posts
    10 Views
    C
    you know what they say.. 'measure twice, cut once'
  • This is just for the laugh of it.

    regex csharp
    27
    0 Votes
    27 Posts
    37 Views
    C
    mission impossible...
  • Horrible enough for you?

    javascript data-structures question
    22
    0 Votes
    22 Posts
    10 Views
    C
    :laugh: :laugh: :laugh: feel sorry for you..
  • a minor horror

    regex learning
    9
    0 Votes
    9 Posts
    3 Views
    C
    guess hes really performance-oriented, not wanting to allocate memory for the eventArgs at actual runtime...
  • Locking horror: Am I going mad?

    question
    7
    0 Votes
    7 Posts
    5 Views
    C
    probably can cut the guy a little slack, at least he didn't locked on 'this' or 'typeof'..
  • OMG a "Goto"

    asp-net com help question
    42
    0 Votes
    42 Posts
    7 Views
    C
    my god, i really thought I wouldn't live to see the day someone actually have the nerve to use the goto statement in C#...
  • A big if

    ruby help
    43
    0 Votes
    43 Posts
    10 Views
    C
    :laugh:
  • Try Catch

    help csharp database com sysadmin
    11
    0 Votes
    11 Posts
    4 Views
    C
    using try-catch blocks on a whole function may be ok in some situation (for example, if function is executed on a thread from the .Net Thread Pool). The reall coding horror here is that the method is more than 200 lines long (can't wait to debug that baby..)
  • C++ Gem

    c++ ruby question
    12
    0 Votes
    12 Posts
    4 Views
    L
    The code works, so this is not a coding horror? I don't see any problem here. Maybe it's just your head. You should get a new one and then look at the code again. Tom Delany wrote: he was forcing sprintf_s This does not mean that he was "forcing" anything.
  • evil hexadecimal numbers formatting

    13
    0 Votes
    13 Posts
    4 Views
    S
    Sure ... and the original code was even worse than that! :) Don't write code: generate it!
  • SQL Server trigger code

    database sql-server sysadmin
    5
    0 Votes
    5 Posts
    3 Views
    P
    Arnaud Lhopiteau wrote: The point is: Why on earth would someone open a cursor on a 1 row set? Not sure. Perhaps it was a rush job at the end of a Friday afternoon and they forgot what they were supposed to be doing? "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
  • variable names - who cares!?

    com game-dev question
    32
    0 Votes
    32 Posts
    7 Views
    L
    Amazing! His friend has a mind like an obfuscator.
  • Code that makes you go "hmmmm"

    testing beta-testing question
    12
    0 Votes
    12 Posts
    8 Views
    N
    There's just one thing that puzzles me about VB6: why are all the OTHER VB6 programmers so bad? I don't use VB6 anymore (when I saw .NET, I never looked back), but I was never this bad -- I wasn't even this bad when I was writing programs in QBASIC! I mean, seriously! So what's with all the amazingly awful VB programmers? It must be a curse.