- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
He's right. Look: v
Admin
Three different customers with the same ID are a design spec??? What does the rest of the database look like?
Specs:
CAPTCHA: ideo: I thought so, too
Admin
It may be too much, but we do not know for sure.
Usually, when I read these pages I either immedeatly think of how it should have been done, or I see somebody else in the comments typing it out.
I don't see any conext, that makes this code a WTF. Or is it obvious to anybody but me?
So I am wondering: what should the creator of this code should have done instead?
Admin
Nazi!
Admin
Maybe you should structure your text (for example by indentations) so it will be easier to read.
Admin
Crazy mainland Europeans. We, the UK, use a comma as the thousands separator and the full-stop as a radix separator.
The weird arse notation confused me as well, then I realized they were probably from mainland Europe (or one of the other bits of the world that uses that notation).
Oh and they use a comma as the radix separator, afaik.
Admin
Nah, they use the crazy notation too.
Admin
Who knows what twisted logic resides inside THAT function. From what we can see here, the original coder may have been one of those who makes a new connection to the database for each iteration......
Yours Yazeran
Plan: To go to Mars one day with a hammer
Admin
Why is bad code so pretty?
Admin
Admin
"O(n^^18), because sometimes P is almost NP :)"
Maybe the coder was trying to prove P=NP by showing that P can become NP with enough code.
Admin
RAID...Hmmm...
That's it! A RAID array! That'll make my VB app run fast enough!
Admin
Admin
See, now you've lost me. I'm in the UK and thought I understood it both ways, but putting the € at the end? Followed by a decimal point? Or is that a centimal point to make the € into Euro-cents?
As for the tiny font version, traditionally with microdot style information you have a prearranged place to put it so people know where to look. I suggest prefacing it with a colon and a dash, maybe?
:->
Admin
So you have a Customer ID... I may be confused but I thought ID was short for identification. Clearly this isn't the case with your database. Just an extra shiny number?
Admin
Admin
Personally I would rather go with barfing noisily given that something must be seriously broken to get in this state and needs fixing (rather than than the company wondering a month or so later why they are shipping more orders than they are getting paid for and their being no useful information to give a clue where to start looking....)
Oh, the fun of being on a support team with a 500 000+ lines of code and a problem report along the lines of "But it seems to give the wrong answer some of the time, but we're not sure when and can't reproduce it reliably."
Admin
I'll never quite understand why English speakers like to put the currency symbol in front of the quantity. $5 is pronounced as "five dollars" after all, not "dollar five".
Of course, writing 42 and saying "zweiundvierzig" (two and forty) doesn't make a lot of sense either. If I could redesign the German language, this would be high on my todo list. Right after changing the preferred numeral system to sexadecimal. Yes, sexadecimal. Portmanteaus of Latin and Greek words are supermoronic.
I have no idea what you're referring to, but this looks like a vampire who lost his lower jaw: :-€
Nowadays the spelling "vampyre" is much more fashionable though. Vampyres are much more evyl and vycious than vampires.
Admin
yeah, the logic is ridiculous, but at least we can SEE that the logic is ridiculous. Imagine that with no white space... I'm maintaining a project right now where the previous developer must have thought that 'TAB' was only a beverage.
Admin
Awaesome. Just awesome.
Admin
But just for dollars - in the US, the cent symbol is always placed afterward the number: 25¢.
Admin
That works out fine unless you're an American cell phone provider in which case 0.01¢ means to them 1 cent and you realize everything is broken.
Admin
Admin
Its not an O(n^18) algorithm, but rather an O(abcdefghijklmnopq) algorithm, or more succinctly described as O(mygod). Isn't that just adorable.
Admin
Hmmm... maintaining legacy software seems like it would be a punishment for writing unmaintainable code. That sin is at least 5th circle (if done because you're lazy)... which is outside of Dis, but just barely. If you consciously do it, then it's either circle 8 (if done to make yourself indispensable) or circle 9 (if done to sabotage).
Admin
Admin
You sir, are either the product of an overabundance of profoundly poor whiskey, or a blatant troll who is just a little to obvious.
I find it hard to believe you could possible defend:
Iterating over multiple rows when you expect one, and thus unexpectedly duplicating shipped orders is a graceful way to handle unexpected duplicate customers.
...either that is the poorest form of 'error handling' imaginable, or the poorest planning of a 'customer group order splitting' feature ever conceived.
Calling something an 'ID' when it does not in fact uniquely identify anything. How do you actually identify which customer actually ordered something if you have duplicate IDs? If you are certain they are all the same customer somehow - how do you know which row of customer data has the most current data for that customer?
Either you are a troll, or a ditch digger yet to discover his true calling in life.
Admin
Admin
WTF???
Admin
Except....n**x is denoted n^x. n^^x is more commonly used in math (or at least Math Computing) to represent (n^x)^x (which is a little bit worse than I think this code is)
Admin
The grass is greener on the other side, my billy goat friend - would you like to cross?
Admin
A second Billy Goat stepped onto the bridge, only to be met by a hungry troll.
Admin
And we have all three!!!
Admin
English used to be a bit backward with numbers too (they sort of still are with teens - although many languages are...The half-exception that immediately springs to mind is italian, which counts through 11 (undici) to 16 (sedici) with the smaller value prefixing and then swaps for 17 (diciasette), 18 (diciotto), and 19 (dicianove))
An English example: "Sing a song of sixpence a pocket full of rye, Four and twenty blackbirds baked in a pie."
Admin
My Goodness, nbow we have too many Billy-Goats
Admin
Goat's Cheese, anyone?
Admin
Admin
Loops like violence
Admin
He obviously isn't sending triple orders. He was making a subtle, funny point.
Admin
I just had a disturbing thought: just imagine what the insides of the InsertRule method look like!
CAPTCHA: delenit - the act of nulling a string.
Admin
Well without the spec, we don't know if this code is a true WTF (but seriously, 57 argument function? or however many that is)
Without knowing the context, do you really think that for every RefWarnItem you need to iterate over everything else? These are listview items, so chances are you only need to look at one item for each listview control. What about the fact that he passes in LVSvcItem.ListSubItems(1).Text, then does an IFF(LVSvcItem.ListSubItems.Count == 1) Can LVSvcItem.ListSubItems have 0 items? What happens if it has 2, we always pass the first item in.
Without knowing the context, I can tell you that if you are nesting 18 levels of "foreach" you should probably be rethinking your design.
Admin
Oh, and I think you meant "too obvious". But I realize English is difficult as a second language.
Admin
At least it is indented nicely. Many years ago, I worked as an Oracle DBA on a project, and there were always a PL/SQL package that was a nightmare to compile.
6 months later, I was hired as a developer to maintain those packages and the VB app that used them. The prince of insufficient light must have really been busy that day.
This code was thousands of lines long. After indenting it myself, it looked like the Code SOD, but with many more lines and recursive function calls.
Even finding the query was a major project. By the time I was done, I figured it:
After removing the Cartesian product from the query, I put the query directly in the VB code and used a VB control to save the printed windows meta file in a LONG RAW column in the database, so the same report could be printed later exactly.
My favorite part of this was submitting a change request to my DBA friends for the PL/SQL package, wording like any other, expecting them to groan as we always did, and then to see the look on their faces when the request said:
"please drop package xxxx from the database and remove it from all CM repositorues"
Admin
Speaking of outstanding encapsulation, I have some CAM software here that we use to generate G-code for a cabinet shop CNC router. This (obviously) VB6 app uses .mdb for its backing store, and poking around in some the libraries it registered on the machine generally yields things like this:
WritePartRecord. So close, yet so far.
btw, this particular software goes for about 8K USD, is usually packaged with a new machine, and as such, is likely used to generate code for somewhere around a billion dollars-worth of CNC routers. The amazing part is that as buggy as the gui is, the code it generates is has always been pretty much flawless. Go figure.
Admin
Admin
No no they don't use any separators, they prune...
Admin
Mike5
Admin
Obviously, you should be passing a single structure as the argument -- a 53-member structure, that is.
Admin
Admin
Beautiful code - ASCII art! ;-)