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
  • 0 Votes
    4 Posts
    0 Views
    R
    Well, Order By is of some use, even in views. But it should ALWAYS be paired with a TOP(X). SELECT TOP 100 PERCENT * FROM Somewhere ORDER BY whatever is a true, classic, horror.
  • Do you want string or string?

    testing beta-testing question
    19
    0 Votes
    19 Posts
    2 Views
    B
    Maybe he was thinking of the 'String' theory! Yeah, I know, it's a groaner. Attempting to load signature... A NullSignatureException was unhandled. Message: "No signature exists"
  • 0 Votes
    3 Posts
    0 Views
    OriginalGriffO
    Gary R. Wheeler wrote: ObjectServiceFactoryServiceObjectAutomationLinkFactoryServiceFactoryObjectMetaObjectBuilderFactory. You forgot "GoldProTeamEdition"... Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
  • Let me rant

    wpf csharp wcf design help
    5
    0 Votes
    5 Posts
    0 Views
    G
    Back in school I once spent two days and several hours debugging a problem caused by an 'h' that was supposed to be a 'b', and vice versa. Software Zen: delete this;
  • My First Post Of Shame - ReturnFalse()?

    javascript question
    12
    0 Votes
    12 Posts
    2 Views
    K
    I think it would be less misleading if the ReturnFalse function was instead named AbortAction or something closer to the intention. I think it is better practise to name a function or method for it's intended purpose or meaning than for what it literally does. The intention/meaning and what the method actually does usually are the same, but there can be subtle differences and occasionally vast differences such as in this case. Oh and a comment for the function would not go amiss either: //This function is used to suppress events such as onclick function AbortAction() { return false; }
  • app as an object name

    lounge sales help question
    10
    0 Votes
    10 Posts
    0 Views
    K
    Exactly! (and thanks for posting!) I was wondering how I could even declare app as a Crystal Report Application object to begin with. Turns out it works fine and was not the cause of our problems. The problem was corrected by using late binding on the Crystal App object. "Go forth into the source" - Neal Morse
  • v

    2
    0 Votes
    2 Posts
    0 Views
    C
    Let me be the first to congratulate you. Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
  • Linq2Horror

    csharp database linq question discussion
    20
    0 Votes
    20 Posts
    38 Views
    R
    Ok I get it. Better to totally stuff it up once and then exclude that revision than watch it slowly get worse and worse. I remember the first time I bumped into this. Started work at a new place, committed some changes and about 10 minutes later, someone comes up and asks me to change options to tabs. 10 minutes!... damn code Nazis. :) "You get that on the big jobs."
  • N-Tier architecture

    csharp database wcf design architecture
    10
    0 Votes
    10 Posts
    0 Views
    L
    A good candidate for that would be the data object itself. Just to take another example than simple validation: Let's say we have the common case that we need to store a password, which should be salted and hashed for security reasons. Why not put the method to do that into the data object? This way it can be ensured that the salting and hashing is done every time the password field of the data object is set. And this method can also be called to hash the string entered during login and then compare it to the value stored in the data object. This may be contrary to the dogma that data objects are supposed to be simple containers for the data only, but in object oriented design it makes sense when an object has methods or properties to validate its state or make changes to its state. I'm invincible, I can't be vinced
  • Format string to string

    ruby code-review
    4
    0 Votes
    4 Posts
    0 Views
    S
    Honestly, no matter how bad or well written it is, all objective C code looks like a coding horror to me. But I suppose this looks worse then most.
  • Unsafe locking

    tutorial discussion announcement
    7
    0 Votes
    7 Posts
    1 Views
    G
    don't forget to check that your current process owns the lock after setting it - another process may have locked it between you checking if its locked and you locking it
  • ISP hacked

    com tutorial
    44
    0 Votes
    44 Posts
    4 Views
    J
    One free interwebs, you just won it! :) Jeroen De Dauw (blog | Twitter | Identi.ca)
  • Thousands of links using...

    html help
    5
    0 Votes
    5 Posts
    0 Views
    M
    Haha, I remember one government site. That entire site was developed in the local windows based PC and when they upload it to the linux server all the freaking path was absolute "C:/Program Files/PHP/WWW/....." Mentally disorder will do better work than that one
  • 9000 lines of ...

    csharp asp-net json question
    16
    0 Votes
    16 Posts
    0 Views
    T
    I hate when the boss is a complete idiot
  • Silly SQL

    database question
    5
    0 Votes
    5 Posts
    1 Views
    A
    The bad practice is failing to write the statement explicitly. Why change MONTH when it's meant to be 'month'? The shame is not using "SELECT B.[MONTH] + MONTH..." Yet, even that is minor.
  • reviewing old code

    18
    0 Votes
    18 Posts
    0 Views
    K
    How about?: protected void Page_Load(object sender, EventArgs e) { List Stuff = new List(); do { foreach (Node thing in Node.GetCurrent().Children) Stuff.Add(thing); } while (Stuff.Count < 100 && Stuff.Count > 0)) Stuff = ShuffleNodeList(Stuff); }
  • Straight from the horse's mouth

    tutorial question career
    35
    0 Votes
    35 Posts
    6 Views
    P
    5 stars... that made me laugh.
  • Changes goes whong

    question
    10
    0 Votes
    10 Posts
    0 Views
    B
    :laugh:
  • An issue got finally fixed

    visual-studio com beta-testing help code-review
    4
    0 Votes
    4 Posts
    0 Views
    R
    I would say that not being able to use VS2010 until I installed the hotfix after installing SP1 is "important" This articles discusses it as well http://visualstudiomagazine.com/articles/2011/03/11/developers-react-to-visual-studio-2010-sp1.aspx[^] Also, I find it very frustrating that on a daily basis VS2010 runs out of memory and I to close and reopen my solutions. Also, there is still a known bug when queueing builds on build servers if you have more than one build server.
  • Definition of 100% sure

    3
    0 Votes
    3 Posts
    0 Views
    M
    its a programming forum dude, even though its a shame