Coding Dojo #11: Javascript Isola
In our latest coding dojo we attempted to code Isola in Javascript but instead of coding from the board inwards we decided to try and take the approach of coding from the cells outwards to keep it interesting.
My colleague brought in his copy of the game and it made it much easier to imagine how we should be modeling it by having the game in front of us.
The Format
We used the Randori approach with four people participating for the whole session.
What We Learnt
-
We tried out a couple of Javascript frameworks during the session - JSUnit and another one which is the testing framework used by the Prototype library. I’ve been using screw-unit on my current project and neither of the frameworks made test writing seem as fluent as it does when using screw-unit.
-
IntelliJ is a way better editor for writing Javascript than Visual Studio is at the moment. It was really cool that we got auto completion when writing the code (although the auto complete function does currently give you the opportunity to call any method within the project’s Javascript files even if it’s not valid!)
-
We had a copy of Javascript: The Good Parts with us which proved useful for showing us the right way to go when it comes to coding in javascript. Certainly trying to understand the meaning of the keyword 'this' was something that we didn’t find easy and I still don’t really understand what the 'with' keyword does despite reading the definition several times.
-
Modeling wise the approach we took provided a a much more interesting problem to solve - we were keen to avoid ending up doing a lot of string manipulation as we had on our java attempts at solving this problem. We got as far as telling a cell to remove itself from the board and were implementing the functionality for the cell to inform adjacent cells that it no longer existed.
-
I hadn’t realised quite how easy jQuery has made it to do javascript work until this dojo. We were writing pure javascript which proved to be quite arduous although the code did read quite nicely once we got going. We’re planning to investigate whether jQuery would be useful for this type of coding or not.
For next time
-
I won’t be able to make the next couple of dojos but the plan is to keep working on the Isola problem in the next session.
-
I am also keen to try out Keith Braithwaite’s TDD exercise in one of our dojos, an idea which I came across from reading Gojko Adzic’s blog entry about the Software Craftsmanship Conference held in London last week. Briefly, the idea is to try to keep things simple - implement everything inside our test and then extract it out into classes and methods when necessary. Small steps is the order of the day.
About the author
I'm currently working on short form content at ClickHouse. I publish short 5 minute videos showing how to solve data problems on YouTube @LearnDataWithMark. I previously worked on graph analytics at Neo4j, where I also co-authored the O'Reilly Graph Algorithms Book with Amy Hodler.