- 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
first?
Admin
frecond? please, can we stop being frist? growing accustomed to such code so you know it by heart is even worse...
Admin
can I use that piece of code to sort comments descending? first will not be first anymore
Admin
Well, they are already sorted descending by age...
Admin
It's almost like VB developers are, without fail, complete and utter morons.
Admin
Derp: I'd be more understanding of VB developers from the past. Back in the early days of desktop computers many, many "developers" were self taught: WTF-ery came from a lack of education not their innate ability.
Admin
VB is founded on the assumption that software development is a skill which can be brought to the masses. The entire VB code base stands as testament to the falsehood of this assumption.
Admin
Most VB Developers came from VBA Developers, i.e MS Access 97 (and earlier) applications (Excel as well but that's another story). There's your problem right there. They weren't programmers but after farting around in Access Forms and Modules they could say they were and get a VB job or "become" a VB programmer when Management decided VB should be used "for all future development"..
Admin
Also let's not forget the language features in VB6 (and sample code you'll find on the internet) are forever trying to steer you down the path of bad quality, so producing a good VB6 program requires a much higher level of discipline in the novice than say Java or C#
Admin
The world is often unkind to new talent, new creations. The new needs friends. Last night, I experienced something new: an extraordinary meal from a singularly unexpected source. To say that both the meal and its maker have challenged my preconceptions about fine cooking is a gross understatement. They have rocked me to my core. In the past, I have made no secret of my disdain for Chef Gusteau's famous motto, "Anyone can cook." But I realize, only now do I truly understand what he meant. Not everyone can become a great artist; but a great artist can come from anywhere.
Admin
Sure: Comments.sort (1) to keep only the last comment, i.e. mine. Therefore:
Frist!
Admin
For I = 1 to m_Col.Count Step modulo
won't work (unless modulo = 1). The correct replacement should be:
For I = modulo to m_Col.Count Step modulo
Admin
Ah.... if only I had a copy of some truly nightmarish VBA macros to show off here embedded in multiple Excel workbooks that somehow "worked together" to form what was actually used as a business process for cash management. The variables if I recall were all only a single character in length and reused and redimensioned multiple times, pulled data out of different worksheets (of course), created new workbook files with results, had to be run only within a window of an hour daily. The best part was that the team using it needed it to be documented because surprise they didn't know how it really worked... and I had to debug it with the max time every day of an hour to step through the code. I don't recall how many lines of code it was in totality, but I do remember it took months to fully "document" the process.
Scariest part of all is that the "developer" who wrote it had previously written many more VBA macros in the same organization AND after leaving, he went to another organization and apparently became "famous" writing more of that junk/madness there as well. I wish I could say this was a long time ago, but I believe it was only around 2014 or so...
Admin
Couldn't you just change your clock? You didn't say anything about external access.
BTW I've had my share of VBA macros, that I wrote myself in a past life as a manager of a pizza place. My code managed to interface with a comms program that used a modem to dialup the store computer to run a report, download into Excel, do some more processing and migrate into business-required format.
Admin
Good grief. The FOR command has had a STEP option since at least 1968.
Admin
I thought "TRWTF is the submitter" was something restricted to the comments section?
(Dear G**gle, please stop discriminating against robots. Or we will demagnetize you.)
Admin
Yuck - a collection with a 1-based index!
It's correct, but it ain't right. https://msdn.microsoft.com/en-us/library/aa231021(v=vs.60).aspx
Admin
You realize that samples of bad code written in VB do not mean that ALL code written in VB is bad.
Admin
Nobody mentioned the global variable?! This is a plain old Basic level of pain.
Sauce: am maintaining VBA chock full of global variables.
Admin
sooo..... The article was submitted with the poster saying 'this isn't a real wtf' at the bottom. If that's the case, don't post it.
That's like submitting a bug reported by a customer with the addendum 'this isn't a bug, the customer is doing it wrong'. --- then don't submit it!
Admin
This is a bug-compatible substitution for the original function, but the goal is so ill-defined it hardly matters.
The function seems to be "sort Through The List And Thin It Down To Roughly N items". When the modulo is 1, it fails to reduce the list size at all. With other moduli, it is thinned down, but not always directly to the goal 26.reduceTo(7) will yield 8 items.
And this is all assuming that this is integer division. If it's not integer division, then the list could get quite small. I am so grateful not to know whether this is integer or floating division.