2016-04-19 Plans, update

OK, it might seem that I’ve been procrastinating on Logeox. It’s true (to some extent), but it’s not like I forgot about it or did nothing.

Thing is, I hit a wall. I thought that writing unit tests for my simplest class (which is TurtlePoint) will be a 20-minutes easy ride, and after such test training I’ll be able to write tests for more complex classes.

Nope.

Turns out that either I’m a complete moron, or writing tests for Android apps is a terribly difficult thing. The official Google tutorial is a bad joke. I found another one, which seemingly assumed knowledge of Gradle, so I stopped reading it and did some reading on Gradle itself. (It seems that Gradle is not that complicated – it’s just a make with strange syntax. To be fair, the original make has one of the worst syntaxes possible.)

Then I came back to reading on tests, and I still can’t make any sense of it. Not good. I’m not giving up, mind you, but I’ll have to think something up. My current plan is to look at some blogs of other contestants; it seems that people are crazy about TDD and related things, so it may be possible that I’ll find some clues – if not in the blogs themselves, then in the code. Should be doable, no need to despair, but it will require some time.

Meanwhile, I waited with my 6yo daughter in a line at the hospital (nothing terrifying, just a check-up after a minor surgical intervention), and I gave her my phone with Logeox installed. Guess what she said? “Daddy, could you make some unit tests for this?” Just kidding. She wanted to be able to (a) clear the screen and (b) draw animals.

This gave me an idea (besides the obvious – though missing – clear-screen feature). What if I wrote some “preinstalled” images of, say, animals, and add an feature where you could display them grayed out, so that the user could just follow the path? It’s not as trivial as it may seem (from the user perspective, not the programmer), since the path need not be connected, and in case it’s not, the 30° rotation angle may make it a bit more difficult to land exactly on the right spot before putting the pen down again.

And while at that, here’s a question: how do I store the “preinstalled” drawings? A natural choice is as sequences of turtle commands; since I want to add that anyway, I might as well do it now. I’m a bit afraid that I’m slowly acquiring a mindset of a Java programmer, since I want to do it by adding one more level of abstraction: instead of turtle commands changing the state of the turtle and possibly adding lines to TurtlePath, they will now “add themselves” to a list of remembered commands, and then either onDraw could generate the analogue of the TurtlePath on the fly each time (good enough for prototype, possible a bad idea for production), or it might be cached for better performance.

So let’s stop thinking and writing now. It’s too late today, but tomorrow morning I’m finally starting to code again. (Not that I stopped – I just added a bunch of features to one of my other projects.) It’s good that I have a clear goal now – death to procrastination!!!

CategoryEnglish, CategoryBlog, CategoryMakeYourselfKnown