I found something uglier than dialogscript



  • Well, first post. I just hope it will not get mangled beyond oblivion.

    I'm a Network Analyst (fancy term for a consultant-network-dude). One of my clients uses a well known (in germany at least, I heard) called UC4. It's a scheduler with event automation for datacenters, the whole setup set them back at least 20k CAD. For one server, three dialog clients, and two executors.

    While the misuse of such software consists of a WTF in itself, the... thing has a proprietary scripting language for jobs. You can usually use whatever scripting language is available on your executor for the job, coupled with the UC4 script. (On windows executors, you are limited to BAT, COM and WinBatch (whatever that third option is. And I have no clue how COM would apply either).

    The interface itself is in half-baked english-translated-from-german, which would be enough to justify a WTF of its own.

    So you work with their shitty script language by embedding UC4 script inside whatever you use by preceeding the lines with colons. Variables must be preceeded by an amphersand, (&) and terminated with a unique symbol such as a pound sign in order to not confuse the interpreter to hell when you embed a variable in a printed string. This gives crappy looking things such as:

    ! Comments are preceeded by bangs.
    :SET &archive# = GET_VAR('VARA.MAINTENANCE_OPTS','ARCHIVE')
    :PRINT "------------------------- &client# -------------------------"
    :IF &archive# = 'YES'
    :     PRINT "Archiving in progress"
    c:
    cd </pre>
    cd uc4/bin/
    java -jar -cp .;.\UC4LAF.jar UCYDBar.jar -B -S&client#
    :ELSE
    :     PRINT "Nope"
    :ENDIF
    It's the ugliest thing I have ever seen. One point worth of mention is the ability to create dialogs by simply casting :BEGINREAD and :ENDREAD. Any :PRINT statement in between will output inside a dialog box, and any :READ statement will allow you to either enter text or select from a drop down box. That's it. No radio buttons, no.. oh I don't know nothing FUN.

    For long term storage of junk such as configuration settings, you create objects in UC4 called "variables". It's like a mini database which you select the field types, and SET_VAR or GET_VAR from and to. Or just edit in the UC4 Dialog Client.

    Also, the only conditional statements you are allowed to use are IF, ELSE and WHILE.

    No no, that's it. Nothing else.

    Because of this crap, I had to write the ugliest code ever. I felt like bleaching my hands afterwards, and taking a long shower. I felt [i]dirty[/i].

    I had to iterate a loop over three objects. I automatically thought of something of the like (pseudocode):


    foreach $x('value1','value2','value3')
        command $x
    done


    But no. That was too much to ask for.

    I ended up doing basically this: (pseudocode, i'll spare you the uglyness of UC4 Script)


    $x = 'value1'
    WHILE $done = 'no'
        command $x
        if $x != 'value1'
            if $x = 'value2'
                $x = 'value3'
            else
                $done = 'yes'
            endif
        else
            $x = 'value2'
        endif
    ENDWHILE


    I felt really dirty. i still do.





  • Sounds awful.

    But what's wrong with this? :

    <FONT face="Courier New">command value1</FONT>

    <FONT face="Courier New">command value2</FONT>

    <FONT face="Courier New">command value3</FONT>

    You're only iterating over three values..



  • This specific WTF prompts me to raise a general issue: with all the
    embeddable interpreters out there, is it worth creating your own
    scripting language for a job, any job? What could be the benefits,
    apart from fun and learning? What do you think?




  • @felix said:

    This specific WTF prompts me to raise a general issue: with all the
    embeddable interpreters out there, is it worth creating your own
    scripting language for a job, any job? What could be the benefits,
    apart from fun and learning? What do you think?




    It could be usefull to create a scripting language that uses domain-specific keywords. In countries where English is not the native language, users might ask for a scripting language based on the native language. Anyway, before you consider creating your own scripting language, check out Lua first.



  • @ammoQ said:


    It could be usefull to create a scripting
    language that uses domain-specific keywords. In countries where English
    is not the native language, users might ask for a scripting language
    based on the native language. Anyway, before you consider creating your
    own scripting language, check out Lua first.




    Lua is one of the reasons why I think designing a new PL nowadays is a
    waste of time (except, as I said, for fun). As for translating a
    programming language, I've read somewhere that COBOL was designed to
    allow this, but it was never done in practice. I wonder why...




  • The reason may be that most people who learn how to write code learn english way before that, so there's just no demand.... for me, writing code in my native language (german) would feel kind of strange....

    fürjedes ( @objekte ) {
    drücke @andere_objekte, foobarisiere ( $_ );
    }



  • @halcyon said:

    for me, writing code in my native language (german) would feel kind of strange....
    fürjedes ( @objekte ) {
    drücke @andere_objekte, foobarisiere ( $_ );
    }

    Haha, hmmm I'm sure we could accomplish this via some evil preprocessor define's , except the umlauts of course. I guess it is only a matter of time until a new WTF shows up here where somebody did just that.



  • @phithe said:

    Sounds awful.

    But what's wrong with this? :

    <font face="Courier New">command value1</font>

    <font face="Courier New">command value2</font>

    <font face="Courier New">command value3</font>

    You're only iterating over three values..



    I simplified. In reality there is a rather large report with neat ANSI widgets around it being generated for each value.


  • @halcyon said:

    The reason may be that most people who learn how to write code learn english way before that, so there's just no demand.... for me, writing code in my native language (german) would feel kind of strange....
    fürjedes ( @objekte ) {
    drücke @andere_objekte, foobarisiere ( $_ );
    }


    It sure looks odd that way. Tranlating to a native language only makes sense for scripting languages very close to the domain.
    How is that:

    füralle auftrag von aufträge wo status=warte_auf_kreditprüfung:
      wenn prüfe_kreditlimit(auftrag):
         auftrag.status=auslieferung_möglich
      sonst:
         wenn auftrag.kunde.kategorie='A':
           auftrag.status=kreditentscheidung_durch_accountmanager
         sonst:
           auftrag.status=abgelehnt_wegen_kreditlimit
    Translation:

    forall order in orders where status=wait_for_credit_check:
      if check_credit_limit(order):
        order.status=delivery_possible;
      else:
        if order.customer.category='A':
          order.status=credit_decision_by_accountmanager
       else:
          order.status=rejected_because_of_creditlimit



  • @ammoQ said:


    How is that:

    füralle auftrag von aufträge wo status=warte_auf_kreditprüfung:
      wenn prüfe_kreditlimit(auftrag):
         auftrag.status=auslieferung_möglich
      sonst:
         wenn auftrag.kunde.kategorie='A':
           auftrag.status=kreditentscheidung_durch_accountmanager
         sonst:
           auftrag.status=abgelehnt_wegen_kreditlimit




    Why, you don't need a special programming language for that, just one
    that understands Unicode. The function and variable names are up to the
    programmer anyway, and the keywords could be translated using a simple
    preprocessing step. But it's much easier for the end users to learn a
    few English words - if, then, else - than it is for the application's
    programmer to arrange for the translation, so it's just not worth it.



  • @felix said:


    But it's much easier for the end users to learn a
    few English words - if, then, else - than it is for the application's
    programmer to arrange for the translation, so it's just not worth it.


    Isn't it the programmer's job to make life as easy as possile for end users, even if it means more work for him?




  • Halcyon said:

    fürjedes ( @objekte ) {
    drücke @andere_objekte, foobarisiere ( $_ );
    }

    														<br>Yes.. i had an old c++ book that translated keywords in snipets of code to portuguese (my native language). if it was the only i had, i would never be able to learn anything.<br><br>On a side note, if you feel programming in grand style try this<br><br>http://www.csse.monash.edu.au/~damian/papers/HTML/Perligata.html<br><br></span>


  • @ammoQ said:



    Isn't it the programmer's job to make life as easy as possile for end users, even if it means more work for him?




    Two sayings come to mind here: "Make things as simple as possible, but
    not simpler." and "Build a tool any idiot can use and only an idiot
    will want to use it." I mean, what's next, a computer that reads the
    user's mind? Or better yet, one that looks into the future for the
    moment when the user will have made up his mind. I mean, WTF, this
    whole "ease of use" thing is getting out of control...



    On a personal note, I started to learn English (back in highschool) so
    I could understand the messages displayed by computer games and muddle
    with Basic (Spectrum Basic... those were the times :D). If I didn't
    have that need 14 years ago, I don't think I'd be here today sharing
    wisdom with lots of nice people. That's got to account for something.



  • What if the end users use a different alphabet than the latin one - e.g. cyrilic or arabic?

    Mixing that with English keywords is not only ugly, but probably leads
    to syntactic conflicts - should the program be written left-to-right or
    right-to-left?



    Obviously knowing English is necessary for us, since we are
    programmers, but there could be scripting languages not intended for
    programmers, but rather for people from the application domain who use
    them to control the workflow of the application or something similar.



  • @ammoQ said:

    should the program be written left-to-right or
    right-to-left?


    A programming language using a right-to-left script...  now, that would be something to see!


    @ammoQ said:
    Obviously knowing English is necessary for us, since we are
    programmers, but there could be scripting languages not intended for
    programmers, but rather for people from the application domain who use
    them to control the workflow of the application or something similar.


    English is necessary for anyone, not just programmers. Ask Rutger Hauer.



    About the scripting-as-opposed-to-programming part... u wanna start a
    flamewar or what? :D Seriously, think about Lua: it was developed by
    native Portuguese speakers for people in their country. It started out
    as a (generic) data and form description language for geology software.
    The authors had all reasons to make it, if not domain- and
    country-specific, at least biased. They've chosen instead to make it as
    generic as possible, and now the whole world benefits from that.



  • @Daemon said:

    While the misuse of such software consists of a WTF in itself, the... thing has a proprietary scripting language for jobs. You can usually use whatever scripting language is available on your executor for the job, coupled with the UC4 script. (On windows executors, you are limited to BAT, COM and WinBatch (whatever that third option is. And I have no clue how COM would apply either).

    WinBatch:  Truly a WTF in itself.  It's a language using a BASIC-like syntax that's intended to do for Windows what the batch file did for DOS.  It lets you launch programs, interact with them (click buttons, enter text), etc. programmatically.  Marketed to PHBs as a nifty solution to their lack of able-bodied testers.



  • Actually, there's a piece of software over here called COGNOS (I'm not quite sure what it does. I'm not even sure what it is -- Google and Wikipedia tell me it's a buisness performance analysis/report software). All I know about it is that it's another fine piece of software that seems written by SomeGermanPeople GmBH, since the CDs are all labelled in German. It could also have to do with the fact that I work for a division of Bertelsmann Publishing, which is located in Germany.

    The thing (apart from being a pain to install and not clearly state what is on which CD) possesses an SQL-like homegrown Query/Scripting language for generating reports, or so I'm told. The software comes in three languages on the CD. (französisch englisch and deutsche. French, english and german.)

    See it coming yet?

    Yes. The language varies. The french one will be in french. The english one will be in english. The german one will be in german.

    The worse part?

    They're no mutually compatible. You can't run a report written on a French installation on an English one, and vice-versa.

    Urg. I'm starting to have a thing against German Developers.


Log in to reply