- 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
I agree with you, but myself I would fix it in a fashion that would force the rest of the code to be changed. Refactor the soon to be dropped functions so that they call the one to keep, then add an alert box stating that the refactor needs to happen so as to use functionX instead.
All code still works and anything not caught by developers will be caught by QA (which in some companies means the users) but the word will get passed and it will eventually get fixed. Hopefully not by removing the alert() though, that's why you let them know what function to call.
Once all those issues are cleared up you can remove the function. Of course you could bypass all this by simply grepping the source but you always miss something that you didn't know you had to include in the search.
Admin
If I had been drinking a diet coke when I read that, I would likely have spewed it through my nose.
You rarely run into a situation where so much meaning can be derived from one, perfectly-chosen, single-syllable word.
I salute you, sir!
Admin
Sorry, was directed to Ron.
Admin
$mystring=~s/\d//g
Admin
Not where I come from, but I do see your point.
Admin
Admin
If isNumeric(theDigit) then ... if isnumeric(mid(str,i,1)) then
I take it ASP is not case sensitive, or else we're left to ponder how many versions of isNumeric are in the library.
--RA
Admin
Admin
And I doubt strippers would make much of a profit if they didn't get their clothes back.
Admin
Admin
That won't compile in Java. You need "\D".
Admin
Admin
Of note: in ASP, "Option Explicit" and "Option Strict" are available. It is possible to write proper code in those languages, if one wants. Also, let's not confuse VBScript, VBA, VB and VB.Net. They share the same origin, but are seriously different languages.
How do you do regular expressions in VB.Net?
Admin
Of note: in ASP, "Option Explicit" and "Option Strict" are available. It is possible to write proper code in those languages, if one wants. Also, let's not confuse VBScript, VBA, VB and VB.Net. They share the same origin, but are seriously different languages.
How do you do regular expressions in VB.Net?
Admin
Admin
Every place I've ever worked as a programmer has had some massive "dumping ground" library, a place where everything anyone has ever deemed "might be useful" has been thrown in. It grows out of control with furious speed, until it's so unwieldy that it's virtually unusable. It's not long before the only use it gets is in the form of people using the parts they themselves contributed.
This is the result of programmer ego ("this snippet was hard to write, so I feel proud of it and therefore it should be in the hall of fame"), and a cargo-cult belief that code reuse is always a good thing. In fact it is NOT always a good thing, especially for simple code snippets. (You wouldn't approve of a library function that adds two basic integers, would you?) Self-contained code is quicker to maintain and understand than code that references a massive monolithic library for trivial functions.
Particularly common is the entire "dumping ground" being in one package or file. This happens because it was made by people who don't know anything about API usability or don't care. Everyone just keeps throwing little monuments to their egos into it, Ball of Mud style.
Had the relevant functions been in NumericParsing.asp, I suspect the redundancy would have been more evident, and Sam's task would have been quicker.
Admin
No, VB.Net should not have been.
Admin
Admin
the dreaded Variant.
Admin
I used to work in a retirement home, and we'd use the resident's communal bathrooms because they were nicer. We called them the "Secret Dumping Grounds".
Oddly enough, we'd leave behind our own Balls of Mud, if you catch my drift.
Admin
first, it obvious that all three a done by three different developers.
the middle one's the best performance wise, but not named properly.
Admin
WAUW... Ron and Blame.. You two are the best programmers ever.. Imagine that.. You really ROCK !!! I mean, having a complete, I mean COMPLETE overview of EVERY SINGLE function available in you code library.. Waaauuuww..
I have made What the F.. I mean Worse than failures many many times, simply because I didnt know every single function by heart.. I must admit, I quite often still, even after reading this, make functions myself, rather than browsing through code trying to find what I need, if the algorithm is as simple as this.. But you two.. Remembering every single function available, and be cool enough to never write an already existing function.. This is soooo, good.
(To all Americans.. Think "sarkasm" while reading this..)
Admin
Hey! Ive been w... Uhm. Seen some hot nuns. ;)
Admin
What the hell? Do you pay them by LOC per any chance?
Admin
The real WTF is that the NumStriper() method doesn't have a Color parameter... (for the stripe's color)
Admin
Wow. You're obviously not a very good developer!
CAPTCH = sanitarium - maybe you should be there?
Admin
Demonstrating one of the benefits of a framework.
In my last job, I asked if there were any standard libraries or anything similar. The response from the uber coder was, we don't need anything outside the (Delphi) VCL/RTL. At my current job I suggesting using the JCL (again for Delphi). The suggestion was rejected. Thus, developers don't even want to ask and routines are duplicated everywhere bloating the code base to 750K lines. Such is the life of a code wannabe.
Admin
Am I the only one who noticed that the 3rd function is significantly different to the 1st and 2nd functions, in that it returns a number, not a string of [zero or more] digits ? (unless cdbl() doesn't do what i think)
As has been pointed out, "strip" is ambiguous - does it mean "remove these things from the input and return what remains" or "extract these things from input and return extracted items"? So, by my logic, these should be called something like extractDigits(aString).
Of course, there's no reason not to reimplement the 2nd function as a wrapper of the 1st (or vice versa). Equally, the 3rd function could just cdbl() around call to 1st or 2nd.
So overall, the WTF/CSOD as presented is quite minor. In reality it could be much worse, but we don't know what else was in this file that's included everywhere.
Admin
you mean s.replaceAll("\D","");
Admin
Admin
I've known worse in website coding. One near 10k lines include that's in almost every file, with overlapping functions and occasional functions that are also in individual code files, plus multiple 5k plus include files with overlapping but subtly different content. They didn't even have consistent usage, naming or a central storage directory, and were scattered all over the place.
Needless to say I wasn't a fan of the system.
(Captcha - quake. About what I did when I first realised the true nature of this beast.)
Admin
Only if you already work in a WTF-cubed environment. I can't think of a sane devleopment environment where one wouldn't have version control, production-development-test isolation and code cross-referencing (handled by the IDE and/or off-line tools like doxygen, LXR, you name it).
If you have no control over where the code is used, that means that you cannot test anything, ergo WTF.
So, er, no quack for ya.
Admin
Commented Code + Doc Generator = Your friend.
Seriously, that file should be automatically documented each time it is updated.
Admin
Maybe...some documentation or comments on what a code snippet does if it's just...chillin' in a library? Just an idea...
captcha: gygax //...wtf?
Admin
"Starting a new job is usually exciting but also frightening. Adjusting to a new code base --- styles, idioms, and all --- can be daunting."
<sarcasm>You should go into consulting... You would love it!</sarcasm>
Admin