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
  • For loop horror

    29
    0 Votes
    29 Posts
    223 Views
    L
    took me about five seconds to see the error. maybe I've stumbled into most shit already. Larswad
  • 0 Votes
    10 Posts
    44 Views
    R
    not to mention the possibility of some adding a big field to the end of the table (blob for instance) and your code suddenly grinding to a halt. I won't use select * even if i want every field as you have no idea what changes may come later Russ
  • One-Liner

    tutorial
    12
    0 Votes
    12 Posts
    72 Views
    J
    Seen the same dumb stuff to "clear a string": sprintf( pcSomeStringBuffer, "%s", ""); // Or Even strcpy( pcSomeStringBuffer, "" ); Peace! -=- James Please rate this message - let me know if I helped or not! * * * If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
  • From where to, I dunno

    database com question
    13
    0 Votes
    13 Posts
    70 Views
    P
    Not yet, waiting to hear back from the manufacturer.
  • Another from my boss!

    database help question career
    31
    0 Votes
    31 Posts
    317 Views
    H
    Wait a second! This is a form to post "Coding Horrors". Just because he keeps looking to the same person (and that person is unbelievably bad) does not make him a person who takes pride in "bashing" others. Posting bad code is the point of this forum. Myself, I've enjoyed looking at these code examples for exactly the reason I am browsing this board -- to shake my head in disbelief.
  • 0 Votes
    7 Posts
    41 Views
    V
    Fatbuddha 1 wrote: system is good tested and more or less secure, than it should be a bank system True. That would be a very optimistic view. Fatbuddha 1 wrote: seems to be my fault Not necessarily. But those developers who brought out the buggy system had thier thought process the other way around -- Banking system is one of the systems. :-D Vasudevan Deepak Kumar Personal Homepage Tech Gossips
  • CHOTD [modified]

    csharp php visual-studio com
    12
    0 Votes
    12 Posts
    67 Views
    V
    leppie wrote: so yes I am pushing for a fresh C# app Good Move! Rather than suffering sick with the horrible VB! :mad: Vasudevan Deepak Kumar Personal Homepage Tech Gossips
  • A class on UI design...

    design com tools architecture
    23
    0 Votes
    23 Posts
    198 Views
    C
    In terms of 3 dimensional CGI views, what kind of perspective do you need to view 400m of backdrop? Lousy joke really. I ought to give up... So should he... Ninja (the Nerd) Confused? You will be...
  • Why is my code so slow?

    question code-review
    9
    0 Votes
    9 Posts
    49 Views
    M
    Good morning:rolleyes: Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)
  • Stupidity and Stuburnness [modified]

    help csharp java asp-net database
    3
    0 Votes
    3 Posts
    18 Views
    A
    nice problem it is not big problem i have a great solution for this problem. use Entry exit point when it call another web service.when it'll call load balance service then use Exit point and here save all information regards to the session. when it connect previous one then use entry point here invoke all information regards to the session. useing above idea where the session started.it'll save on user M/c then we dont need to maintain session in server end.
  • Excellent stored procedure

    database ruby
    6
    0 Votes
    6 Posts
    34 Views
    K
    The code is optimized for "readability" and "maintability", so everybody understands what is going on. Maybe the compiler does the rest of the work via detecting the first four @sql string statements are constants, and make one string of them.:cool: The sql varchar(8000) seems to be a little to big. But better too big than to short. X| And a clever compiler knows that the constants strings and 2000 are less than 8000. I dont know how clever a compiler of "today" is. :confused: Greetings from Germany
  • SetFocus to a control that is probably disabled

    7
    0 Votes
    7 Posts
    31 Views
    B
    The question is, why would you want to imperatively set focus on a potentially disabled control? It's like, are you giving a user a listbox that lists all of the controls on the form and when they select one, you set focus to it? I mean I could see how that's useful...like if you have 20 thousand controls on the form. But here's the real question...Why would you want to make a disabled control enabled? Maybe it was a handler for a checkbox and when the user checks the box, it enables a previously disabled control and sets the focus so the user...can...oh wait, it disables the control before the user can do anything.:doh: WTF?:confused:
  • Who needs event handlers...

    database
    3
    0 Votes
    3 Posts
    18 Views
    M
    :omg::wtf: And this guy still lives?!!!! "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook "There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
  • Good thing we use a transaction...

    help question
    7
    0 Votes
    7 Posts
    48 Views
    M
    Chris Meech wrote: That makes the ROLLBACK extremely fast. :laugh::laugh: Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)
  • So stingy!

    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • if if if if if if

    37
    0 Votes
    37 Posts
    269 Views
    P
    switch(i) { case 12: case 19: case 26: case 33: break; default: i++; }
  • New basic syntax

    4
    0 Votes
    4 Posts
    21 Views
    L
    tip 1! Luc Pattyn [Forum Guidelines] [My Articles] this months tips: - use PRE tags to preserve formatting when showing multi-line code snippets - before you ask a question here, search CodeProject, then Google
  • 0 Votes
    12 Posts
    48 Views
    D
    [start quote, since there seems to be no button to automatically quote, at least not in Opera.... nor a preview button] > With biggies and for enterprises who need to have accounts separately for every purpose like 'Expense', 'Payroll' etc and for each department, this might befit. But for guys like me who just maintain about the Monthly Minimum Balance and rarely when there is some fund, just thinking of saving for the rainy day to put it into a Fixed Deposit and with a specific clause in Term Deposit like 'Credit Interest to Savings Account' and all other KYC (Know Your Custoemr) guidelines as applicable from the savings account, I think this would be like a laughing stock. Isn't it? [end quote...] I think it would be a real laughing stock to have a different database/system design for "biggies" and "small" customers. Don't you think so? If they have to implement the more general and complex design for some customers, then it makes sense that they would use it for all customers. To maintain two totally different systems would be a total disaster and a waste of effort. Oisín
  • OLE

    csharp css com help career
    12
    0 Votes
    12 Posts
    65 Views
    N
    Welcome to the club of many hundreds of thousands of developers who share the same sentiments about VB. Chuck Norris counted to infinity - twice.
  • Tell me...

    8
    0 Votes
    8 Posts
    28 Views
    R
    jc.net.com wrote: becasue your company has decided to cut costs and "do it on the cheap" My company?:~ I'm on my own actually. I do some contract work, but mostly freelance. So there's no one in MY company but me;) But i've seen a fair share of these horrors myself, so yes, you are right in the sense that outsourcing is often unreliable, but so is hiring of local programmers of equal "quality".:sigh: The solution IMHO is to have a decent interview procedure and not rely so much on credentials, as on actual knowledge. Roswell "Angelinos -- excuse me. There will be civility today." Antonio VillaRaigosa City Mayor, Los Angeles, CA