- 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
Admin
Admin
I was just called "old-school" this morning because I asked my boss to put perl or python onto the svn server so I can autogenerate the documents on a commit. Perl, I could sort of understand, but python? Yeah, python's old-school to him...
Admin
Admin
Isn't it alwasy fun trying to determine whether or not a bug you discovered was intentional or just a bug and will the business users be pleased or pissed if you actually implement the logic correctly...
I had this happen to me recently and luckily they didn't even know [broken feature which never worked] even existed.
Admin
Does that ever work for you? Anyway, they're not explaining the joke, they're arguing about whether it was funny. Pure Td, if you ask me.
Admin
Don't worry, your boss' test for old-school went thusly:
So we really have no way of knowing if Python was old-school to him.
Admin
Actually, quite a few applications do not know that the meaning of , and . is swapped in German (and in Danish by the way), that's why I always set my computers to use US numeric system . for decimal point as opposed to , as is the 'official' Danish way....
Yazeran
Plan: To go to Mars one day with a hammer.
Admin
Admin
Python was first released in '94, is not old school. Perl is getting there, released in '87. Ruby, by comparison, first became public in '93.
"Old-school" would be your centralized version control system that is an API compatible remake of CVS, which is itself just RCS on life support, which in turn is the bastard child of SCCS, developed in 1972. They've glommed new features on, but there are probably projects out there that have migrated from SCCS all the way to SVN.
Admin
The true WTF is that they should have used .NET regex:
^([+-]?[0-9.]*
Admin
SCCS to SVN then onwards. Oh yes, oh yes.
Admin
SCCS to SVN then onwards. Oh yes, oh yes.
Admin
"Turns strings into numbers" is incorrect, at least I think it is after looking for 2 minutes.
Doesn't the line "Mid(trimmedStr, 1, k - 1)" take a number up to the first non-number. So doubilize( 37yes ) becomes 37.0
Also the TWTF is that if statement with the not, orelse, wazzup, etc.
Admin
Also double your billable hours :-)
Admin
Sure it's not just hot coffee?
Admin
Yep, I was about to ask the same question. The OP could also be complaining about C, C++, Perl, Python, Eiffel, Bash, PHP (TRWTF is somebody creating PHP after we see what happened to ASP), or a plentora of other languages.
About it being useful... I guess it is not, or at least should not be useful. The reason that constuc is alowed is to keep the language simple (with the minimum amount of rules), and that we need both binary and logical AND, and logical should short-cut.
Admin
TRWTF is not using System.Diagnostics.Stopwatch.
Admin
I didn't know "0.0.0.0.0.0" was a valid number... And that 1.05e-3 wasn't.
Admin
Admin
Just so there is no confusion.
Admin
Admin
I AM SEEING DOUBLE!!
Admin
Sure doesn't taste like coffee...
Admin
Admin
Either way - WTF?
Admin
'nuff said.
Admin
Admin
+1
Admin
How'd you post to this site then? Do you have some sort of intranet setup that has Unix-style permissions, where you only have write, and not read? That'd be a pretty entertaining submission.
Admin
Or he can reply to comments by e-mail.
Admin
you can't think of any instances where it is useful to have both logical and bitwise 'AND' as programming constructs?
this was about the only comment in this thread which looked interesting.. so I'm curious to actually understand what you are meaning here.
Admin
Yah...It seems most WTFs are cases of reinventing wheels to be less efficient
Admin
Which brokes the other half of applications, especially MS Office doesn't like having set decimal separator to point when the locale default is comma (e.g. if you have set word as outlook editor -- which is of course the real wtf by itself -- it will complain every time you want to compose message).
Admin
Surely you've been here long enough to know that not everyone does funnies, Fritz...
Admin
Gold!!! Best joke ever!!
Admin
I think many are suggesting that Lazy evaluation should be the norm. VB's take on it is that you may be calling functions that have side effects, adn lazy evaluation stops this. Of course the real problem is that people call functions with side-effects from within conditional statements.
I'm no big fan of VB, but I think allowing the programmer to choose Lazy Evaluation or Full Evaluation is well intended. Unfortunately, the road to Programming Hell is paved with VB's good intentions!
Admin
Admin
Admin
You need those to counterbalance "Advanced BASIC".
Admin
In BASIC, "AND", "OR", "XOR" etc are bitwise operators. They are used as non-short-cut Boolean "AND", "OR" etc.
Exhaustive evaluation allowed BASIC to re-order Boolean expressions. Generally this means that BASIC does not have to be hand-optimized to get good performance out of complex logic.
The PASCAL I used was able to optimize better than either C or BASIC, because by design it did guarantee the representation of Booleans, the order of evaluation, or exhaustive evaluation.
Admin
My favorite line avoids calling Trim; instead using two calls to do the same thing:
Whoever wrote this must have been being paid per function call.
Admin
Admin
In fact 1.05e-3 is a valid number (according to Doubleize), equal to 1.05. Also equal to 1.05WTF35167. While 0.0.0.0.0.0 is supposedly valid, I don't know whether the CDbl call will choke on it.
Replicating the precise functionality of Doubleize is a lot harder than most of the suggestions posted. However, if you have an operational requirement to do things like converting 126TEXT754 into 126.0000, needless to say you have bigger problems than getting the conversion function right.
Admin
Actually, I've thought about this ... I have an idea what might have happened here.
A lot of programming courses try to teach the programmer to think in a logical way. And one of the exercises in the elementary course is: "Write a function to convert a generic input string to a number. It will be expected to take any random agglomeration of digits and letters and make sense of it ..." and so on. Having done this assignment, your student gets 5/10 for it. "Oh good, that's a pass!" he says. "I must save that in my Little Black Book of my Best Programs Ever!"
The next week, the proto-programmer gets an internship. His boss says: "We might get people typing stuff in this box which isn't numbers. The way it's currently programmed, that would make it break. You've done Data Entry 101 - I'd like you to sort this out for me." And proto-programmer enthusiastically barks: "Aye aye sir!" and proudly pastes in place the abovementioned.
Admin
TRWTF is using floating point anywhere except science calculations, i.e. 3D geometry.
Admin
Just to confirm what others have already answered, I just went to the decompiled code of the double.TryParse, and to me it seems like a sane use of basic if-else/while logic, not sexy but efficient looking, and without exception handling.
Actually TryParse is the basic parsing method that returns a boolean. Parse juste uses TryParse and throws a FormatExeption when that boolean is false.
Also, if you think you can write a 5 line method that is more efficient to parse a string than the one written by the developpers of the framework you use, maybe you should realize you're on the road to WTF.
Admin
Extra bonus:
Most people don't know that, but the comma ("," in the US) is a ";" instead in Germany.
(according to Excel)
Admin
"Classic ASP" is what people have been referring to non-ASP.NET as for ages.
Admin
Fortunately .NET does know this. Although it still requires the developer to write their code in such a way as to to take advantage of this.
In the case of Decimal.Parse() or Decimal.TryParse() it requires you to use an overload that takes an IFormatProvider that contains the culture specific formatting rules - which if you're lucky will be CultureInfo.CurrentCulture or CultureInfo.CurrentUICulture, otherwise you need to use CultureInfo.GetCultureInfoByIetfLanguageTag()to grab it.