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
  • One instance of an application [modified]

    database csharp linq business collaboration
    32
    0 Votes
    32 Posts
    4 Views
    B
    There is no way you are going to change this guy. The only reasonable option is to get out of there as soon as you can. I'm glad to hear that you are starting your own company, hopfully you will be able to make that your full time job soon. :) Bill W Just because the code works, it doesn't mean that it is good code.
  • Wonderful description strings!

    com debugging tools help question
    5
    0 Votes
    5 Posts
    1 Views
    B
    Having been there myself many times I understand that at crunch time error messages get minimal consideration. But if there is time to write "Something is really wrong!" surely there is time to write an error message that is a wee bit more helpful. :| Bill W Just because the code works, it doesn't mean that it is good code.
  • Just a MessageBox :S [modified]

    csharp asp-net sysadmin help tutorial
    5
    0 Votes
    5 Posts
    0 Views
    B
    If it is intended for use in production code it is a real horror. If it is just a diagnostic messagebox that will be removed for production code then it is not too bad; the programmer has to be sure to remove it though ;) Just because the code works, it doesn't mean that it is good code.
  • Try to find something dumber if you can...

    database
    9
    0 Votes
    9 Posts
    0 Views
    E
    I reserve my judgment and give the title idiot sparingly and in this case the person is truly an idiot (and no, he's had 10+ years of dev experience). If you had seen the code he wrote you would agree too. "A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson "Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin Edbert Sydney, Australia
  • Exceptional coding

    com regex
    19
    0 Votes
    19 Posts
    1 Views
    J
    Why would you assume that? "God doesn't play dice" - Albert Einstein "God not only plays dice, He sometimes throws the dices where they cannot be seen" - Niels Bohr
  • Not a horror, but still ugly

    question help
    4
    0 Votes
    4 Posts
    2 Views
    S
    My thoughts exactly. If there were more developers with your kind of humility it would make the rest of our jobs much easier. Thanks
  • how not to check a login [modified]

    announcement security regex help
    17
    0 Votes
    17 Posts
    1 Views
    V
    And remind him he was drinking poison... It feels good to learn and achieve
  • Enumerate Websites in Vista

    linux
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • A Junior Developer Learns that Seniority Doesn't Mean Smarter

    csharp com question
    7
    0 Votes
    7 Posts
    0 Views
    R
    or the ricers who duct tape a coffee can to the muffler of their Civic. :rolleyes:
  • 0 Votes
    2 Posts
    1 Views
    C
    But the code works so well! :) This statement is false.
  • Sith Interviewing Tactics [modified]

    csharp career com graphics algorithms
    74
    0 Votes
    74 Posts
    2 Views
    E
    What I do is keep crib notes of basic algorithms in my notebook in case they ask you to do one. With the iPhone, you can keep electronic notes of the same things and review them while waiting for the interview to start. :-D
  • How to check less then / greater then

    css com game-dev tools tutorial
    11
    0 Votes
    11 Posts
    0 Views
    P
    This is my five cents ;-) if(guess == random || guess != random)
  • A piece of ... Art

    database
    15
    0 Votes
    15 Posts
    1 Views
    P
    This table design could be used to reduce the size of a database and improve manageability that contains unknown/highly dynamic structures I will make an assumption (the only one in this post) and say this project deals with loading structures that change frequently. Could be wrong and be looking at a noob's 'work of art' There are three approaches for highly dynamic structural data: 1. Dynamically create the schema's based on external blue-prints, giving real names to columns. This might not be the best solution for a few subtle reasons which have to do with the degree of knowledge by the end-user's of the database and any planned api's or DAL's. Generating the dynamic schema prior to loading data can be done in two modes: 1. immediately, where new un-generated schemas are encountered and have to be generated on the spot. This presents an obvious problem if you have multiple clients performing the imports for a single database (similar to SETI). Such as, what if two clients encounter the same type of schema that isn't in the database yet, only one schema should be generated. 2. Delayed, where after loading many imports and discovering that some new files failed to match any current dynamic schema, the database user can manually kick off schema generation and then attempt a reload of those files that failed earlier. 2. Contain the all the data into a single table (or a table for each datatype) with four columns (ImportFileId, RowId[original structure's], ParameterName, ParameterValue). This solution gobbles up WAY MORE disk space (more than doubles the space requirement of the solution given above as well as in #1 (In oracle, at least, the remaining columns that are null take up no space.) This is considered serializing the data, also could be called demuxing. 3. Then there is the solution above. The only requirement is that any API must map the ImportFileId to some blue-print of the columns involved. This solution saves much more space than #2 AND has the added benefit of simplicity on the database up-keep side (ie. no schema generation prior to import) I've been down this road dealing with a database with over 400,000 actual unique fields of data. We actually used option #1 for good reason. So, I wouldn't knock it just because it's different.
  • 0 Votes
    11 Posts
    1 Views
    P
    You might not have seen the post before it was deleted. Why it was? I don't know. The fellow wrote ABOUT a question in the c# forum (NOT THIS ONE). There were no rules broken on posting procedure.
  • Well verified code

    11
    0 Votes
    11 Posts
    0 Views
    L
    Super Lloyd wrote: Admittedly it does slow down the program a bit Yup. Don't even try to use it in a loop... Greetings - Jacek
  • A small Horror

    csharp question data-structures lounge
    10
    0 Votes
    10 Posts
    0 Views
    K
    omgz my new backround and screen saver image ;P
  • Refresh a list view... when ever new file comes into folder

    csharp winforms
    4
    0 Votes
    4 Posts
    0 Views
    F
    That would be the first person that admit first and then code. :laugh: I thought of pointing out something like that, but since the sun is shining and I am in a good mood. I didn't wan't to be cruel. Cheers You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
  • Quantity, not quality

    debugging
    15
    0 Votes
    15 Posts
    0 Views
    J
    Wow! That literally hurt my eyes. :wtf: Unfortunately I have seen similar code for text processing. You have to keep scrolling back up a hundred lines or so to find out where the value stored in that variable came from and just what the heck it is supposed to be; of course it was probably modified on the way down – loads of fun. :rolleyes: INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
  • From the C# forum

    help csharp com data-structures tools
    11
    0 Votes
    11 Posts
    1 Views
    C
    I think, this code is a result of Reflector disassembling :-D
  • Quantity FTW!

    announcement database sql-server tools help
    6
    0 Votes
    6 Posts
    1 Views
    J
    Whoa.. It didn't even optimize the literals when it was compiled? Did someone forget to turn on the optimizer? :~ -- Kein Mitleid Für Die Mehrheit