- 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
At least no 'ON ERROR RESUME NEXT' I suppose.
Admin
Paracetamol! I need paracetamol!
Admin
I wanted to post FRIST with the letters sorted in alphabetical order, but I guess the joke would be lost on most people.
Admin
If the contents of the tree are fixed, why would it ever be unsorted?
Admin
When the HTML comments are more interesting than the article ...
Admin
The contents aren't fixed, they're just not displayed on the UI. The submitter wasn't clear, but I believe the user can add and remove additives from a drug formulation, triggering a new sort each time.
Admin
"Fervens Canis (aquaeous)"?
Admin
"Fervens Canis (aquaeous)" = hotdog water, in bad Latin.
Also, "Lipids (3-In-1)" is missing from the comment block.
Admin
All the 'good drugs' are missing from the list.
Admin
"VB claims that DIM is short for DIMENSION, but I'm convinced that VB is insulting your intelligence"
Interesting, I just always thought it was an insult, it never did occur to me there could be an (alleged) alternative meaning.
Admin
"Prior to .NET, VisualBasic was a terrible language ..."
Just to satisfy our curiosity, how would you describe VisualBasic subsequent to .NET?
Admin
OH My... ASP, how much do I miss thee...
Admin
C# with different syntax, so a pretty good language
Admin
The only painkillers that kind of work here are morphines and stronger. Or encephalectomy.
Admin
Just wanted to write the same.
But it seems to me that in Visual Studio, the code rearrangement works much faster and more reliably in VB than in C#. (I refuse to understand this.)
Admin
A horrible, horrible hack of C#, trying to wedge OOP into a language that was never intended to be OOP. And, as someone who cut their teeth on BASIC (and later VB), as soon as I learned C++, I quickly grew to dislike the "verboseness" of VB. Simple scope enclosures, like braces, make the code look sooo much cleaner than "End Function". I do love C#. Definitely my language of choice these days.
Admin
Must be some way to add a bubble-sort to that code.
Admin
They used bubble-sort to figure out the correct ordering, which is now preserved for eternity in the initial comment.
Unrolling the sort algorithm, they can then get the runtime down to O(n).
Unfortunately the data set is small enough that it doesn't matter what algorithm is used (so long as it isn't so bad that it takes a noticeable amount of time), they all reduce to O(1) being a constant factor of a constant (upper-bound) size.
Admin
"Mostly Harmless". There's nothing particularly good about VB.NET, but there's nothing particularly terrible about it, either. The only real complaints people can have are "ugh, keywords instead of braces", but frankly I've been doing a lot of Python lately, and I'd be happy with either keywords OR braces at this point.
Admin
I feel the backstory is in need of more explanation of the 'hotdogwater' bit.
Admin
Admin
["Selenium > about five years"] --> ["Selenium > 5years"] ["Chromium","Chromium"] --> ["Chromium"] ["May contain nuts"] --> [] Brilliant! Not only does it sort, but it even normalizes terms, removes duplicates and ignores hypothetical additives as well. Given all the thought that apparently went into composing this algorithm, why is it not that ["Cysteine - NoAcetate"] --> ["Cysteine + Acetate"]?
Admin
Presumably, the list of drugs in the comments are the ones that the developer took before coding this.
Admin
W.T.F. I actually gasped out loud as I read this. And now my eyes are bleeding.
Admin
Just about everything, in any language, outside of CARs and CDRs (on one side of the fence) or unit declarations (where units are a const, a variable, a function or a class) on the other side of the fence, comes down to syntactic sugar. This is a bold and obviously inaccurate statement. But I think it's a reasonable lemma for considering this problem you have with Python, or the problem that other programmers have with curly brace languages, or the problem that almost all of us would have with PL/1 ... not only stupid keyword terminators, but also you can redefine the idiot things at will ... Anyhow. Not sure why you're finding the Python equivalent of curly braces annoying (if I read you correctly). A decent IDE makes it next to trivial, and, dare I say it, very natural. More than I can say of some of the libraries, or indeed of the GIL. That last one ... ugh. No way round it. It's baked into Python at an annoyingly low level.
Admin
Just tried it with VB in Visual Studio 2015.
VB.NET still does know On Error Resume Next.
Now I have to puke.
Admin
Two lines in, I got a Tom Lehrer earworm. :facepalm:
Admin
I usually have to work with VBA and have this lovely QuickSort that I got out of the interwebs. Since the array support in VBA is so bad it all works with Variants.
What are they doing with the Hot Dog water?
Admin
That... that's not how insertion sort is supposed to work.
Addendum 2016-08-16 01:26: Also, it's not hot dog water, it's hot dog in (aqueous) solution, i.e. dissolved in water. I don't know that that's any better.
Admin
Aha, it's a bucket sort. There are only a limited number of items to be sorted, so they are each put into their appropriate bucket, and then the buckets are emptied. O(1) FTW?
Admin
No, it just marks you out as someone from a Lisp heritage that has been blinded by the Blub effect. 😏 There are other reasonable sets of primitives you can build a language from as well; associative maps are pretty common (e.g., they're very much at the core of Javascript and PHP, much as I despise both of those languages). Yes, you can build associative maps out of Lisp primitives, but doing so efficiently is rather harder than it appears to be at first glance, at least on all current hardware.
Admin
Damn you, it isn't bad enough that you got it, you had to spread it?
(FYI, before the new comment system, my registered user name was "The Great Lobachevsky" ;-)
Admin
This isn't VB6 being a stupid WTF language - it's someone who doesn't know how to use the tools available to them.
Pseudo code for writing the above into an invisible sorted listbox: Listbox.sorted = true Listbox.add "a drug 1" Listbox.add "d drug 4" Listbox.add "c drug 3" Listbox.add "b drug 2" ... The listbox automatically sorts into alpha sequence as items are added, because you told it you wanted the data to be sorted. Truly amazing. It just so happens that a listbox is a better control for sorting simple lists than a treeview, as anybody with any familiarity with the toolset would know.
The code in this article is not so much representative of the language, but of the low barrier to entry that the language allowed - people with little gumption or aptitude could become google-search-based developers and hack something together that did the job, if not elegantly or quickly (or even adequately.)
By contrast, a decent developer will write a decent application regardless of the language or environment.
Admin
VB.Net has inherited some terrible treats from VB - apart from the developers that keep writting VB code in VB.Net - such as non-shortcircuiting And and Or. Why the hell did it have to be backwards compatible? Now VB.Net developers are stuck with And, Or, AndAlso and OrElse where the last two are proper && and ||, i.e. shortcircuiting. Combine that with VB developers propensity to write methods that return boolean success values and use them with And and Or causing unintended consequences on failure. Yuck!
Another WTF is that they kept modules as some sort of static super class that is globaly accessible and therefore screws with namespaces and naming.
On the other hand there are some pluses to VB.Net such as the possibility to write literal inline XML and other stuff.
Admin
If you like to write verbose code, try F# for a change!