• Hans (unregistered)

    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 ;-)

  • Eduardo (unregistered)

    "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.

  • (cs)

    I guess, "If it's not broke, don't fix it"

    But, I can't help myself!!!! [my boss hears that all the time]

  • (cs)

    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.

  • (cs) in reply to Eduardo
    Eduardo:
    "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.

    Who's Max?

    Max Bialystock? [image]

  • Fr (unregistered) in reply to DZ-Jay
    DZ-Jay:
    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.

    Nope, the WTF is that the huge continuity folder and documentation that Mikes predecessor wrote up got move into a shelf that no one looked at and then the computer copies were deleted. So Mike had to figure out for himself what the predecessor had written as one of the main things to know.

    Or maybe that was just the flash back from what a former manager did to stuff I had written up for my predecessor.

  • Unomi (unregistered)

    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.

    • Unomi -
  • Mate (unregistered)

    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.

  • Unomi (unregistered)
    I would simply write XSL and get the same results.
    Sorry, that came out wrong. I would not pick XSL to do the task he had to manage. But if I had to pick between BrillantML and XSL... ah whatever.

    What kind of interpreter had to read stuff like that?

    • Unomi -
  • Another Kevin (unregistered) in reply to Fr
    Fr:
    Or maybe that was just the flash back from what a former manager did to stuff I had written up for my predecessor.

    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.

  • Program.X (unregistered)

    No Soup for you!

    NEXT!

    (Seinfeld "The Soup Nazi" reference?)

  • (cs)

    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.

  • (cs)

    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.

  • (cs)

    From where the sun now stands, I will loop no more forever.

  • Nicolas Verhaeghe (unregistered) in reply to ParkinT
    ParkinT:
    I guess, "If it's not broke, don't fix it"

    But, I can't help myself!!!! [my boss hears that all the time]

    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.

  • Martin (unregistered) in reply to Hans

    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!

  • dkf (unregistered) in reply to pitchingchris
    pitchingchris:
    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.
    Wouldn't it be easier to structure the code as an m4 script that outputs the BrillantML file when processed? After all, it's a common and well-known tool that's ideally defined for this sort of pre-processing task.
  • Vollhorst (unregistered)

    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.

  • NO no NO! (unregistered)

    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!

  • Cowbert (unregistered)

    Can't he just use another language to generate the XML before pushing it to the device?

  • Cowbert (unregistered) in reply to dkf

    Yeah I concur. A preprocessing script should be used to generate the final XML.

  • (cs) in reply to dkf
    dkf:
    pitchingchris:
    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.
    Wouldn't it be easier to structure the code as an m4 script that outputs the BrillantML file when processed? After all, it's a common and well-known tool that's ideally defined for this sort of pre-processing task.
    It's also well known that few people actually speak m4, which is one of the big flaws of automake. Other, more recent preprocessing or scripting languages would be better suited, simply because they'd be more maintainable. Even PHP would - preprocessing is one of PHP's core capabilities, it works pretty well as a generic preprocessor for any text-based format and horrible as the language details may be, PHP is very well known and finding a coder with PHP knowledge ought to be much easier than finding one with m4 skills.

    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.

  • tux_rocker (unregistered) in reply to Hans

    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 :-)

  • SomeCoder (unregistered)

    My eyes! The goggles do nothing!!!

  • Brillant (unregistered)

    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?!

  • lantastik (unregistered) in reply to DZ-Jay
    DZ-Jay:
    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.

    Agreed. If I don't understand why something was done the way it was. I don't automatically assume I know better without asking someone first. Contrary to popular belief, asking questions does not make you look stupid. In most cases, it makes you look smarter.

  • (cs) in reply to lantastik
    <?xml version="1.0" encoding="UTF-8"?> <data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <hmenu_data> <row> <hmenu_item>FIST!!!!11~~~~</hmenu_item> </row> <row> <hmenu_item>SECUND!!!1111</hmenu_item> </row> <row> <hmenu_item>TURD!!!11111~~</hmenu_item> </row> <row> <hmenu_item>FORTH!!!!!1111~~</hmenu_item> </row> <row> <hmenu_item>FIDDY!!!!1111~~</hmenu_item> </row> </hmenu_data> </data>
  • Tei (unregistered) in reply to lantastik

    Alexander, I dont like the new colors for messages background.

  • (cs) in reply to Hans

    why use XML and XSLT when you could write your own transformation system!...

  • (cs) in reply to lantastik
    lantastik:
    Agreed. If I don't understand why something was done the way it was. I don't automatically assume I know better without asking someone first. Contrary to popular belief, asking questions does not make you look stupid. In most cases, it makes you look smarter.

    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."

  • moo (unregistered) in reply to lantastik
    lantastik:
    DZ-Jay:
    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.

    Agreed. If I don't understand why something was done the way it was. I don't automatically assume I know better without asking someone first. Contrary to popular belief, asking questions does not make you look stupid. In most cases, it makes you look smarter.

    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.

  • HardwareGeek (unregistered)

    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.

  • SomeGuy (unregistered)

    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.

  • Zygo (unregistered) in reply to moo
    moo:
    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.

    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.

  • Your Name Red Asterisk (unregistered) in reply to SomeGuy

    Assuming that BrillantML supports comments. Just because it's in XML doesn't mean it's necessarily going into a real XML parser...

  • (cs) in reply to lantastik
    lantastik:
    DZ-Jay:
    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.

    Agreed. If I don't understand why something was done the way it was. I don't automatically assume I know better without asking someone first. Contrary to popular belief, asking questions does not make you look stupid. In most cases, it makes you look smarter.
    That's what comments are for though, isn't it? A nice little "BrillantML has weirdness when you try to do it in a loop, so just do it this way" wouldn't have gone astray.

    Unless of course it doesn't support comments either... :P

  • (cs)

    The real WTF is that I've just found a flaw in the "featured comments" feature...

  • (cs) in reply to Eduardo
    Eduardo:
    "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.

    Who's MAX?

    Maxx Headroom? [image]

  • Mike (unregistered)

    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.

  • (cs) in reply to j6cubic
    j6cubic:
    It's also well known that few people actually speak m4, which is one of the big flaws of automake.

    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.

  • [ICR] (unregistered)

    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.

  • (cs) in reply to pitchingchris
    pitchingchris:
    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.
    Not Brilliant. Brillant.
  • (cs) in reply to FredSaw
    FredSaw:
    pitchingchris:
    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.
    Not Brilliant. Brillant.
    Thanks, Paula!!
  • troels (unregistered)

    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.

  • Nicolas Verhaeghe (unregistered) in reply to lantastik

    Indeed. And it's not common to find presentation languages to be more spread out than business languages.

  • Jay (unregistered) in reply to lantastik

    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.

  • Sigivald (unregistered) in reply to lantastik

    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?" ...)

  • JUST ANOTHER WTF (unregistered) in reply to Sigivald

    Obviously the loop was unrolled for more streamlined execution...

  • DreamWarrior (unregistered) in reply to Jay
    Jay:
    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.
    I happen to enjoy the smokey taste of exhaust toasted bread, thanks!
  • eric76 (unregistered)

    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.

Leave a comment on “No Loop For You!”

Log In or post as a guest

Replying to comment #166340:

« Return to Article