A nation of shopcoders

So we are back into another individual project week. We have had a week of learning basic Java, followed by a week of learning basic Android development, leading into a week of individual project work.

None of the suggested options were particularly inspiring at first glance, so I went off on a slight initial tangent thinking about what else I could do. I did think of a fortune telling app using Tarot cards, then I thought of a card playing app using Tarot cards (there are a million Tarot games). Then  I thought that was too complicated, so I was thinking of a simple trick-taking game like “The Cow Game“, a simplified version of “Aluette“.

But in the end I thought I wouldn’t go the trouble of writing my own brief and decided on one of the suggested ones:


Goal: Practice OO modelling in Java (unit tests, no UI)

You are required to build an app that allows a Shop to sell goods to a Customer. Stock and items are not important.

The Shop must be able to:

  • Make a Sale
    • The customer funds go down, shop sales go up
  • Give a refund
    • The customer funds go up, shop refunds go up
  • Report on income
    • Total sales minus total refunds

The Customer must:

  • Have a collection of possible Payment Methods:
    • CreditCard (default), DebitCard
  • Be able to select a Payment Method to pay at any Shop
  • Be able to select a Payment Method to recieve a refund onto a given Payment Method

(You may find HashMaps useful for this project)

Project Extensions

  • Add stock tracking

I thought, let’s just go boring. But I had a half hour planning session with Bobby, the other cohort members who is doing this project, and it got pretty complicated pretty quickly.



It’s going to be a challenge, but boring though it sounds, I’m getting a bit excited about working on it.

Maybe another extension could be customer complaints?



It’s Java: Deal with it

It’s Java – deal with it

This weekend we’re building a card game with Java (see what I did with the title there? Never mind …)

If you want to read a clever and accurate emotional reckoning of the week that rings true to me, read my classmate Claudia’s post for this week: Java(aagh?!).

I’m so glad we started to learn programming with Ruby, though. She was the first girlfriend who was so easy to be with that you didn’t realise you were also learning life lessons that would stand you in good stead when you tried to form a relationship with somebody new.


Oh Ruby, you were so beautiful … what happened to us?

The new cohort, Cohort 8, started this week and it’s really interesting seeing them going through the same experience we did not so long ago – five weeks, to be exact.

And, as set down by time-honoured tradition, this week Cohort 7 hosted a “pub quiz” for Cohort 8 as a social mixer. I managed to get a few very out-of-focus shots that I won’t bore you with here. Needless to say it was nothing like this:


The ladies and gentlemen of Codeclan enjoying a decorous evening’s entertainment?

Just imagine the opposite of that and you won’t be far off the mark.


There were definitely no togas.

I was on the organising committee and snagged the easiest round for myself, a general knowledge round. I made up for it on the night by hogging the microphone and making a general arse of myself which deflected some of the attention away from the shyer members of the organising committee.

I’m happy to report the night went with a swing, and unless everyone was lying to spare our embarrassment, a good time was had by all.

I could post some footage of our instructors dancing up a storm, but that wouldn’t be kind on my part. However, if it makes it onto YouTube I’ll update this post with a link. I’m not as kind as all that.

Coding Dreams

It’s a real thing, and I’ve had a couple this weekend. I’m surprised it’s taken so long, given the intense coding we’ve been doing on my Codeclan course.

On Friday night I decided to re-read The Hobbit after many years. In my previous post I mentioned that I had been caught out in an incorrect Lord of the Rings reference, and that put it in my mind to revisit that world.

In The Hobbit, the intrepid clan of Dwarves can only enter the secret door on the Lonely Mountain on “Durin’s Day”, which is described as the first day of the last moon of Autumn. (I’m sure I’ll be corrected if I’m wrong there.)


Feel free to read the description of Durin’s day here if you want to check my accuracy.

So after starting the book that evening before bed, I had a dream about using a Ruby program to calculate when Durin’s Day would fall every year and to send out a notification. I can’t remember any of what I thought would be in the program, only that I would need an API of moon phases, or something like that. But looked at logically, if you have a table of moon phases you wouldn’t need a program. But that didn’t enter my nocturnal calculations.

I had another one this morning, not really connected to anything, just a (probably imaginary) method running around in my head about how to use an .each method to iterate around something and do something terribly important. Pity I can’t remember more, it might come in handy when next I write something in Ruby!

Trial by fire

Cohort 7 has been working on their first solo projects this week.

Painting by Sergey Tyukanov

Cohort 7 tackles their individual project assignments.

We were presented last Thursday with a list of five projects we could choose from. Typically I and two others chose one of the more difficult ones* – gather votes for a Pub of the Year contest and creating a leaderboard.


I originally had the “Dancing Pony” at the top of the leaderboard until corrected by a classmate who has a better memory for Lord of the Rings trivia than me.

Other projects included complex tables and data coming in from every direction – one was making a site for the winter olympics that kept track of athletes and events, medals and points and made a results table – sounds a lot more complex, doesn’t it?

But appearances can be deceptive. It didn’t help that after spending Friday doing a load of planning, I didn’t really have any time at the weekend to work on it. So I felt like Monday morning I was just getting going, which, given we were presenting our work on Thursday, meant I effectively had three days out of the original seven to actually do any coding.

I admit that come Tuesday morning I was ready to throw in the towel. I felt that I had done almost nothing, having been delayed by my own inability to remember any of the Ruby code we had spent two weeks learning. Much of my time was spent looking up things I should by rights have committed to memory.

But one of the instructors at our regular morning stand up meeting said “You may think you’ve not done very much, but you probably really have done a lot.” And looking back, I think that’s true. But I wasn’t using my planning tools very well. I had set up a Trello board to plan out my work and keep track of where I was, but in truth I forgot about it over the course of a couple of days so I didn’t give myself that reassurance that I was indeed progressing, boxes were being ticked and issues resolved, slowly but surely. Lesson learned for next time.

And speaking of next time, it’s coming up again in 2 weeks time. We have a week of Java coming up, a week looking at the Android platform, and then the next week is our next project assignment.

Although in the end I was happy with the work I did on this project, I will need to learn some serious lessons if I want to make the next project week less stressful.

More planning, more git commits, more Trello, and more collaboration. Yeah, looks like a doddle, really …

* — Not that the others weren’t difficult, they were all bloody difficult. But this one seemed different enough that you couldn’t really learn much from the logic others were using on their projects, if you see what I mean.

Coding, games in a cave, and real ale

It’s been a quiet week in Lake Wobegon – aka Codeclan Towers in Edinburgh.

After the alligator wrestling of the first three weeks – Ruby and Sql mainly, all foreign and scary for me – we came to html, css and the Sinatra web framework. (Except it’s not a framework. Except that it is, really.)

Having worked with HTML since the web’s inception in 1996, and CSS from the early part of this century, I was finally in my comfort zone. That meant I had one less thing to worry about than the others in my cohort, and I could concentrate on getting the trinity of Sinatra/Ruby/Sql to spit out some database-driven web pages, complete with forms for adding stuff to the database – our model was a record collection, so adding artists and albums and linking them all together was the goal. I was able to do a credible job and layer some unobtrusive styling on top of it all.

screenshot of a demo music library website with content superimposed over the image of blank record sleeve.

Homepage for the website I built for homework at Codeclan

album page from a music website

Album page for the music library website I built.

Another cool thing that happened this week was a Thursday night foray to “Games are for Everyone”, a games night at The Caves in Edinburgh. This event was in its fourth edition, put on by We Throw Switches, who I admit is an outfit I’d not heard of before. But some of the games looked amazing, even if the number of people there meant I didn’t really get much hands-on time for any of them. Still a good evening out, and I’m going to download a free version of one of the games I had a look at, a text-based game called The House Abandon.

So that leads us on to the end of the week and we have our first major individual project to work on. We were given the choice of five briefs to work on and present what we have accomplished next Thursday. Wow, a whole week to work on something by ourselves! Exciting and scary at the same time. Well, “scary” may be overstating it, but sobering.

My brief is to build a web app that allows the entry of pubs and pub voting for a “Pub of the Year” competition. Pubs voting for other pubs. The app allows the registering of voting pubs and giving votes to other pubs, and compiling a league table as a result. The more I look at the complex relationships involved the more I wonder if this was the wisest choice. But at least I will enjoy the research!

I’ll report back next Friday and let you know how i got on…

The Slough of Despond

Like any pilgrim on a journey, I’ve seen some inspiring vistas and trudged through some pretty mirky swamps during my time on the Codeclan course. One of my colleagues has identified a pattern to the week – Hopeful Monday gives way to Terrible Tuesday, which leads to a distinctly Jaded Wednesday.


My typical Tuesday afternoon.

But Wednesday sees a climb up from from the slough of despond when we realise that we can find our way out of backwaters and dead ends and start to climb again. Quietly Satisfied Thursday is when everything for that week pulls together an we have a drink in the evening and congratulate each other on making it through another leg of the journey. Friday is more freeform with a weekend assignment and all day to work on it, or not. Last week we had a wee spontaneous study session in the afternoon to talk through some of the stickier points of the weekend homework.

So it’s up and down, and each Friday has seen us gain some ground, a little elevation with a better view of the lie of the land.


A Codeclan tutor puts me back on track.

Yesterday the cohort ahead of us gave presentations of some group projects they had put together in a week. It was impressive stuff. There were groups of four and five given a choice of briefs, and they had a week to plan and implement a working web application. Using vanilla Javascript, html, css and whatever APIs they could come up with.

There were two astronaut dashboards, a Munro bagging app and a disease tracker that had a nice little timeline to show the worlwide prevalence of four diseases over the centuries. Most of the data for that one had been either invented or extrapolated from less than fulsome sources. But it worked and it had a nice design, so hats off to them.

The Munro bagging app has potential to be marketable, if they can refine the local weather data a little. What’s true for the nearest weather station is seldom true at 3,000 feet, so a little cheery sun symbol could be misleading. But with some refinement they could have a nice little earner.

Our cohort has been working on getting Ruby, the scripting language we’ve been learning, to talk to a database. This is where it gets even more interesting as it’s where real-world applications can start to be envisioned.

I had some existential musings on my way to work this morning, about classes of things. Yesterday we had to create some wizards and magical items and map who has which items.

So, an instance of a class of Wizard is a person who is a wizard, in the case of my work it’s Harry Potter, Hermione Granger and Ron Weasley. But an instance of a class of MagicalItem (MI) isn’t an individual item, but a kind of an item, because there are lots of wands, broomsticks and deluminators. There are wands, broomsticks and time turners in the abstract which are instances of a larger abstract class, MagicalItems, but they are used by the wizards, which are not abstracts but individual. There is only one Harry, one Hermione, one Ron.

So what do we call an actual MI that is used by a particular wizard? I call it a “tool” so that I can have a third catgeory in my database that can refer to both an individual Wizard and a kind of MI.

For the purposes of this exercise this is a many to many relationship, in that one wizard can have many MIs and many instances of an MI can belong to many wizards. But would that only be appropriate if it was one individual MI that was shared out between many wizards? Like a class broom for example.

I know it sounds a bit silly but it shows the principals behind the exercise are tricky to think through.

So, onwards and upwards into the tornado.


The End of Week Two

So, it’s the end of week two.

I’ve given up my job at the University of Edinburgh and started a 16-week programming course at Codeclan in Edinburgh.

It’s been a bit of a leap in the dark for me. I worked at the University for 18 years so any change is bound to be personally daunting. But the opportunity presented itself to take voluntary severance, and with part of the settlement package I’ve invested in my future, so to speak.

I started the course on the 26th of September 2016, and as I write these words it is the 7th of October. End of the week two.

And it’s been hard. I knew it was going to be hard, but “knowing” what something will be like ahead of time is not the same as knowing it when you are in the middle of it. Don’t get me wrong, it’s a good kind of hard. The kind of hard when you use the parts of your brain that have lain dormant for a long time. Thinking critically. Analysing. Spotting patterns and recalling patterns. Working back from end product to process. The end back to the means.

I started training on a bicycle late last year in order to go on a 100 mile charity ride this summer past. It’s been sort of like that. You start small on rides of a few miles, and when you go ten miles you feel chuffed. Exhausted but chuffed. And the hills, sweet Jesus the hills. At first you think you’ll never make the top. You arrive there sweating, exhausted and questioning your own sanity. Why did I leave the comfort of my bed to put myself through this?

But then, something strange happens. After a month, the hill you thought would kill you becomes a doddle. You get to the top almost without thinking about it. Not without effort, but without the agony.

And something even stranger happens. You start looking out for tougher hills to challenge. Because that first hill did you a favour. It gave you confidence and self-belief. And you want more because you know now it won’t kill you, and you know the reward of going up a hill is going down the other side.

The first week of the Codeclan course eased us into the world of Ruby progamming. Like going on a mildly challenging ride of 20 miles or so. Little hills to challenge and let you get a feel for what lies ahead. By the end of the week my head was full of code : functions, methods, variable, for and while loops.

We were given pre-course work to do so some of this was not entirely unfamiliar.

Anyway, I was going to go into more detail about what exactly we got up to, but it’s late Friday night, and that’s enough for one week. Besides, I’ve got homework to think about, can’t spend any more time on non-coding activities! We’re building a karaoke bar, if you must know…

Screen Shot 2016-10-07 at 22.54.47.png