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
  • got another codebase to work on... its full of surprises!!!

    question
    18
    0 Votes
    18 Posts
    0 Views
    B
    In Java it is package-visible (pretty close to internal) ... and bizarrely, there is no explicit way to specify this access level!
  • Back In The Day

    database wpf csharp css com
    5
    0 Votes
    5 Posts
    0 Views
    L
    My first house was bought in the UK and cost me 17,000 sterling as I recall. and no, it wasn't wattle and daub, or a dug-out cave. it was a pleasant terraced house close to the sea front in sunny Worthing * * anyone who knows worthing will try to tell you it is not only not sunny, but also inhabited generally by the elderly, smells of seaweed, has some of the most stoney beaches on the English coast, and is generally the place people go to to live out their remaining years. This is true, and goes a long way toward explaining the cost of housing there. MVVM# - See how I did MVVM my way ___________________________________________ Man, you're a god. - walterhevedeich 26/05/2011 .\\axxx (That's an 'M')
  • Mamas, Don't Let Your Babies Grow Up to be Coders

    html database com collaboration
    2
    0 Votes
    2 Posts
    0 Views
    G
    :thumbsup: Common sense is not a gift it's a curse. Those of us who have it have to deal with those that don't.... Be careful which toes you step on today, they might be connected to the foot that kicks your butt tomorrow. You can't scare me, I have children.
  • Yeah I did it...

    com
    3
    0 Votes
    3 Posts
    0 Views
    P
    Ew, yuck, misuse of var, how could you? :-D
  • Search Query: My Boss is a Genius

    database css sql-server com design
    4
    0 Votes
    4 Posts
    0 Views
    A
    It was a bit of a simplification. Some are real words, some are codes (without spaces), and often people will type "word1 word2" expecting a result that contains those words in that order. And there are some special characters that they may or may not type in, so I'll probably also have alternate versions without those characters they can search too. I'll probably take the custom approach rather than the full text indexing, as I'm not sure it would be able to handle the fringe scenarios we want to support. But yeah. Sure am glad I didn't resort to a table with 72 columns (or worse, 72 tables). :) Thou mewling ill-breeding pignut!
  • I hate outsourcing...

    csharp dotnet question announcement career
    12
    0 Votes
    12 Posts
    0 Views
    R
    MUMPS server, now I feel a little ill X| Rhys "Technological progress is like an axe in the hands of a pathological criminal" "Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe"
  • This probably falls into the 'weird' category

    question help
    4
    0 Votes
    4 Posts
    0 Views
    L
    Hey, you can read his twisted mind! Would you please come over and help me with making sense of the rest of this mess? You are right. He tries to tell us that the application directory is not there. The program runs on a mobile device and tries to get the latest version of itself when the device is docked. My friend here just could not figure out how a program that is currently running can update itself. Now, how can it possibly happen that the application directory is not there when the application itself is obviously running at that moment? He is trying to prevent an impossible error. He is like the coyote when he builds another roadrunner trap. Everybody but him can see how it is going to end. And when it explodes in his face, he can't figure out why. Instead he simply wraps the problematic code in a 'try' and leaves the catch block empty. Nothing has happened, let's just go on with it. This time he at least tried to show some error message, but of course not without making a mess out of that simple task. I have written it before: Tar him, feather him, throw him out of the guild and then chase him out of town. At least artificial intelligence already is superior to natural stupidity
  • Now I know...

    wcf xml
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Apparently there is no limit to naming conventions for method

    36
    0 Votes
    36 Posts
    4 Views
    B
    In several languages. Bill Gates is a very rich man today... and do you want to know why? The answer is one word: versions. Dave Barry Read more at [BrainyQuote](http://www.brainyquote.com/quotes/topics topic_technology.html#yAfSEbrfumitrteO.99)[^]
  • I hope this is not contagious...

    json
    13
    0 Votes
    13 Posts
    4 Views
    B
    No problem. Bill Gates is a very rich man today... and do you want to know why? The answer is one word: versions. Dave Barry Read more at [BrainyQuote](http://www.brainyquote.com/quotes/topics topic_technology.html#yAfSEbrfumitrteO.99)[^]
  • String Comparison

    code-review
    10
    0 Votes
    10 Posts
    3 Views
    V
    I always wonder: why after many, many, many years people just can't learn to use caseless string comparison methods? I constantly see shit like this. Caseless comparison methods existed even in good old plain C. Damn, is it really that hard to master primitive things like this: if (String.Compare(name, "CamelCasedName", true) == 0) {...} ? In the end, it's not Lebesgue integration, right? Those, who ever had the "pleasure" to be familiar with functional analysis, know :) .
  • Small & Usefull..

    com
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    2 Posts
    0 Views
    _
    Hi, Woppelmann P wrote: Now you can easily derive a BusinessObject This idea of deriving business object is fantastic. You should use this idea as a new article. The user's will come to know about this. This is not the right place of this kind of ideas. You can refer Here[^] for articles and tips. Warm Regards. --Amit
  • Imma Switch, Imma Switch, Imma Imma Imma Switch

    database com regex
    2
    0 Votes
    2 Posts
    0 Views
    B
    :doh: Some people just should not be allowed near a computer. public class SysAdmin : Employee { public override void DoWork(IWorkItem workItem) { if (workItem.User.Type == UserType.NoLearn){ throw new NoIWillNotFixYourComputerException(new Luser(workItem.User)); }else{ base.DoWork(workItem); } } }
  • Set selected value...

    tutorial csharp asp-net com sysadmin
    8
    0 Votes
    8 Posts
    0 Views
    S
    Don't ask. I have no idea how this default condition was thought of! :doh: Sandeep Mewara [My last article]: Server side Delimiters in ASP.NET[^]
  • Special Case

    37
    0 Votes
    37 Posts
    5 Views
    L
    Interesting. Thank you for the informative response.
  • dataTables to to gridView

    question
    3
    0 Votes
    3 Posts
    0 Views
    Z
    He was just putting the DataTables off to the side in case he needed them later. You never know when you might need a good DataTable again. :) There are only 10 types of people in the world, those who understand binary and those who don't.
  • Why String.Format?

    question
    14
    0 Votes
    14 Posts
    0 Views
    R
    Tell the original developer to use this StringBuilder sb = new StringBuilder(); sb.Append(string.empty); sb.Append(funcThatReturnsAString()); sb.Append(string.empty); value = sb.ToString(); Tell him this is the standard way of doing this kind of stuff :laugh: Every now and then say, "What the Elephant." "What the Elephant" gives you freedom. Freedom brings opportunity. Opportunity makes your future.
  • Invalid TimeZone. Please Move.

    announcement
    10
    0 Votes
    10 Posts
    0 Views
    J
    If it builds, ship it.
  • Why use String.Concat() ?

    question
    7
    0 Votes
    7 Posts
    0 Views
    K
    If you've read anything about strings, you must have read that you should use StringBuilder instead. "some text" + "some more" + " text" is expensive. I would guess Concat gives you a performance boost similar to StringBuilder, but limited to strings. I have to admit that appending each value individually in builder is bothersome. I know I wanted to find out how much builder helps, so I built a cpu intensive process with accounting numbers. I mixed fixed text with numbers to a string using + logic. Got the actual coding to work and changed over to StringBuilder. Processing went from 40 minutes to 20 minutes. Then I changed the logic to only use builder when I needed to save the stat strings. Cut down to 7 minutes. Then played with the process order and it went to 4 minutes. Needed to buy my second laptop in 7 years to cut it to 2 minutes. :)