On Code Comments

Actual source code from Microsoft Word 1.0 for DOS

Actual source code from Microsoft Word 1.0 for DOS

This post is basically a bookmark for me to come back to and remind (berate?) myself regularly about my comments that I write in my code.

Not that I should do more. I actually put in a heck of a lot of comments in my code, because I know my memory is poor.  Especially so when I have done several late night programming sessions in a row.  I once even completely forgot that I had written an entire application after a month of sleep deprivation.

What prompted this post is the fact that I often find myself coming across lines or blocks of code that are commented out.  Without explanation.

Just today, I had to go back into some 2 year old code, because a client had reported a possible bug that wasn't bringing pricing across properly from their legacy system.

It took me a while to re-understand my code, and that was helped by the copious comments I had left, knowing my own mental fallibility.  However, when I finally got to the section of code that did the pricing import and looked at it, I immediately knew what I needed to do in order to effect a fix.  BUT then... I noticed that there was already two lines of code EXACTLY like the ones I was about to put in.  Only they had been commented out by me previously.

Why?? What made me comment out those two lines in the first place?  Did they introduce yet ANOTHER serious bug in the system?  There was no notation as to when the lines were commented out, nor any indication of WHY I had done so.

The 'when' is an easy fix.  I just need to go back through my version control system to work that out, but the 'why' is an altogether more puzzling conundrum.

I'll be sure to leave some comments in this section of code reiterating my journey to write, then comment out, then uncomment the alleged lines.  Perhaps in another year or so, I will come back to it and have to unravel this veritable Gordian knot of commentary.

App #3 - Spotto

Ok, just submitted app number three to the app stores yesterday.  This time, a gaming app called Spotto.  This app is basically a rehash of the old kids game we used to play when we spotted something that was pre-designated during an outing or a road trip, and the first person to call 'Spotto!' won a point.

Well, with this app, any player can create a game, which can be for spotting ANYTHING at all - whether it is a brand of car, colour of show, breed of cat, style of architecture - whatever.  Other players can join the game, and then post pictures of the said items.  All players in the team can approve or dispute entries, and points are awarded for approved entries.

The game is open ended, and self regulated.  It was an especially challenging one for me to write, as this was the first time I was using a NOSQL database (Firebase, from Google).  After years of SQL programming, getting my head around NOSQL structures and capabilities was a real challenge, but I think I got there in the end.

The other thing was that this app was designed to be fully real time - i.e. as soon as an entry was entered on one player's mobile device, the other devices all updated at the same time.  This was also quite challenging, however the Firebase API helped a lot with this.

In the same vein, I had to get my head around push notifications, and also use Facebook login authentication for the first time.  All fun, but it all came together fine in the end.

Spotto should be available in both stores by the end of the month.  In the meantime, feel free to visit the Spotto website for more information.

What challenge for 2015?

Well, I cannot believe that it has been two years since I restarted this blog.  I know I was a little slack in updating it last year, but that is one of the things that I plan to fix this year.  Publish more!

So rather than do the usual 'resolutions' for the new year, I am going to set myself some challenges, and make them public so that there is some accountability out there.  Here goes:

Challenge 1: Read more books - real paper books.  Dig into some classic literature, as well as revisit some of my old fantasy genre collections and enjoy holding real paper in my hands and visiting other worlds in my head.

Challenge 2: Set up multiple passive income streams via the various app stores.  Get enough apps out there and selling at a steady rate so that I can have an income stream to meet the basic bills.

Challenge 3: As part of (2) above, I am going to try and write and release at least one app per month in 2015.  My objective is to release several into the wild and see if any take off.

Challenge 4: Write an eBook.  About my experience as a 'lone wolf' programmer.  I have been through the ups and downs for three decades now, so hopefully my experiences will be of use as a learning tool for another up and coming 'lone wolf'.  This is also a part of (2) above.

Challenge 5: Reconnect with friends again.  In the past couple of years, I feel like I have drifted apart from many close friends.  I need to step up and take an active role in re-engaging with old friends and enjoying their friendships again.

Game on.

Keeping the momentum going!

Well... Last post I mentioned about the app that I wrote in under 2 weeks and submitted to the app store.  It turns out that once you get the ball rolling, it is mighty hard to stop.  Which basically means that in December 2014, I ended up writing not ONE, but TWO apps and submitted to the app stores.

After I had finished development on BlissBank, I was on a high.  Intellectually and energy wise, I felt like I was crackling and needed to keep those creative juices flowing.  So even as I finished hitting the submit buttons on the app store, I was starting to create the framework for another app - MusicKata.

MusicKata is closer to my own heart, as it combines my passion for music and programming.  I have always struggled with practicing the songs I want to learn on guitar, especially complex fingerstyle or classical pieces.  Once someone said to me - "Wow, you must have spent HOURS practising that piece!".  To tell the truth, I hadn't a clue how many hours I had spent on it.  I guessed maybe 20 or 30 hours, but I thought it would have been good to know an accurate figure.

That is why I wrote MusicKata.  'Kata' is the Japanese word for a form or a practice routine, and I thought it would be apt for this app which helps you to track your practice time over many pieces, as well as help you with that practice via providing a steady metronome for scale exercises etc.

The other thing that I thought I would like to know is an exact measure of how much I have improved over those practice sessions.  I thought that it would be nice if I could go back in time to hear just how bad I was at certain sections back in the early days - if only to reassure myself that I *was* getting ahead now.

So, MusicKata has the ability to record short snippets and store them against the piece, so that you can review them later.

Hopefully this app will be ready on the app stores in January 2015.  I feel elated to have accomplished so much, yet a little mentally fatigued after an intense month of programming.  I am not sure if there will be a third app issuing forth in the near future.