- 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
You just gotta love those custom-designed languages. No formal definition, no general purpose constructs, only ad-hoc tweaks to what was once no doubt a beautiful static definition of a GUI described in XML. One of the reasons I like C++ (rather than "language of the week X") is that it has a solid background, based on both theory and experience.
But hey, I'm just as guilty: the software I'm working on here also has its own built-in scripting language... In XML... And I add features as needed to support new devices (it is used to interact with various types of lab equipment). But at least it has loops ;-)
Admin
"However, one of the types that MAX won’t recognize is anything related to a label"
I think you forgot to translate that part to BrillantML.
Admin
I guess, "If it's not broke, don't fix it"
But, I can't help myself!!!! [my boss hears that all the time]
Admin
So the WTF is that Mike thought his predecessor was an idiot for not writing code that met his own personal tastes, only to find out the hard way that the idiot was himself for underestimating the braindeadicity (or is it braindeadiness) of the language and the skills of his former colleague.
Is that it?
-dZ.
Admin
Max Bialystock? [image]
Admin
Or maybe that was just the flash back from what a former manager did to stuff I had written up for my predecessor.
Admin
The WTF is BrillantML. So much overhead to do simple stuff. It is unreadable, needs external definition for a common parser. I would simply write XSL and get the same results.
BTW, XSL is cool and sufficient to do simple stuff.
But don't try to 'program' without the basic functionality of a real programming language.
If the workaround becomes a barrier wich have to be worked around, you have a WTF.
Admin
BrillantML screams for a meta-language that is translated to BrillantML. Perhaps in XML, translated through style sheets... And for the good measure, preferably undocumented.
Admin
What kind of interpreter had to read stuff like that?
Admin
Wow, can I borrow your time machine, so that I can write some stuff up for my predecessors? It would make my job so much easier!
Captcha: 'paratus'. Latin for 'ready'. My workplace wasn't ready for me.
Admin
No Soup for you!
NEXT!
(Seinfeld "The Soup Nazi" reference?)
Admin
So doing it the "right" way took four times as long to implement and chewed up more lines of code? Obviously the shorter method is better. What's the problem here, again?
/sarcasm...though I guarantee I've heard that before and the person wasn't kidding.
Admin
I'd make Brilliant (yeah right) ML call some other script, such as Python or something to actually do the looping. Sounds nasty, but seems like Brilliant ML is limited enough and will run into a wall pretty soon anyway.
Admin
From where the sun now stands, I will loop no more forever.
Admin
I totally second that. I have seen "ugly" code performs very well in the past and "expertly written" code perform very badly.
When the latter needed to be fixed, it was a nightmare to analyze and debug.
Admin
Well, it's Greenspun's Tenth Rule: "Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp." http://en.wikipedia.org/wiki/Greenspun's_Tenth_Rule
But apparently, you should be so lucky!
Admin
Admin
If I remember correctly even the .ui-files (created with the designer) of Qt doesn't support Arrays of items and you end up with items like label_1, label_2 and so on.
Admin
Only a fool (or an Idiot) would try to refactor such a code! Is it a code? Looks like total mishmach of stuff. XML Programming languages ROCK MY WORLD!
Captcha: bene. Italian? Nice!
Admin
Can't he just use another language to generate the XML before pushing it to the device?
Admin
Yeah I concur. A preprocessing script should be used to generate the final XML.
Admin
Of course, any scripting language would fit the bill and Python or Ruby would allow you to generate the source code in a way that is maintainable and clean both on the script and the language level.
Admin
You must be joking when you say that C++ has a solid background in theory.
But indeed, at least, it's powerful enough to write a loop :-)
Admin
My eyes! The goggles do nothing!!!
Admin
Am I the only one who thougth while reading this article, that there was absolutely no reason to remove these nine lines by such an ugly xml hack?
An while watching at the xsl code I once again thougth that xsl is a wtf by itself, why the need to create a programming language in xml syntax?!
Admin
Admin
Admin
Alexander, I dont like the new colors for messages background.
Admin
why use XML and XSLT when you could write your own transformation system!...
Admin
It's better to ask a stupid question than to make a stupid mistake.
That's what I got told once when I said, "hey, I've got a stupid question."
Admin
I typically undergo efforts like this with new code. Not because I necessarily think I'll come up with something better (though I often do), but because trying to improve something and failing frequently gives you insight into why it was done the way it was.
Admin
Part of the WTF is that a developer decided to write longer, loopier code for what seems to be an embedded application. The original developer was right: don't burden the limited processor, don't use up memory, go for compactness and speed whenever possible, light trumps elegant. Those are some of the rules of embedded programming. The new guy's a rookie.
Admin
Well, I have to say, if I were the one who wrote the original code, there would be a comment saying "I wanted to do this in a loop but BrilliantML is too retarded for that to work because of x, y, and z. I wanted to ditch BrilliantML and use something that doesn't blow, but couldn't because of q,r, and p." This, both salves my ego for having to commit such trash and saves my successors (not my predecessors, though), from having to go through the same pain of discovery that I did. If similar things happen in multiple places in the code, the explanation becomes a wiki page referenced in the comment.
Admin
Indeed! I sometimes have to fail miserably at doing something before I can really understand why it might have been hard in the first place. Another common outcome is that I stumble upon some much simpler way to do the whole thing along the way, and scrap my first attempt.
I had to read this article a few times to figure out where the WTF was: was it BrillantML itself, or blindly assuming that BrillantML behaves like [author's favorite programming language]? Many languages don't pass their objects around by value or lazy-evaluate complex expressions, and would behave much the same way as BrillantML does.
Admin
Assuming that BrillantML supports comments. Just because it's in XML doesn't mean it's necessarily going into a real XML parser...
Admin
Unless of course it doesn't support comments either... :P
Admin
The real WTF is that I've just found a flaw in the "featured comments" feature...
Admin
Who's MAX?
Maxx Headroom? [image]
Admin
For the record, I happen to think the coworker in question was/is quite intelligent and thus I was really wondering why there were no loops.
Also, I cut down the code that I was trying to refactor quite a bit when I sent in the demo. It was originally a series of nine if/else tags with a number of statements between them.
Admin
There is of course a good reason for that. One day I shall find myself so bored, I shall learn m4. At least, I'll learn more than the absolute bare minimum I use to scrape buy when I absolutely have to touch any Autotools scripts.
Admin
This is why I'm becoming increasingly convinced using a flexible language like Ruby to make your DSL's is the way to go. I don't like DSL's, but if people must then to be able to extend something with a solid base with things that you just wouldn't think of (like loops) helps.
Admin
Admin
Admin
If it really bothered him, why didn't he just write a pre-processor? That way, he could define what ever macros he wanted and have it expanded to whatever the language supported. That would allow him to get rid of the XML wrap as well.
Admin
Indeed. And it's not common to find presentation languages to be more spread out than business languages.
Admin
Sounds to me like this is another example of the fads that go around the IT world, and XML is one of the latest and dumbest. XML is a wonderful product for creating a stream of data where attributes can come in no predictable order, like a text file where we might want to use bold print or add a foot note anywhere. Whoever invented it was certainly a genius. But then some group of morons said, "XML is a great tool! Let's use if for everything!" And they started using XML for datastreams that consist of a fixed set of fields. So instead of the evil primitive method of, e.g. CSV files with a row of headers that tell you what fields are coming, followed by one record for each row, or a simple fixed set of fields with some suitable delimiter, now we have the new and improved method, with a maze of tags to navigate through. Instead of just breaking on the delimiter, we have to parse tags and introduce code to allow for the possibility that fields are missing or out of order, turning a ten-line parsing function into ten pages. Then they started creating XML databases. Now someone's decided to create an XML language? In what possible way is this better than a conventional language? Oh, right, it's because XML is good for some tasks, therefore it must be good for all tasks! Hey, I think a car is wonderful invention, but I don't suppose that we should replace all of our boats with cars. Or all of our toasters.
Admin
Of course, with the original programmer gone and most likely exactly zero documentation on the process and the code, he had no way to ask anyone. (And I have the dread suspicion that such a half-assed customised "language" will itself have either no or thoroughly inadequate documentation. Cf. "Book of Lies".)
With nobody to ask, trying to do it the obvious (in other languages) way is the seemingly inefficient but probably overall ideal way to learn the damned thing.
Hard knocks, etc.
(Not that I disagree with your point - just its applicability to this specific instance.
To paraphrase Chesterton, "Nobody should be allowed to remove something they think is useless unless they can tell you why it was put there in the first place"
Not a bad guide, but not the best Iron Rule of Programming.
I can't believe, even with the copious comments in my code, how many times I've looked at something and said "You know, I know there's a reason I wrote that like that, but I'll be damned if I can remember what it was." - and usually the refactor is better and clearer.
The real fun ones are the ones that start with "How did this ever work?" ...)
Admin
Obviously the loop was unrolled for more streamlined execution...
Admin
Admin
I just hope that he made a note in the comments about why it was that way and not put into a loop so that the next sucker doesn't waste a lot of time trying to do the same thing.