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
  • Why? Why?!! WHY!!!!

    csharp tools xml question
    6
    0 Votes
    6 Posts
    0 Views
    M
    Do you work for nothing? It is assumed that the majority of us work for a living and get paid for doing the work. This codeing justly deserves to be written up in the horrors forum.
  • This is a pleasure to read.

    help
    11
    0 Votes
    11 Posts
    0 Views
    L
    You call it beautiful ? :sigh: :mad: :doh:
  • where's waldo?

    help question
    3
    0 Votes
    3 Posts
    0 Views
    D
    A, Looks like old VB3 code to me. B, Looks like a quick and dirty throw-away test harness of some sort. How many times have we seen those turn into production code?
  • 4GL horror

    database tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • trying to figure out if number is negative

    11
    0 Votes
    11 Posts
    0 Views
    A
    jkruza wrote: (this is a real one As opposed to an imaginary 1? Visual Studio is an excellent GUIIDE.
  • Code In Need Of Cleanup [modified]

    sales
    3
    0 Votes
    3 Posts
    0 Views
    A
    GibbleCH wrote: arrays "1|12|34|56|" Depends on the language. In VB6, you do not have array initializers. Loading a list by parsing a string can be a very compact way of presenting code. Not as fast as manually setting each array element, but it does make the code shorter and still readable. Visual Studio is an excellent GUIIDE.
  • How to check if one date is bigger than another...

    help tutorial
    5
    0 Votes
    5 Posts
    0 Views
    Q
    Easy, you just ask each of them to step on the scale. He said, "Boy I'm just old and lonely, But thank you for your concern, Here's wishing you a Happy New Year." I wished him one back in return.
  • When ASP.NET programmers don't know JavaScript

    csharp javascript asp-net
    10
    0 Votes
    10 Posts
    0 Views
    L
    gkushner wrote: var strChar; I hate weak-typing. :doh: Greetings - Jacek
  • How to get today's date

    csharp ruby tutorial
    25
    0 Votes
    25 Posts
    4 Views
    D
    Actually you're dead wrong in so many ways. :D 1) Since ToString() and Parse() both use the *same* culture, it doesn't matter what that culture is. 2) The culture used is not necessarily the system default. It is the current culture, which can be set programmatically to whatever we'd like it to be. 3) The default culture doesn't actually depend on where the machine is located. I once wrote a disposable class called CultureBubble in order to easily run portions of code with a specific culture, like this: using (new CultureBubble("FR")) { foo(); bar(); } This technique is quite useful, as it requires minimal coding compared to writing logic for dealing with different cultures everywhere data is parsed or presented in culture-dependent ways.
  • Anagram finder

    regex csharp database question
    12
    0 Votes
    12 Posts
    2 Views
    D
    Do point out that a downloadable C# app isn't the best idea. Why not just run it in asp.net? Even if the existing website is something else, like php, why not set up an asp.net server to run the anagram logic if nothing else? The site can then retrieve the anagrams (or even pre-rendered html) through ajax or some ajax-like mechanism and nobody has to download anything. Even people who have the framework installed may be somewhat sceptical to downloading and running executables directly from some small-name website. Though I guess if we look at how many people happily use things like TPB as their source of software my concern might seem exaggerated. I've always been fascinated by the fact that somewhere in the digits of pi is a blue-ray encoded video with DTS surround sound of myself falling into a supermassive black hole, seeing past and future as I pass the event horizon, and then arriving at a concert where Mozart plays drums, Britney Spears plays a cello, Bono is a backing vocalist and the pope is making out with George Michael.
  • Get the date from SQL Server

    database sql-server sysadmin workspace
    9
    0 Votes
    9 Posts
    13 Views
    J
    You do remember right, and I was trying to forget.
  • How to chose self explanatory parameter names

    com hardware tutorial learning
    4
    0 Votes
    4 Posts
    0 Views
    V
    WilliamSauron wrote: If your bet was the [receive] section, you lose. It is of course in the [send] section... Might be he was doing a mirror-coding. Vasudevan Deepak Kumar Personal Homepage Tech Gossips The woods are lovely, dark and deep, But I have promises to keep, And miles to go before I sleep, And miles to go before I sleep!
  • How to group by hour properly. [modified]

    database tutorial
    5
    0 Votes
    5 Posts
    0 Views
    M
    select count(PK) Count, DatePart(hh,ColumnTime) Hour from dbTable group by DatePart(hh,dbColumnTime)
  • KeyUp event

    8
    0 Votes
    8 Posts
    0 Views
    J
    Brilliant if documented by a comment that they must be primes. Otherwise Horror. JustAStupidGurl
  • How to handle dates _properly_. [modified]

    tutorial json question
    8
    0 Votes
    8 Posts
    0 Views
    V
    varchar(20), you are lucky... somebody who's name i will not mention, there it's my only "programming" colleague, is coming from VB6 and now in .Net all data types are still variant(in her head). Adding numbers to strings is standard... Type Casting? What is that? Turning on option strict results in hundreds of errors , in one project with one source file, of 3000 lines... and tables, don't ask ... today my heart stopped a moment with this... CREATE TABLE `tkolkinfo` ( `tkolkIK` int(11) NOT NULL auto_increment, `tKolkClientId` varchar(100) NOT NULL default '', `tKolkTimestampBerichtOpmaak` varchar(100) NOT NULL default '', `tKolkTimestampDateKolkDone` varchar(100) NOT NULL default '', `tKolkTimestampHourKolkDone` varchar(100) NOT NULL default '', `tKolkTimestampDateTimeKolkDone` varchar(100) NOT NULL default '', But at least in the company where i work next to .Net there is windev, helping me to forget all the IT horror and dream away on a beach with a beautifull girl: http://www.pcsoft-windev-webdev.com/WD14brochure.pdf[^] (this was sarcasm for the ones who didn't notice...) It feels good to learn and achieve modified on Monday, August 24, 2009 10:47 PM
  • !(How to best use a try catch block) [modified]

    tutorial
    26
    0 Votes
    26 Posts
    2 Views
    M
    Unaveragely craptastic!
  • What happens when it fails...

    collaboration help tutorial question learning
    10
    0 Votes
    10 Posts
    1 Views
    M
    rotflmao!!!! triple epic fail :)
  • Practically The Entire Article

    tutorial com graphics question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • How to determine if button should be shown?

    tutorial question
    16
    0 Votes
    16 Posts
    2 Views
    B
    jkruza wrote: Idea of putting background color into the condition fits so perfect in his methodology, that I missed it first. Doesn't everyone use background colors for their control logic? ;) :laugh: This code probably even works, but see my tag line… Just because the code works, it doesn't mean that it is good code.
  • I don't want to know the code behind this...

    beta-testing visual-studio com
    4
    0 Votes
    4 Posts
    0 Views
    J
    Chalk it up to another reason why to never use Visual SourceShredder. :laugh: