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
  • Javascript sleep

    javascript com
    5
    0 Votes
    5 Posts
    0 Views
    J
    :omg: yeah :) Jeroen De Dauw Blog ; Wiki
  • Comparison and goto

    ruby tutorial question learning
    7
    0 Votes
    7 Posts
    0 Views
    H
    OriginalGriff wrote: If TextBox9.Text > TextBox8.Text Then GoTo bob Else : TextBox9.Text = TextBox8.Text End If Bob: What I get out of this is that your real name is 'bob'. Wherein lies the mystery?
  • Glitch

    question
    11
    0 Votes
    11 Posts
    0 Views
    V
    :)
  • May be bad code or May not be!!!

    help
    28
    0 Votes
    28 Posts
    1 Views
    L
    The variables A, B, C may be equal at some point in time, they also are variables, hence their value can change. See also here[^]. :) Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
  • Making sure something is really true.....

    8
    0 Votes
    8 Posts
    0 Views
    T
    there is an obvious flaw in this code, it should read like: if (Status == "something") { randomValue = true; } else if (Status != "something") { randomValue = true; } else { randomValue = true; }
  • Please laugh at me so I never do this again...

    14
    0 Votes
    14 Posts
    1 Views
    T
    an elegant solution would be to put the controls in question into a dedicated collection and iterate over this
  • There is no Spoon

    csharp visual-studio com data-structures
    5
    0 Votes
    5 Posts
    0 Views
    F
    I suppose you can't break anything if you don't change anything or do anything. Sounds like JSL to me. I wasn't, now I am, then I won't be anymore.
  • Useful code comments [modified]

    10
    0 Votes
    10 Posts
    1 Views
    S
    a) the comment is inaccurate -- the worst kind b) a comment on this statement is entirely unnecessary c) as someone else mentioned, the statement it comments uses a magic number. Defining it as a constant might also provide the explanation that this comment fails to provide. d) than/then confusion: one of my pet peeves. Contains coding, but not narcotic.
  • 0 Votes
    12 Posts
    0 Views
    J
    In near future Google is planning to give space to save your code online. But your own project related code and documents, you have to maintain in your local server (TFS, VSS etc...), they are providing security. -- Rushi
  • The "best" way ever to compare two dates...

    csharp
    2
    0 Votes
    2 Posts
    0 Views
    B
    I have seen some pretty bad ways to compare date, but that is surely one of the worst! X| Just because the code works, it doesn't mean that it is good code.
  • Brilliant Logic

    javascript
    17
    0 Votes
    17 Posts
    1 Views
    R
    and thats why they can't (designers(can't code)). Excuse the pun. "Program testing can be used to show the presence of bugs, but never to show their absence." << please vote!! >> modified on Tuesday, May 10, 2011 4:14 AM
  • Why oh why???

    question
    9
    0 Votes
    9 Posts
    0 Views
    P
    Both code goes to the category of Hall of Shame? :wtf:
  • Austin Danger Powers

    38
    0 Votes
    38 Posts
    2 Views
    B
    The multiple names is not SOOO uncommon here in the U.S.A. anymore either. The nanas were arguing about the middle name for our second daugher, so we just gave her "Amber Ann" as the middle name!
  • The mysteriously deleted file

    help hardware question announcement
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    10 Posts
    0 Views
    C
    I agree but I think there is a limit to this. You can tell when someone is tossing the effort of learning over the fence but you have to understand people have different learning styles. Reading documentation doesn't work for everyone, hence pod casts and training videos. Pair programming combines visual and auditory information exchange that help to reinforce concepts and methods. Basically what I'm saying is, not everyone is on YOUR level of expertise and they may not learn the same way you do, so don't be a dick and use RTFM as your catch-all for swatting away social interactions. That dumb ass that wants you to show them what a SQL insert looks like for the 4th time will probably get promoted to product manager. :)
  • I vomitted

    help
    13
    0 Votes
    13 Posts
    0 Views
    C
    My wife has a secret recipe for Hawaiian Pineapple Burgers. The patty has a round slice of pineapple placed on top of it and partially squeezed into the patty. It is then wrapped completely around in an X pattern with two slices of bacon. The patties are then placed in a 'special' marinade for about 12 to 14 hours. And then you cook them. You can then garnish the burger with anything you like, 'cause as you know, anything goes with bacon. These burgers are the moistest I've ever eaten. :) 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]
  • Angry example

    c++ visual-studio com tutorial
    7
    0 Votes
    7 Posts
    0 Views
    V
    It's definitely not a clever code. Somebody smokes joint too often. :)
  • The "fresco"

    javascript tutorial
    13
    0 Votes
    13 Posts
    0 Views
    B
    Hi Bruno, Clearly this programmer is using "fresco" as a code-word for "obfuscatore al dente." best, Bill "Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
  • I frequently type un-compilable code or comments to myself...

    discussion
    13
    0 Votes
    13 Posts
    0 Views
    B
    Yes, the method names should be descriptive. In my experience the ones who don't use descriptive method names also don't bother to write good comments. Also, sometimes, even a good method name can use a little extra description now and then. ;) :) Just because the code works, it doesn't mean that it is good code.
  • 0 Votes
    7 Posts
    0 Views
    D
    I wonder what will happen when //do some stuff here throws an exception??? ;-)