The other day I added a bunch of code and then decided it wasn’t useful after all. I tried to revert my work, and discovered I hadn’t committed before adding the code. It was a joy sorting that out.
That absolutely makes sense. Been there. Unfortunately I’m “team trackdown”. Maybe I should unlearn this habit.
Compiling often is essential … and not to start a flame war or anything, but this is one of the areas where TADS 3 is quite definitely superior to Inform. Compiling in Inform takes at least five times as long (each time you do it), because Inform has to reassemble all of the rulebooks from scratch, every single time. In T3, the compiler makes intermediate files out of your source code files (and you should plan on having many source code files, not just one), so only the files that have changed since your last compile have to be rebuilt. If you’re compiling every five minutes, the difference will save you as much as 15 or 20 minutes every day.
If I understand the matter correctly “compile every little change” makes bug hunting (even with obscure error message) relatively easy. Or am I wrong?
It makes finding the errors easier. It may or may not make fixing the errors any easier – depends on the nature of the error.
But it narrows down the possible reasons? Which makes fixing less difficult. (I said “less difficult” instead of “easy”)
For me, it’s almost always a missing colon or semicolon. Or if it’s not my punctuation, it’s my spelling: I’ve mistyped an object name somewhere and Inform can’t work it out.
I’ve learned that the documentation is useful, but takes a bit of wrangling sometimes. Inform 7 gives you a couple of tiny little search boxes in the top left corner for finding things in the source and documentation. (At least, the Windows IDE of what’s now Inform 9.3 does. I haven’t upgraded yet because I don’t want to risk breaking the project I’m working on.) I’ve found it much more useful to search the whole documentation for some likely keywords than it is to look through the general index or the list of examples. Sometimes the exact code that I need is in there, but tucked away as an aside in an apparently-unrelated section or example game.
I’ve also got a scratchpad Inform 7 project for testing things. If I’m getting an error I can’t diagnose, I’ll open the scratchpad and make the smallest possible game I can using the code that I’m pretty sure is causing the problem. If it breaks in the same way, I know that the problem is with that code and I can tweak it until I get something I can add back into the main project. (If it doesn’t break, well… too bad. At least I’ve ruled out one possibility.)
The latest builds now let you use older versions of the compiler from the latest front-end: in the settings tab you can use either the latest compiler, 9.1, 9.2 or 9.3.