- 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
primero
Admin
This looks like standard VB code to me.
Admin
secundero
Admin
Stupid American spelling it's cheque, thank you very much.
Admin
Erm, I may be missing something here (as I never wrote much VB, luckily), but apart from shoddy naming conventions and somewhat roundabout way of doing things, is this really WTF code?
I mean, having a translation method that cannot parse 'zero', and doing it in the calling method, that's a bit silly. The redundant check on uppercase, well, that looks like it used to be a parameter but got rewritten, not really that much of a WTF either. The triple conversion from string value to cents, at least I see the logic behind it. All in all, the method looks to me like it does exactly what it needs to, without bugs, and without fun things like 100-item switch cases or using floats for money representation.
I guess what I am trying to say, is that this looks shoddy, but hardly WTF level shoddy, at least to someone not familiar with VB; am I missing something?
Admin
Seeing "ByVal num As String" always makes me happy, even if it is snippet from a bank that may or may not handle my money and may or may not cause directly or indirectly cause economic crisis. It means work is still there for decent programmers.
On topic, where is the WTF? A relative of the owner wrote a crappy piece of shit, which was caught at the first gate (there was code review for outsourced code by a competent authority). Where is the WTF?
Admin
Article probably left out the part where Adam was told that the code is good enough, just put it in production, because the boss's cousin's wife's brother's kid says he's a great developer and doesn't need his code reviewed.
Admin
What's the WTF here? It's not great code, but it's not terrible. I'd hate to work with Adam. Judging by his comments, he's very passive-aggressive. Code review pro-tip: say what's wrong with the code ("convoluted control flow", "bug when converting", etc), make constructive suggestions ("Can be expressed better as [whatever]"), and leave out the rest.
Admin
My code review comments always start with, "Have you thought about...". Start from the assumption of competence, no matter how much evidence you have to the contrary.
And we all know TRWTF is writing code review comments directly into the code.
Admin
Because it turns out that the boss's cousin's wife's brother's kid is the President's daughter.
Admin
The WTF is that you don't say "uno peso", it's "un peso".
Admin
TRWTF is Adam is a flying dick.
Admin
Maybe the guys not the best VB programmer in the world, maybe he's not up on the finer points of boxing and unboxing. If it passes the tests, and is fast enough, its good enough.
The tests need tightening up on the point Adam noticed, fair enough, amend the tests and the make the code pass.
Everything else is a matter of style, we might agree with Adam on most of the points, but there's no need to frame everything so negatively, Adam comes out sounding like a git with a superiority complex, by making the original coder look bad, he forces him onto the defense
Admin
Succinct :D I like it!
Admin
The fundamental WTF here is that the unnamed (and only marginally identified) "coder" was left to hack something together, and so he did. The resulting code fails the desirability criterion on multiple grounds, while being nowhere desperately bad, but the WTF is in the management process by which the code was created, not in the code itself.
Admin
I translated it so that certain portions of the readership would be able to understand it.
Admin
Admin
Admin
Fixed that for you.
Admin
I thought it said SpanishMonkey at first.
Admin
You start off with a comment that makes VB sound inferior but then go on to ask WTF is. This is why poor code can be written in any language. If you cannot see a plethora of WTF's then I would wager that we will be seeing your code here soon, in whatever god language you code in.
Admin
FTFY
Admin
Admin
I thought this was going to be about Bitcoin. (The Real WTF is that the USA still uses cheques. And cotton/paper money (instead of plastic money).)
Admin
Or more than the necessary number of teeth in their heads.
Admin
Admin
I think you'll find he's an American citizen.
So, either you can disown EVERY immigrant citizen and take the view that all their great achievements are the product of other nations, or you can accept that he is in fact American (in which case you can claim some ownership on all that other good shit).
Admin
(In a weird coincidence the boss's cousin's wife's brother's kid turned out to be the Queen's daughter.)
Admin
They are our words not yours (the Language is ENGLISH) If you don't like the way our language is structured get your own :-)
Admin
Well, in the case of "cheque" the language is FRENCH. You're just borrowing it. At least Americans had the decency to Anglicize the word.
And don't get me started on "colour". Latin and Old French (which are how the word entered English) both spelled it "color". Modern French has chucked a few vowels into it, turning it into "couleur", because that's what French does. They love their extra vowels.
So I honestly have no idea what you Brits are doing, beyond imitating the French, and poorly, I might add.
Admin
But none of this is germane to Adam’s story.
Or, in fact, happened at all.
Admin
Admin
Yeah, I'm with people saying this doesn't really look all that terrible, and that while yes, it does have some bugs in it that should have been fixed, the real wtf is Adam's attitude.
Who hasn't accidentally left in a few hardcoded values in things that were supposed to be localized?
That said, the other wtf is specifically localizing for Spanish, rather than doing a general refactor for generic localization, which would probably not have been too much more work and would have left them with the ability to expand to other markets, too. (Just not rtl-using markets. That's a whole nother story, work-wise. RTL is a pain.)
Admin
Because the word is supposed to end with a soft o. 'colour' rhymes with 'her', if you spell it 'color' it rhymes with 'whore', unless you use arbitrary pronunciation rules.
When that traitorous thunder cunt Webster wrote his dictionary, he arbitrarily changed the spelling of lots of words, in order to make his English less English. By dropping the u from colour, making it's pronunciation less clear, he was saving America from being in thrall to Europe.
He also changed "women" to "wimmin", and "medicine" as "medicin".
No, I don't get it either.
Admin
To be fair, the pronunciation of the word "women" makes no fucking sense.
Admin
Admin
we're a very environmentally friendly nation.
Admin
Admin
The WTF is obviously a 29 peso limit. Using historical data from 1990 to today, 29 pesos equalled anything from $1.88 to $10.79 US - so not a large amount.
Admin
The limit of 29 was because that is the highest number the dude could count to in Spanish. Presumably he couldn't remember the word for 30.
Admin
Admin
Goggle Translate = "gafa"
Admin
Admin
With my last remark, I merely wondered whether there might be a much bigger 'WTF' in there; for example, if VB.net has a build in localization library capable of doing the entire conversion, then I would consider this block a pretty big WTF. But a mere hard-coded constant barely raises an eyebrow, not after having seen horrors like 20 nested for-loops, or hard-coded strings for each amount of money the system could process.
Admin
Also, this is English and American English of which we debate. Arbitrary pronunciation rules are the more common than naught.
Admin
Admin
Color is fine as it is since "our" is not pronounced the same as "er" which is why her and hour sound different. Color could get the same effect being spelled colar ar or coler borrowing from her. Thats why English phonetics are terrible. They are reliant on context clues, (read, reed, red, read), intonation (Hey someone put something in my drink!, Hey someone, put something in my drink?) and weird especially regarding the placement of I and E in words.
Phoenettically ghoti is an acceptable alternate spelling of fish. This is why English is one of the harder languages to learn. But At least we don't give our words genders. (im looking at you French)
Admin
“English doesn’t borrow from other languages. English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.” ― James Nicoll
Admin
This code is definitely full of WTFs. They're all fairly basic WTFs, but they cause the code to fail at certain points (between 1 and 9 cents, inclusive), and there are a lot of poor designs. Nothing outrageous, but you can tell that Adam has seen a lot of it. When your company starts to hire people for cheap to write incorrect code, you know it's time to update your resume. It's half the reason why I left my last job.
Admin
The passive aggression hurts. Code comments should not be indistinguishable from Reddit comments.