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
  • Out of memory? Keep going!

    csharp performance question
    11
    0 Votes
    11 Posts
    63 Views
    S
    :laugh::laugh: Regards, Satips.:rose: Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Walk beside me, and just be my friend. - Albert Camus
  • almost messed up..

    5
    0 Votes
    5 Posts
    27 Views
    S
    :-D Regards, Satips.:rose: Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Walk beside me, and just be my friend. - Albert Camus
  • A simple one...

    c++
    10
    0 Votes
    10 Posts
    76 Views
    G
    No... --- single minded; short sighted; long gone;
  • Not really a coding horror,

    com tools architecture tutorial
    14
    0 Votes
    14 Posts
    116 Views
    V
    I agree he misunderstood my post, but there wasn't any sarcasm in there. :~ In case you don't understand, those two blokes are Pakistanis (the country code is 92). Most Pakistanis speak Urdu, which is just a b-dized version of Hindi. Cheers, Vıkram. After all is said and done, much is said and little is done.
  • Insert a quote into a @-quoted string literal [modified]

    8
    0 Votes
    8 Posts
    54 Views
    F
    Placing an "@" does not produce any error for line break. e.g. the following code would produce an error. string x = "Blah blah blah" + Convert.Tochar(37) .ToString(); But the following would not string x = @"Blah blah blah" + Convert.Tochar(37) .ToString(); (I am writing this without testing. So feel free to let me know if I am wrong.)
  • For loop

    60
    0 Votes
    60 Posts
    649 Views
    S
    Then what is the use of computer? Computer should calculate 7*2 = 14 :laugh::laugh::laugh: Regards, Sylvester G sylvester_g_m@yahoo.com
  • Brings back memories [modified]

    20
    0 Votes
    20 Posts
    116 Views
    D
    OMFG ! :laugh: Did his manager review ANY of his work ? Je vous salue du Québec !
  • This is just beautiful!

    7
    0 Votes
    7 Posts
    50 Views
    S
    = is more faster than !=..thats why:):-D Regards, Sylvester G sylvester_g_m@yahoo.com
  • Reusable Code

    csharp
    8
    0 Votes
    8 Posts
    53 Views
    S
    Very nice resusable code Regards, Sylvester G sylvester_g_m@yahoo.com
  • Why do some people code at all?

    question
    16
    0 Votes
    16 Posts
    99 Views
    S
    Think differently means this is the one. Regards, Sylvester G sylvester_g_m@yahoo.com
  • Formatting a "yyyyMMdd" string to "yyyy-MM-dd" in C#

    csharp
    9
    0 Votes
    9 Posts
    47 Views
    S
    Superb HORROR Regards, Sylvester G sylvester_g_m@yahoo.com
  • For loops and array

    c++ data-structures
    22
    0 Votes
    22 Posts
    189 Views
    S
    Oh My God, Please visit this Great Horror Regards, Sylvester G sylvester_g_m@yahoo.com
  • Ha ha

    question
    14
    0 Votes
    14 Posts
    86 Views
    S
    When it will not execute? Answer is a = 10 and a = 11 Regards, Sylvester G sylvester_g_m@yahoo.com
  • Empty catches’ blocks

    help database debugging sales tutorial
    23
    0 Votes
    23 Posts
    271 Views
    F
    Yeah, and try something like this: protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); try { int zero = 0; int one = 1; int exception = one / zero; } catch { throw new InvalidOperationException(); } } Let's say the exception is done by a third part plugin, so you can't control it. Want you try to catch it in the Application.ThreadException event? Ok, try it! ;) Not all scenarios allow you to fill the catch block. free .net reporting and gdi+ tools www.neodatatype.net
  • Obviously

    csharp ruby html visual-studio wpf
    8
    0 Votes
    8 Posts
    39 Views
    P
    Maybe it means, "is empty to the untrained eye, but we know it's really not"?
  • Bet this algorithm never occured to anyone...

    algorithms
    31
    0 Votes
    31 Posts
    243 Views
    B
    Slick. Now if I could only hack into my girlfriend's brain and override her IsHorny function with this algo, life would be good. "Half this game is ninety percent mental." - Yogi Berra If you can read thank a teacher, if you can read in English, thank a Marine.
  • Vintage code

    hardware
    10
    0 Votes
    10 Posts
    38 Views
    S
    I would have done it in binary like so: 1101010101001101110010100111010101010011011100101001 1010101010011011100101001110101010100110111001010010 0101010100110111001010011101010101001101110010100110 1101010101001101110010100111010101010011011100100101 1101010101001101110010100111010101010011011100101001 That way there's less confusion There are 10 types of people in the world, those who understand binary and those who dont.
  • "Clever" classic VB trick

    csharp debugging help question
    4
    0 Votes
    4 Posts
    36 Views
    A
    try creating a usercontrol, and put that control on a form. that method isnt very reliable as you will see. :badger:
  • which one is faster and better coding

    com
    19
    0 Votes
    19 Posts
    39 Views
    D
    There's usually an unroll-loop option in most compilers.
  • 0 Votes
    4 Posts
    23 Views
    J
    I know this routine… decipher, decouple, rewrite (portions), and etcetera. Then may be you can make a minor change without breaking something else. Remember this mantra: “Life is wonderful”, just keep repeating through your gritted teeth until your jaw unclenches and you can concentrate once more. INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra