2 ms·
I wanna expand on this, in relation to Hadean Lands. I wrote HL in Inform 7. Could I have written the game in a more traditional IF language, such as Inform 6?
by zarfeblong 12y ago
I wanna expand on this, in relation to Hadean Lands.
I wrote HL in Inform 7. Could I have written the game in a more traditional IF language, such as Inform 6? (I6 is C-like.) Answer: yes, but it would have been a bunch more work and a lot more frustrating and painful.
The English-ish syntax of I7 takes some getting used to. Yes, you have to free yourself of any attachment to brevity. I7 code is verbose. The hidden benefit is that it's very easy to skim through and re-read. All code is write-once-read-many-times, right? You may be comfortable with "gruecount++", but "increase the grue counter of the location by one" is just as intelligible (and more so for people who didn't grow up on C).
The real strength, for me at least, is I7's rule dispatch model. Big swatches of HL's code look like this (yes, an exact quote):
Ritual-processing rule for rit-speaking anaphylaxis-word when at RSChymicStart and the bound of rstate is the retort and the reservoir comprises grey-acid-subst and the retort contains exactly perfect-diamond: [...]
I've got hundreds of these little code snippets, and I trust the compiler to stitch them together into a working state machine. If this were I6, I'd have to write giant functions and collect these snippets together -- in the right order, etc. If this were an OO language, I'd go crazy deciding what object each snippet is a method of. I7 just takes the above and runs. (Okay, I have to worry about the rule ordering a little, but I7 mostly gets it right.)
(You can see that I've forced some brevity in, by careful definition of the words "at" and "comprises" and "contains exactly". I like hyphenated-symbols too. Those are personal style choices.)