| « Prev | Page 1 | Page 2 | Page 3 | Next » |
Translation: I wrote this some time in the distant past and am embarassed to admit its mine. |
|
What's wrong with a business logic color coding scheme? If it's
good enough for the Dept. of Homeland Security....er....I mean......nevermind. |
|
I knew there had to be a better way then model classes!
I KNEW IT. Here I was using the phases of the moon.... and the pressure of the mouse clicks. (Everyone knows new people click with less pressure....) |
|
So the problem here is using magic numbers, right?
|
|
I swear some people are writing code on acid. I'd love to be there when someone wants to change the color scheme. [manager] We've been asked to update the color scheme to fit the corporae standard. I've got the intern on it. [developer] Wait, the logic depends on the RGB values of the components. [manager] What? Why?! Now here's the game, kind of like madlibs: What's the developers response? I'd get it going but I can't even think of a reason. I need to eat. |
If Form1.Picture1.Color = RGB(255,0,0) Then MessageBox "Warning: Terror Alert Red!", vbIconExclamation End If Probably not proper VB, but good enough for TDWTF |
|
This isn't a WTF: it's obvious that the programmer was working in a low memory environment so he reused the members of the UI classes as state variables rather than bloating memory with some of his own. Commendable!
|
There's just one flaw with that: It's VB!!!! the only programming language I know of that requres four floppies of runtime for a simple measly "Hello World" app. |
what's a "floppy"? |
The concern is that there is a set amount of magic numbers (256 * 256 * 256). It is just a matter of time before all possibilities are used up. The developer then will have to use window position or frame size for additional options. Appears to have painted himself in a corner on this one. |
Yes, this is obvious. Obviously bullshit. |
Its like a compact flash card, but bigger, suceptible to magnetic fields, and easily damaged. They generally hold a lot less than compact flash cards, too. See http://www.webopedia.com/TERM/f/floppy_disk.html for additional information, or simply refer to google.com |
Really? Then you really aren't all that perceptive. Runtime files (usually known as Dynamic Link Libraries...you know dll files?) have been around for ages. Most OS interpretations of C++ required a few core DLLs to function. The only reason you didn't need to distribute them is that they included them with the OS usually. Do you think Pearl runs without a runtime? Java? Have you TRIED to run java without the JVM? How about Python? Is there some magic I'm unaware of that I've been missing for all these years? Hell, the only reason that VB had P-Code to start with was because it was actually once considered ADVANTAGEOUS. Moore's Law hadn't really taken off in the business world yet and p-code with a runtime takes less space than a compiled app on a harddrive. Now that's a moot point, but then it was big. Now, I'm not saying VB is a stellar language, but if you are going to make a blanket statement, please don't make one that obviously makes you look like a complete and total idiot. Do they even teach these kids anything in school these days? Yeesh. |
Actually it's Fox Pro, and the quilty party was long gone before I got here. |
Yeah, don't validate the input or anything...wait for it fail, then change the control color. |
[developer] Because that's what marketing put in the requirements! |
Hmmm. I wouldn't describe this as quilty. More of a highly-flammable, fuzzy, poly-blend blanket. |
|
I think this is my favorite WTF ever. I think I want to use this
concept in my current code, except I program IVRs, so I'd have to use tone of voice... |
|
My guess: everything was so tightly seperated that the coder found no
other way to determine whether or not the operation was successfull without changing that other, probably not-at-all better code. |
Meanwhile, the labels on the client are changing to every color in the RGB scale so the user is wondering WTF is going on. I hope they have a color legend. |
What's really sad about this is that this is exactly the kind of thinking that many developers use when trying to minimize memory footprints. Yeah, get rid of that one byte. That's going to really make a huge difference in a GUI application. Ignore all the real memory usage problems. Totally commendable, for sure. |
|
And its data storage mechanism is based on the popular MPG database framework!
|
|
I remember seeing the same, but using images instead of colours. If the
image was an "OK" icon, then it was ok. If it was a "wrong" icon, it was not ok lol |
This coder did not have any memory considerations when creating this.
|
I think it's pretty obvious that this code's problem it has no model. The internal state and the view of it are completely coupled in unholy matrimony. I've dealt with this kind of 'design' before and it's a nightmare to maintain. Change the text of a selection and about dozen bugs appear. |
I didn't think so. I was more directing that at the person who thought this was 'clearly' for memory savings. |
|
"tightly seperated". I think I'll use
this in my next presentation. My app is tightly seperated to provide context sensetive error reporting. |
Of course, I'd say Java was piggish, as well. And Yes, I realise a
I could go into how DOS COM files fit into 64k, needed next to
Can you please tell me the advantage to this? There is only ONE
I'm not the only one to do that, believe me.
You're likely younger than I am. So, do they? |
|
I get it - the WTF is that the colors don't match. And that
everything is primary colors, which would make your eyes hurt after a while... --Daniel T |
FLAME ON! Great response - bravo, bravo. |
We all know, sometimes a well-meaning SW designer hides just too much of the (supposedly) internal state of a module, so other modules have to rely on side effects to find out what's actually going on. Of course the right way to solve that would be to change the model, but there may be other constraints (like: no time left) that make it difficult to do so; the coder of this WTF obviously thought that relying on the color is less problematic (less likely to change) than relying on the text of the label. |
[developer] Because I'm a genius, Seriously. [manager] Brillant! dZ. |
Indeed. I would have preferred a nice Mauve. Or Taupe. Lavender would also be quite soothing. |
Generally, it's difficult for a view to render something that the model is hiding unless your model is a Holub-esque 'render yourself' model. So I'm wagering that there is no internal model. The business code is embedded in the controls. There is no state other than that of the gui components. I've seen it too many times to count. |
|
I think you folks missed the boat on this one. The WTF is that it is not accessibility enabled. What if the use is color-blind? Then what is the code supposed to do? [;)]
|
|
As pointed out previously the obvious problem is that some silly manager might want to change the color of the error dialog to better match the new clock behind his desk. So obviously the best solution would be make all the colors involved configuration settings that way the maintainer can change the color of the dialogs and the color senstivity of these brillant programmic responses at the same time with out destroying the program logic. Something on the lines of : If lblClientNum.ForeColor = wftPendingColor Then |
That's probably how this was discovered. The colors were deemed offensive but when changed, the code stopped working. |
|
Aargh! *User*, not *use*! Stupid EBKAC. |
Nice try, but you just can't justify this level of WTFery. Simply changing Call SaveNewClientData |
|
This is about as scary a code as I've seen.
I would really like to hear the justification for this one. |
Green is a primary color? (sorry, sometimes I can't help being an asshole...) |
Finally, a sensible use for Hungarian notation. [:D] |
|
Rohhh, nice one, background color-based logic, definitly brillant [:D]
|
There is none. |
But this requires access to the source of the SaveNewClientData procedure, which may not be the case in this project.
I aggree that this software definitely does not follow the MVC paradigm. Anyway, there could be some part of the program which could generously be considered "internal model" although it somehow has access to the controls, so it sets text and color of a label according to the result of the operation. |
Let's assume the programer decided to take the label as an indicator of the success of the operation because he has no easy way to directly find out. Relying on the color might be safer than relying on the text of the label, since the label text could be translated, corrected, contain variable parts etc. while the color is always the same for a result. |
Ita erat quando hic adveni (It was that way when I got here...)
|
|
AmmoQ - with all of the defense of these WTFs the past couple of days, I beginning to think you authored quite a few yourself.
No really, why are defending such code. If what you speculate is true, then this code, and code like it, should never see the light of day. |
| « Prev | Page 1 | Page 2 | Page 3 | Next » |