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
  • if I don't exist OR ....

    csharp
    12
    0 Votes
    12 Posts
    24 Views
    P
    Luc Pattyn wrote: not being fluent in VB.NET does that to people; I'm not fluent, and that doesn't make me feel inferior. Conclusion? I'm not people. Wow, that was easy ;) In case you missed it, I meant the language (not you) expresses its inferiority complex with "me is nothing" We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighist
  • The Useful DLL

    question
    16
    0 Votes
    16 Posts
    22 Views
    V
    Thats exactly what I've been saying all along. The class is in assembly by itself and there are no friend assemblies declared. There are no static members either. I'm not an expert in C# but to me that makes no sense whatsoever. Also, in the example you gave, you did create an instance of TextBuffer, and by the way, you have to declare buffer (lowercase 'b') somewhere or you'll get a compiler error.
  • Real coding horror... by me! :)

    tutorial c++ com
    9
    0 Votes
    9 Posts
    35 Views
    J
    The quote in my sig? Yes, the guy who made the comment made it as a joke. The joke isn't about all Indians. Take a look around the forums for a day or 2 and you will see that there are some bad apples. I'm going to become rich when I create a device that allows me to punch people in the face over the internet. "If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
  • WTF @ TheDailyWTF

    php css visual-studio com
    6
    0 Votes
    6 Posts
    24 Views
    J
    At least someone here has a hammer he *really* knows how to use. And obviously he has no trouble to find enough nails for it... Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
  • Report Formatting??

    help question
    3
    0 Votes
    3 Posts
    3 Views
    P
    That's a problem if you do code reviews as a piece of review work. It's much better to do code reviews regularly and give instant feedback - it's the best way to stamp out bad practices before they become bad habits. Deja View - the feeling that you've seen this post before. My blog | My articles
  • Horror people

    csharp question
    19
    0 Votes
    19 Posts
    53 Views
    S
    Give them a few compliments and new programmers will be born? What, no dinner first?
  • Seems familiar?

    database question
    10
    0 Votes
    10 Posts
    17 Views
    S
    The split(string, delim) function from earlier VB versions is still available and accepts multi-character delimiter parameters.
  • how to know the job retention capabilities of printer

    c++ help tutorial career
    13
    0 Votes
    13 Posts
    3 Views
    R
    …you just keep feeding us with evidence that you're an idiot. You know posting it here means nobody will help you at all. ROFLOLMFAO
  • Keeping the server busy

    com sysadmin
    8
    0 Votes
    8 Posts
    20 Views
    P
    Vasudevan Deepak K wrote: something in Unix DOS and OpenVMS also have null devices.
  • Pessimistic Development

    csharp dotnet com sysadmin question
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Int? What's "int"?

    csharp ruby html asp-net wpf
    6
    0 Votes
    6 Posts
    2 Views
    J
    What's a three fer? ;)
  • T-SQL Jewel

    database help com performance
    5
    0 Votes
    5 Posts
    10 Views
    P
    Mark J. Miller wrote: No body is around Well hidden I suspect.
  • Zoom and pan an image

    csharp asp-net tutorial question
    7
    0 Votes
    7 Posts
    18 Views
    L
    s_mon wrote: (yes|no|maybe)* Maybe
  • Java Memory Management

    java question design data-structures performance
    8
    0 Votes
    8 Posts
    12 Views
    D
    That is indeed what Tess is saying, but she also says "that is what happens when you get an OutOfMemoryException". The other party claims the garbage collector will perform defragmentation (which is part of garbage collection, after all) before throwing OutOfMemoryException, and if that is true you wouldn't get OOM as long as the new allocation requires less than total free memory. If so, the only time you should get the exception should be when the live objects are pinned. (Very large objects are said to be "pinned" because they are never moved in defragmentation due to the hard work it would be moving such big objects around.) I guess if you want very much to conclude that they both are right you could assume Tess was talking about pinned objects, but that is a rather contrived way of getting there, and I frankly don't see the point. For me the important thing isn't who is right but what the fact is. And that is unfortunately still no more clear for me.
  • Professional conditions with IF

    csharp help question
    26
    0 Votes
    26 Posts
    2 Views
    T
    Buttmunch Silence is the voice of complicity. Strange women lying in ponds distributing swords is no basis for a system of government. -- monty python Might I suggest that the universe was always the size of the cosmos. It is just that at one point the cosmos was the size of a marble. -- Colin Angus Mackay
  • A blatant and reckless use of .NET Cache

    csharp com windows-admin performance question
    7
    0 Votes
    7 Posts
    26 Views
    J
    I cant tell you how many of these ive cleaned up in recent months: if(HttpContext.Current.Cache["someKey"] != null) { SomeClass someClass = (SomeClass)HttpContext.Current.Cache["someKey"]; // do something with someClass instance } The problem being that occasionaly the cache item is expired between lines 1 & 2 leading to rather hard to spot null instance exceptions when trying to use someClass.
  • javascript-professionals

    javascript com
    3
    0 Votes
    3 Posts
    4 Views
    P
    PIEBALDconsult wrote: The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach." Yes, very true. "I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
  • An XSLT version of an old favourite

    xml announcement
    8
    0 Votes
    8 Posts
    24 Views
    S
    Doc Lobster wrote: People tend to put the whole application into one file (doesn't matter if it got 10.000 lines), do not properly group things, use copy & paste and the rest is done by the overhead of tags and symbols through XML. Ouch. Well, slap 'em around a bit. There's just no excuse for that.
  • Childhood coding

    game-dev question
    10
    0 Votes
    10 Posts
    2 Views
    X
    Tak wrote: if not rect.PointInRect(point) or control.IsDisabled() then DoNothing() else ... # Some real code here endif I think you knew more about programming than you realized. You were obviously thinking about future extensions and nice features you could add within the DoNothing function. I bet if you had to continue to work on the game today you would be happy the handy DoNothing you put there many years ago. And people would be wondering, how could someone be so brilliant when he was only 14 or 15? :-D My .NET Business Application Framework My Home Page
  • Premature Disposal

    csharp
    9
    0 Votes
    9 Posts
    28 Views
    T
    uh, no, it should be Console.WriteLine("{0}", arg); (The string.format("{0}", arg) is superflous. The reason to use the format specifier is that arg may itself contain formatting directives such as {0}. Silence is the voice of complicity. Strange women lying in ponds distributing swords is no basis for a system of government. -- monty python Might I suggest that the universe was always the size of the cosmos. It is just that at one point the cosmos was the size of a marble. -- Colin Angus Mackay