- 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
Global search and replace is your friend too.
Admin
They didn't even do it well... And they had a LOT of opportunities...
Or if you've been working with the language long enough to write all of your appropriate wrappers, you can shorten it down to more like... (Untested, but you get the idea...)This assuming you're unaware of the built-in. :P And it's excusable because when you write VBScript you quickly learn to stop wondering if the wheel is built-in. :P Unfortunately, this can lead to missing the handful of wheels that are...
Addendum (2009-04-22 11:49): Made a 1-based versus 0-based error while typing it up and refactoring it. :P
-If Err.Number = 0 And m > 0 And m < size Then +If Err.Number = 0 And m >= 0 And m < size Then
-If m > 0 And m < ArraySize(names) Then +If m >= 0 And m < ArraySize(names) Then
Admin
Just wanted to say thanks! The deformed, irrational, stupid, gelatinous wheel you created is exactly what we wanted!
Excellent work
Admin
Not Invented Here.
Admin
A SQL Lookup isn't a horrible idea if the app is international. Doing it every time is a waste.
Admin
Jeez, even ZZ-Top repeats themselves...
I been up, I been down. Take my word, my way 'round. I ain't askin' for much. I said, Lord, take me downtown, I'm just lookin' for some tush. I been bad; I been good, Dallas, Texas, Hollywood. I ain't askin' for much. I said, Lord, take me downtown, I'm just lookin' for some tush. Take me back, way back home, not by myself, not alone. I ain't askin' for much. I said, Lord, take me downtown, I'm just lookin' for some tush.
Admin
I'm not a VBScript programmer, but I believe you do this:
On error resume next DoSomething if err.number <> 0 then msgbox err.description
Admin
Sounds like SAP, where custom tables start with Z.
Admin
You lot seriously lack basic risk management skills. What if a function or two happen to be accidentally erased?
Outstanding programming experience has forcefullymade redundancy become my motto; I always code my functions several times, if possible in several locations; and when I have time, in several programming languages, in case one of them disappears from the face of the earth (I wish VBScript would).
Admin
Frist!!1!
(I know we are going to use this post more than once.)
Admin
Well actually, no, it's not for concurrency as in concurrently running threads.
I'm far of defending this anti pattern, but I do clearly see where it's comming from!
it's just a bunch of developers distrusting each other.
"see: I need this function and I clearly see, it's already there. But I'm not gonna use it in my code, because the original developer might change it without note - and my code breaks. so, i just copy-paste the exact code and use it as MY function, so I got control..."
this isn't really only a problem of the developers, but a sign for very bad governance in said equippe...
Admin
Well actually, no, it's not for concurrency as in concurrently running threads.
I'm far of defending this anti pattern, but I do clearly see where it's comming from!
it's just a bunch of developers distrusting each other.
"see: I need this function and I clearly see, it's already there. But I'm not gonna use it in my code, because the original developer might change it without note - and my code breaks. so, i just copy-paste the exact code and use it as MY function, so I got control..."
this isn't really only a problem of the developers, but a sign for very bad governance in said equippe...
Admin
There is no WTF in redefining the MonthName function!
The VB function MonthName returns the language specific month name. If they want to have portable data they need to keep the months in english. My current OS is in french and MonthName(2) returned "février".
As far as I know, there is no built-in function to return the month name in a specific language.
Admin
So there the WTF is a bad name. It it's purpose is to just return English month names then it should ideally be something like EnglishMonthName.
Admin
Admin
vbscript is not so bad... bad coders however...
Blaming vbscript really is becoming redundant. I can show you the same crap code in PHP a thousand times over.
Admin
My biggest complaint about VBScript is the lack of include file functionality. You either repeat code in each file, or create some kind of COM object. Otherwise, it's good enough for lots of tasks. Very good garbage collection, certainly better than PHP and others for similar tasks. I've even used it as a wrapper to interface databases for OLAP objects running 24/7!
Admin
Admin
Can I get back to you on this?
Admin
lack of include file functionality? in what way? you can include files in classic asp.
Admin
My function is better than your function syndrom :)
Admin
The function doesn't directly support a locale parameter, but you can change the thread locale when calling MonthName()
Prints: janvier January
"How To Use GetLocale() and SetLocale() in VBScript" http://support.microsoft.com/kb/232158
Admin
It's for when we settle Mars, and the code gets taken with the settlers.
Admin
thanks for that!!! "real programmers" hardly ever bother with vbscript, LOL!!
Admin
You are all going to be sorry and come running to this guy for code when the IEEE month naming subcomittee decides to rename one of the months "Colbert-uary" as a consolation prize for the space station naming debacle. Who will have the last laugh then, huh?!?!?!
Admin
Pathetic. Abysmal. The Pits. These offshore programmers. But still higher than onshore ones.
Admin
[quote user="ih8u"][quote user="Marc B"][quote user="Single User"]
Yeah, but I'm planning on running 10 simultaneous threads, and I'm running out of names:
Thread 1: MonthName Thread 2: GetMonthName Thread 3: TheMonthName Thread 4: GetTheMonthName Thread 5: MonthsName Thread 6: GetMonthsName Thread 7: TheMonthsName Thread 8: GetTheMonthsName
What do I do for 9 and 10?!?[/quote]
...
Then you could try using different languages by translating the method name to French, German, Spanish, etc. Just use babelfish.
... [/quote] Well, I happen to think that the completely unrelated name is better, but if you ever go to the babelfish option, make sure to make those translation in series, AKA, translate to German the French version, and to Spanish the German version.
Also, be free to add some eastern languages between western ones. That will make the results less repetitive.
Admin
Yeah, if you want your web server to stop processing the request until someone dismisses the message box on the server...
(What? People use VBScript on the desktop? On purpose???)
Admin
VBscript works just fine... You just never use msgbox, and you set all desktops to use cscript.exe instead of wscript.exe, so the output is sent to command-line
Admin
ABSOLUTELY, couldn't agree more. This is one of the biggest reasons provoking me to hari kari every day. I keep a 4 inch blade in my desk just in case.
Admin
Fixed.
Admin
Me, I just love how june and july is abbreviated. A real byte/character-saver.
Admin
Because it works wonderfully to automate simple tasks in Windows environments? Because I can quickly develop adequate solutions with it in half the time it would take in a higher level language? Because its an easy way to utilize the power of WMI? The people writing the crappy vbscript WTFs on this site would be writing crappy WTFs no matter what language they were using.
Admin
Thread 14: Profit
Derf.
Admin
Clearly they followed the directive at the start....
They were doing something more than once, and each time they did it (presumably after the first) they made a function for it.
Admin
The real problem is that nearly everybody who uses VBScript/Classic ASP does it the half-assed moron way and uses On Error Resume Next to have the script not die so they can happily code whatever shit they want, and hey see it works even though I declare this variable after I assign a value to it.
I mean it's not like we programmers are supposed to be professionals trained to do a job, no siree Bob, any idiot can hack out VBScript that kinda sorta works thanks to On Error Resume Next.
And, while VBScript is not the WTF, the sheer number of idiots who use(d) it to hack together WTF code give the language a bad name.
Admin
Admin
That's why I get all my code from quality websites-like this one!
Admin
Admin
Admin
Your Web Server doesn't have some kind of robot built out of CD-ROM drives that click a mouse to OK message boxes?
Admin
Admin
FTFY
Admin
BTDTGTTS
Admin
F100rst!!1!100!1!
Admin
F101rst!!1!101!1!
Admin
And they don't use a process to create an XML-file first, then send it to a Webservice which answers in HTML, transform this again to XML, convert it to CSV, put that in a hidden field and then apply logic to extract the month name from the correct hidden field (txtJanuaryName, txtFebruaryName, etc. ? Lame! I could imagine putting the whole into a message queue, just in case...
Admin
Aaaarg, I forgot the wooden table somewhere inbetween.
Admin
It's also good to have multiple redundant functions in case one of them has a bug in it.
Admin
... especially the array and string handling functions. Like English synonyms, there seems to be a plethora of array functions that do almost, but not exactly the same thing.