rednite (rednite) wrote,

MedState (MED-PC): The worst language in the world?

For my psychology research project, one of my tasks is to write a program to control the 'cages'. The problem is that it is using a scientific package called MED-PC, which incorporates its own programming system (MedState) to control the associated hardware units (which it supplies), and so forth.

All that would be fine but for one thing. The programming language is the technological equivalent of a cat that died in your ceiling, half-decayed, but somehow never got any further. It is ugly to look at, it smells bad, but somehow it will not just fade away into nothing.

With so many languages available now - C, C#, D, Python, Perl, Lisp - hell, even Basic would make this crap look good - why would they persist in using this archaic pile-of-rancid-turd language. My bet: backward compatibility.

Just to give you a taste of what I'm suffering through, I'll give you a brief sample from their training documentation, and annotate it for your suffering

\ This is an FR schedule  (a singe \ denotes a comment.)
\ This section is for inputs
 ^RightLever = 1 (a ^ denotes a constant. They are integers between ~32k and ~-32k. Nothing else. Need a float? Sorry, too bad.
 ^Reward = 2 \ at output 2 is a pellet dispenser

\ Defined variables: (Note you don't actually declare variables as such. These are just comments to make you  a happy kitty. Not mandatory.
\ A = number of responses
\ B = number of rewards

S.S.1, \Main control for house  (Note that S.S.1 roughly equates to a thread - you can have *gasp* 32 of these suckers (I think). Yay!
S1, (This indicates a 'state' - you have have <32 of these in a single S.S. They are like 'goto and loop' in code. Kinda.
#START: ON ^Reward; --> S2 (this indicates this is the program entry-point (having the #START:). It tells the system to turn ON the output with number ^Reward; that is, the snack dispensor.

S2, (subsection of program 2. Remember, we are blessed with UP TO 32 of these little wonders. Maxmimum).
  #R^RightLever: ON ^Reward; Z1 --> SX (When the right lever is pressed once, give a reward, then do nothing much. You have to have the --> to tell it where to go next; SX is basically a 'go nowhere'.)

So anyway, after hundreds of lines of this garbage, one generally will want to kill oneself, and frankly, I think rightly so.

I'm actually pondering writing a translator so I can write in something that doesn't make me want to kill myself, and have it translate into nightmarish hell-code.

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic
  • 1 comment