Monday saw our return to Makers Academy after a two week Christmas break. As well as the challenges set by Makers I spent some time on Codewars. This was good exercise, not only does it challenge you to code some interesting topics, when you’ve got it working you get to see how cleverer people have also solved it – so you can scaffold you’re learning pretty quickly.
It was a bit daunting to refresh my knowledge of the code that I’d been working on two weeks previously, to prepare for the Challenge Review with the coaches.
Which is my first learning point…
Balancing code clarity vs brevity
One of our challenges was to write our own version of Ruby’s inject method. My initial attempt was slightly clumsy, somewhat brief, but really difficult to figure out what was going on it.
Much of a developer’s time will be spent reading other peoples code – whilst developing new features or fixing bugs. So being able to understand what is going on will be highly appreciated.
The other challenge was to write a small takeaway ordering programme (including sending a text confirmation).
This was a further chance to think about Object Oriented Design as I wrote about last time. The added aspect of this was having an user interface (just through the terminal / command line). I tried to ensure that the user interface object handled purely the capture and return of information to the customer, whilst all the logic of what to do with the information happened in other objects.
I was mainly successful in this, though along with the coach spotted a couple of opportunities to improve it.
Sinatra and Cucumber
This week were introduced to Sinatra and Cucumber. Sinatra is a language that enables you to quickly get Ruby programmes onto the web and Cucumber is a testing framework (which with Capybara) enables testing for web environments.
Our challenge was to put a web front end onto the Battleships game we’d built in Week 2.
It’s All About The Domain Design
From doing this exercise it reiterated the issues around design and interface separation. Whilst I’d had a good crack at it with the Takeaway challenge, the Battleships game that Josh and I had previously written (which worked perfectly well from the command line) wasn’t so suited to a web interface.
The web is stateless
The big issue was because of something we learnt early on in the week, the statelessness of the web. This restricts how you can manage the required data and with a restriction on 4kb on session cookies, there’s not a lot you can keep in session.
Emily (my pairing partner for the week) and I kind of figured this all out by Thursday, but unfortunately that didn’t give us much time to get into HTML and CSS. However it really bolstered my understanding of domain modelling, so in retrospect was grateful for that.
It’s a bootcamp, you’re supposed to be uncomfortable
So whilst it was frustrating to get to the end of the week feeling behind, it’s a feeling I think I’ll have to get used to over the next few weeks, and it’s how the course is intended to work.
The difficulty with the pace is that nothing is going to be perfect, but perfection is not the point. It’s about getting better constantly.
At least we have a reading week scheduled for week 6, which will be an opportunity to do some learning consolidation and revisit unfinished projects.