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
  • call the same object

    4
    0 Votes
    4 Posts
    0 Views
    S
    TorstenH. wrote: Did I mention that I live really close to a German Biergarten who doesn't, every german citizien lives near one... and in bavaria... which I actually do... :laugh: (yes|no|maybe)*
  • Logics is really hard to learn

    tutorial question
    16
    0 Votes
    16 Posts
    0 Views
    L
    Richard A. Dalton wrote: You beat me to it only just. :-D Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
  • We Don't Need No Stinkin Indexes

    database html sql-server sysadmin
    13
    0 Votes
    13 Posts
    0 Views
    H
    indexes are so 90's..
  • 0 Votes
    5 Posts
    0 Views
    B
    Look at the paths - user fitpccom causes the trouble: /home/fitpccom/public_html/fit-pc1/includes/version.php /home/fitpc/public_html/fit-pc1/includes/joomla.php But, well, you're right: require_once should be renamed to require_thrice. "...then shalt thou count to three, no more, no less. Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. Five is right out. Once the number three, being the third number, be reached,..."
  • New trend at work...

    css regex help question
    7
    0 Votes
    7 Posts
    0 Views
    Sander RosselS
    That is pretty nice! :D Although ParamArray is still not what my boss wants. Simply passing Classes as parameters all of a sudden seems not done anymore :???: My boss says it is to confusing for new developers. He now wants to change the above code alltogether, making it Generic and creating the Class that should be added using Reflection. Code would look like: manager.AddToManager(Of ListInterfaceClass)("String1") ' The AddToManager Method would create a new instance of ListInterfaceClass. According to him this is much more readable than: manager.AddToManager("String1", New ListInterfaceClass) I don't think anything can save me anymore, not even ParamArray X| It's an OO world.
  • warning C4706: assignment within conditional expression

    help
    6
    0 Votes
    6 Posts
    0 Views
    J
    The layout is not pretty and I would have commented it a lot more thoroughly, but there is nothing wrong with a complex if statement. I know that the refactoring polizei will feel that 1000 statements are better than one but as long as the code is well laid out and well commented (which this isn't), then a single statement can be simpler to follow. The warning, incidentally, is for the final stanza in the line after the comment // LANG_hu section: spec. Hungarian rule. The compiler is guessing that rv = affix_check(st,i) should be rv == affix_check(st,i)
  • Who Needs BackgroundWorker....

    10
    0 Votes
    10 Posts
    0 Views
    Q
    I found found only one place - when using the unmanged function "SHAppBarMessage", with ABM_SETPOS.
  • CSS and the horrible day

    csharp css visual-studio debugging help
    3
    0 Votes
    3 Posts
    0 Views
    R
    5! for that tip.
  • Sometimes, People code what you say... just what you say

    10
    0 Votes
    10 Posts
    0 Views
    C
    I know I'll regret this, but sometimes even I can't help myself. Follow this link[^]. :) Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
  • Comment [modified]

    question
    9
    0 Votes
    9 Posts
    1 Views
    L
    Hi it's me, the Monthy Python!
  • Wonderful logger

    csharp asp-net help question
    5
    0 Votes
    5 Posts
    0 Views
    D
    That's painful. Reminds me of when I first learned exception handling... I programmed a message box for most, if not all, exceptions... Don't worry. I've learned. :-D
  • smart way to detect if System.Boolean true or false

    csharp
    19
    0 Votes
    19 Posts
    0 Views
    R
    depends what type of programming style you're into. Some might find the mentioned method easier/simpler to read/understand. "Program testing can be used to show the presence of bugs, but never to show their absence." << please vote!! >>
  • Ultimate Database Fail [updated]

    database hosting cloud help discussion
    20
    0 Votes
    20 Posts
    0 Views
    W
    I don't know why this was down voted, hopefully I corrected it enough. "Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" — Hunter S. Thompson
  • Exception handling

    debugging help question
    19
    0 Votes
    19 Posts
    0 Views
    M
    I guess that's why they invented the option in the debugger to break on any exception being thrown. :) There is no failure only feedback
  • About database connection, again

    question database sysadmin
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • how to: minutes to hours conversion

    tutorial database question
    3
    0 Votes
    3 Posts
    0 Views
    B
    Ouch! Your application was not set to the correct locale. It must be 0,16.67 :)
  • 0 Votes
    12 Posts
    0 Views
    B
    I used to work with people who liked to write code like that. Why add comments, they just slow down the rate at which such fine code can be written. ;) That is one of the reasons I left that job. :-D Just because the code works, it doesn't mean that it is good code.
  • Strings: the perfect way to compare numbers.

    question database tutorial
    19
    0 Votes
    19 Posts
    0 Views
    M
    oh yes, correct again sir... lesson learnt Don't vote my posts down just because you don't understand them - if you lack the superior intelligence that I possess then simply walk away
  • More on string comparison

    csharp
    12
    0 Votes
    12 Posts
    1 Views
    M
    I didn't say it was unlikely, I said it was possible that it could never happen. That does not mean sometimes it could happen, it means other code could decide that it will never happen. oggenok wrote: things that CAN happen eventually WILL happen ...and that is not certain if I wrote... string s = "hello "; s = s.Trim(); ...would you correct with... string s= "hello "; if(!string.IsNullOrEmpty(s)) s = s.Trim(); EDIT: Not understanding my message is not justification to vote it down. Illogical thoughts make me ill modified on Tuesday, March 1, 2011 10:22 AM
  • How not to string a date

    csharp c++ help
    2
    0 Votes
    2 Posts
    0 Views
    M
    PIEBALDconsult wrote: a Y3K bug :laugh: ...there shall be no computers to run such a program on in the year 3000 Illogical thoughts make me ill