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
  • Links show open-save dialog box

    html help question
    6
    0 Votes
    6 Posts
    31 Views
    D
    There is almost certainly an infinity of things you did wrong. Among them: Posting to this forum.
  • typeof(string)? Meh.

    csharp visual-studio com graphics performance
    15
    0 Votes
    15 Posts
    93 Views
    D
    I believe the typeof(T) operator is resolved at compile-time. Thus when you speak of how long "typeof took" you are really only measuring the time spent to loop, increment and check loop variable, and perform the assignment. The MSDN documentation does make a distinction between types in general and the type objects that represent types (and which are, of course, themselves types). For example, the reference for the typeof() operator mentions: Used to obtain the System.Type object for a type. A typeof expression takes the following form: System.Type type = typeof(int); It's clear that the System.Type is the "metatype", the type that is created for us but describes a type we created. It also says to use GetType() to obtain the run-time type of an expression (although not the GetType overload discussed here, taking a string and finding a corresponding type in any loaded assembly in the appdomain!), and I take this as evidence in support of the "typeof() is resolved at compile-time" hypothesis. :)
  • :D [modified]

    csharp mobile wpf com design
    12
    0 Votes
    12 Posts
    70 Views
    K
    Coding is fun.:laugh::laugh::laugh: Greetings from Germany
  • DB2 7.x OLEDB Managed Provider Bug

    database help csharp php html
    4
    0 Votes
    4 Posts
    24 Views
    V
    Pete O`Hanlon wrote: There's no code for us to gasp and recoil in fear from It isn't a big deal. I have also given a situation where the provider crashes. A simple table with a Unique or Primary Key. A Console Application that tries to violate the primary key by inserting a duplicate value is enough to detonate the setup.:) Vasudevan Deepak Kumar Personal Homepage Tech Gossips
  • at least he tried

    question
    42
    0 Votes
    42 Posts
    519 Views
    R
    That would be one heck of a long list if they (the original coder or Wikipedia) attempted listing all the primes ;) Rob G
  • Well is it SQL or isn't it?

    database question
    15
    0 Votes
    15 Posts
    104 Views
    P
    Thanks for the tip. I was thinking along the lines of building a test suite app where the user can choose which database platforms he/she has, run tests on the throughput of SELECT statements fetching various numbers of rows ( i.e., first pass would get first 100, then second pass, first 200, then third pass, the first 400 - doubling each time until a certain point, say 1,600.), do the same for INSERTS, UPDATES, and DELETES. One item of caution would be that more databases they choose from, the longer the test has the potential to take. There could be network considerations to take into place. As you can see, this could end up being a pretty big deal. Maybe just start of simple, then advance it. I could just go on and on :rolleyes: "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
  • Clever code [modified]

    html com question
    18
    0 Votes
    18 Posts
    110 Views
    S
    i was thinking POS stands for Point of Sale... in which case the code came from an inexperienced beginner programmer from India.... in which case its bad code. (please don't misunderstand me... i'm not saying that all programmers from india are bad programmers, i'm just saying the underpaid ones are ;) )
  • Software

    oop question
    4
    0 Votes
    4 Posts
    28 Views
    B
    That's right, this question does belong on the "Coding Horrors" board. :laugh: "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.
  • Awesome!

    java ruby data-structures tutorial
    9
    0 Votes
    9 Posts
    56 Views
    V
    Andy Brummer wrote: VB6 :mad: Vasudevan Deepak Kumar Personal Homepage Tech Gossips
  • 0 Votes
    11 Posts
    68 Views
    J
    You actually almost lost me at one point – lol. If I had not been in this business so long I might have been surprised, but the only thing that surprises me is that they gave you enough information to figure all that out. Sorry I very tired right now – but that was very entertaining. P.S. I am an old DOS guy so a time line for each step might have clarified why they did that to me (changing technology and all) – but I doubt it. INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
  • Funny Javascript

    csharp javascript
    14
    0 Votes
    14 Posts
    98 Views
    J
    nothing happened... what are we supposed to see?:wtf:
  • 0 Votes
    15 Posts
    99 Views
    J
    you must work at my company... I'd laugh but it hurts too much.:(:((
  • Programmed Developers to Enrage Us

    database com sysadmin windows-admin question
    23
    0 Votes
    23 Posts
    93 Views
    P
    Vasudevan Deepak Kumar wrote: But how do you make the swine to understand the greatness of pearl. It is a futile exercise right? Sometimes people just need to make mistakes that cost them money/time/injury before they understand the issue. Or use the following: Now that they have the pearl, take it away from them. Phil
  • Best practices for transaction management,

    announcement com
    8
    0 Votes
    8 Posts
    45 Views
    R
    I'm sure I've seen this used as an example in more than 1 place of how NOT to write transaction code. Maybe your guy skip read the chapter and accidentally picked up the wrong flow chart of how to write this stuff. I'm suprised that anyone who has experience with transactions would dream of doing anything other than Begin, Get the job done quick, Get the hell out. Russell
  • Nested loops - gotta love them

    ruby css testing debugging beta-testing
    14
    0 Votes
    14 Posts
    100 Views
    T
    dude that funny.. you must go for contractor job then :) "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief
  • Threads

    design help learning
    5
    0 Votes
    5 Posts
    31 Views
    C
    "thou shalt not commit murder, all threads should be directed to suicide" :) Nice. Need Another Seven Acronyms... Confused? You will be...
  • Not so brilliant me

    business
    4
    0 Votes
    4 Posts
    30 Views
    S
    :) 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
  • he he

    com
    13
    0 Votes
    13 Posts
    71 Views
    S
    :laugh::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
  • 3 years back I wrote like this :)

    career
    9
    0 Votes
    9 Posts
    49 Views
    S
    :laugh::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
  • piece of javascript code

    javascript com code-review
    21
    0 Votes
    21 Posts
    265 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