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
  • Epic comment (Adobe PSD format)

    c++ com adobe architecture
    10
    0 Votes
    10 Posts
    1 Views
    N
    Short and to the point...
  • Count the horrors

    regex
    2
    0 Votes
    2 Posts
    0 Views
    OriginalGriffO
    I think I threw up in my mouth, a little. If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
  • Why do engineers insist on complexity?

    graphics algorithms data-structures question
    25
    0 Votes
    25 Posts
    3 Views
    N
    It really depends on what the "stuff" you do is, but in general I'd go with your solution. BTW, another possibility (stack allocation, just like in your case): std::array data; // Do stuff utf8-cpp
  • Would you like to buy an IsNull ?

    database sql-server sysadmin question
    9
    0 Votes
    9 Posts
    0 Views
    J
    Maybe he wants the code to be ANSI compatible. In which case I would use COALESCE. People say nothing is impossible, but I do nothing every day.
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • Try/catch block...

    32
    0 Votes
    32 Posts
    64 Views
    _
    If you're using Windows, then the file is almost always in use.
  • Happy debugging!

    debugging help csharp java php
    40
    0 Votes
    40 Posts
    3 Views
    N
    hahaha lol... clever idea :D ============================================ The grass is always greener on the other side of the fence
  • 0 Votes
    18 Posts
    2 Views
    N
    :~:~:~ ============================================ The grass is always greener on the other side of the fence
  • Localization is great

    csharp visual-studio devops help question
    2
    0 Votes
    2 Posts
    0 Views
    B
    :doh: OT (Sorta) I am going to be removing CC.NET from my build server and reinstalling Jenkins, then setting up a reverse proxy in IIS to point a URL at the Jenkins instance. I do not like CC.NET very much, but I do like Jenkins. Bob Dole The internet is a great way to get on the net. :doh: 2.0.82.7292 SP6a
  • You will be on board if you answer this...

    question career
    30
    0 Votes
    30 Posts
    5 Views
    J
    rundll32.exe, although there are no guarantees that it will work (depending on the DLL's entry points) -- Kein Mitleid Für Die Mehrheit
  • Loading custom fields from Quickbooks

    sales help
    7
    0 Votes
    7 Posts
    0 Views
    C
    I can do it even better ... Yesterday I found that gem in my own code Boolean deleted = false; if(deleted){ ... } what a great luck I wrote it only five minutes before I observed my supersophisticated State-of-the-art-Failure... :-D :-O
  • Typemock Comic Series #1 - How to Keep Your Code Secure

    com tutorial
    2
    0 Votes
    2 Posts
    0 Views
    0
    It doesn't compile because it's printed on sheets of paper. Then again, you can always try to hold the paper in front of a webcam and press CTR-SHFT-B. .
  • How to conver Date to yyyyMMdd format in SSRS

    sql-server tutorial question
    7
    0 Votes
    7 Posts
    0 Views
    _
    virang_21 wrote: The whole point is why not use Foramt() function... Is that similar to the Format() function? :-D :laugh: Silence is golden... but duct tape is silver!! Booger Mobile - My bright green 1964 Ford Falcon - check out the blog here!! | If you feel generous - make a donation to Camp Quality!!
  • Virus Or Worm?

    help tutorial question
    9
    0 Votes
    9 Posts
    1 Views
    B
    I think it is "Options > Library > Rename music files using rip music settings". Make sure that is unchecked. I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image. Stephen Hawking
  • Trick for young players.

    wpf csharp com architecture
    49
    0 Votes
    49 Posts
    0 Views
    L
    2 answers 1. The problem is that it is easy to be misled about what is happening in this sort of circumstance; Bearing in mind that, in the real world, the 'contains' code would be in a method that simply has a collection of objects as its parameter (so it's not obvious what values may be in those objects). If you are just saying that you would never be fooled by something like 'contains' finding some objects and not others, then I bow to your superior intellect. Oh, and the newbies being surprised thing is just off topic. I am certain that many a newbie (and quite a few oldies)_ would be fooled by the 'contains' issue with a mixture of objects, some of which are value and some reference, ESPECIALLY as the issue (in the case identified in some of my other responses) rears its head only when the values of two arguments happens to be equal - which leads to an irregular failure of a part of the framework. 2. Are you referring to 'a trick for young players'? If so, maybe this is an Aussie phrase. It means 'something to beware of for the inexperienced' MVVM# - See how I did MVVM my way ___________________________________________ Man, you're a god. - walterhevedeich 26/05/2011 .\\axxx (That's an 'M')
  • The occasional flash of brilliance

    csharp com adobe algorithms tools
    17
    0 Votes
    17 Posts
    0 Views
    M
    Seems like some nigerian jerks are trying to downvote your post :laugh:
  • Now this is embarassing

    45
    0 Votes
    45 Posts
    2 Views
    M
    It 's OK to code like this It was supposed to various _Uptime get the instance in the "{ xxx }" :-D :-D
  • Is silly bad?

    help question
    16
    0 Votes
    16 Posts
    2 Views
    M
    I've seen the following written by people who've been programming for over 25 years. Not everyone understands terse code. Even less understand what macros were originally made for. bool flag; if (a > b) flag = true; else flag = false;
  • 0 Votes
    12 Posts
    0 Views
    G
    For some inexplicable reason, that makes it worse. Software Zen: delete this;
  • Bug of the day

    c++ architecture help
    12
    0 Votes
    12 Posts
    0 Views
    J
    I always call a specific databinding method. Exactly because of the confusion it could cause, experienced first hand from code that I took over on one of my supported systems.