Author: Matt

  • Strength Training Required

    These last few weeks have been stressful.  Trying to hit deadlines at work and hunched over a computer again at home have left me more sore than I can ever remember being.  My back is shot, and I haven’t been able to sleep comfortably for at least a week.  It’s been brutal.  Once you get past 30, your body just doesn’t handle abuse the same as it could before.

    This week I am going to be switching to a stand-up desk to see if that helps, and at home I’m going to swing the kettle bells.  If I can find time I’m going to work in a 30 minute walk everyday.  Hopefully that will alleviate things.

     

  • How to Get Things Done When You Have no Time

    This last month or so has been a hell of a busy time for me.  Working long hours, with a 1 year old at home who needs attention while trying to squeeze in social events, exercise, sleep, reading and personal projects is a lot to juggle.

    How have I managed to rock a streak of 53 consecutive days with open source github activity, learned Flask, read 3 books this month and made progress on several side projects?

    The Github streak never would have happened if I didn’t have a script to email me every hour after 5pm that I don’t have activity on my account.  This simple nag makes sure I don’t go to bed and forget to write some code each day.

    Thinking of things to code each day has pushed me to explore new ideas, practice concepts, study APIs and do tutorials. In retrospect it is astounding just how much interesting stuff you can get done when you do a little bit every day.

    A simple nag will actually make you find the time when you don’t have it.  Several times per week I find myself up later than I would have been otherwise trying to write just a couple more lines of code.  Once you start on an idea it’s not easy to let it go unfinished; it’s hard to commit code that won’t even compile.

    Activity has spiralled off from this daily coding.  A couple days of hacking on some stock market analysis algorithms got me checking Amazon for books,   which in turn got me to completely overhaul my personal finances.  On another tangent, trying to think of ideas for things lead me to a tutorial on Flask and more books on that subject.

    Want to get more done?  I’ve improved on the Jerry Seinfeld Productivity Secret with a simple script to make sure I don’t destroy my streak by being absent minded.  The knock on and compounding effects from all this daily activity has been unexpected and amazing.

  • Too Many Ideas

    I have a long, long list of software projects that I’d like to create.  Scattered across notebooks, Google docs and text files and collected over years.

    It’s unfortunate that even good ideas are worthless if you don’t have the time or capital to implement them.

  • The Tragedy of Magic Code

    escape artistThere are many software platforms that offer ‘magic’ like ways to accomplish things. Ruby on Rails has a lot magic going on – pass in a string argument and it gets automatically pluralized, converted from snake case to elephant case, inferred as a class name in the global namespace, instantiated and connected to set of URL routes.  Magic code is dangerous because it’s easy to use without needing to understand how it really works, and leads to a false sense of confidence that you know what’s going on.

    Imagine a professional escape artist.  He has 10 years of experience performing in front of large international audiences, then one day he watches a new magician’s escape trick.  He thinks he knows how it was done so he tries to replicate it.  He chains himself up, puts on a straight jacket, takes a deep breath and locks himself in a glass box filled with water.  Moments later he realizes his understanding of how the trick was done is incomplete… Now he’s in real trouble.

    That is the danger of code that works like magic.  You think you know how something works; you gain confidence that you understand it, and then it fails to do what you expected at a critical point.

    What about the beginner magician?

    The beginner magician can watch a card trick performed 100 times and may not be able to figure how how it works.  If they try to perform the trick themselves it’s almost guaranteed to fail.  You can not easily learn how the magic trick is done by just by watching someone else do it.

    Web frameworks can be like a bag of tricks where you get to tell the professional what trick to do.  “Make this form work with AJAX” can be like asking a magician to guess which card you’re thinking of.  You have no idea how it either of those tricks work.  However, you can become very adept at wielding your bag of tricks and never learn enough to create your own.

  • Exploratory Programming

    One of the unexpected benefits of free coding daily is the chance to explore solutions to problems you have to work on that day. When you write code freely without considering the use of it there is less pressure to keep a poor implementation. It’s practice that is a way to boost your understanding of the problem before writing it for real.

    There are some definite benefits to writing a solution to a problem more than once.  With each iteration you get faster and produce a better solution. When you practice and try to learn from each attempt you get better.  You gain mastery.

  • Why is it so Cold

    This week has been a difficult one for biking to work.  On Friday it hit – 35 with snow.

    Biking required the full snow suit including ski goggles.  Despite the slow slog home it still was probably more pleasant than being stuck in a car, gridlocked and worried about all the cars around that still have summer tires on just tempting fate.  I would much rather be safely off the roads.

    Over the past 3 days Calgary police were called to about 1000 collisions in the city of which at least 57 accidents involved an injury.  And that doesn’t include the number of accidents that didn’t require the police.  Trying to get a grasp of the cost of loss to property (and life) as a result of trying to drive around the city would be a very interesting exercise.

    Luckily this cold snap should break next week and the temperature will jump up by 20-30 degrees for a while.

  • Study Open Source Applications

    I came across an excellent resource last week that more people should know about.

    The Architecture for Open Source Applications is a series of books that examines how some of the best software ever written is designed.

    Programmers rarely get the chance to study the work of others in detail.  You learn the fundamentals in school but when it comes to experience building larger applications it’s not easy to pass on that knowledge in a single semester when writing the code for a large application may take years.

    The books are inspired by how architects learn by studying the designs of other buildings. If you’re tasked with designing an office tower there are no doubt countless lessons that have been learned in the past century about dimensions, materials, efficiency, best practices, capacities for everything from floor space, water pipes, air exchangers and elevators. If architects re-invented the wheel each time they took on a new project almost all buildings would be terrible.

    Software developers do often start each new project as a chance to re-invent everything themselves.  Of course this is a massive risk.  Even the best developers cannot implement the optimal solution to each an every sub problem in a large application.

    Studying design patterns get you part of the way there.  Actually seeing them used in different contexts will deepen your understanding of their value.

    Actually studying the great open source applications will give you inspiration to lean on when solving your own application design issues.

    All software developers should read these books.

  • How to Provide a Great Estimate

    Estimating the cost of developing software is difficult.  Very difficult. That’s because with each new project there are always unknowns, mis-interpretations and assumptions that are not communicated.  If the client knew exactly what they wanted then it would just be a matter of typing it up.  They hire you because they don’t know how to do it themselves.

    Agile development realizes how difficult estimations are by attempting to avoid them entirely.  Instead opting to push clients to time and materials which they have a hard time fitting into a fixed annual budgets.

    Creating an estimate that accounts for uncertainty while fitting in with businesses’ existing processes is non-trivial.

    It all starts by taking the project scope and breaking it into smaller pieces that are easier to estimate effort on.  There are risks even at this early first step that your estimate may be off.  Even with a great deal of thought you will likely overlook things.

    Agile approaches would have you break a project up into ‘stories’ and estimate on those.  I have found that stories generally have some overlap, making it difficult to understand as a line item in an estimate.  I prefer to get down to the level of code structure.

    The second thing to consider in an estimate is that with every guess you make there is some understanding of uncertainty that is not often portrayed.  Creating a login page is fairly concrete, you’ve done it 50 times and are very sure how long it will take.  Creating a custom machine learning algorithm for the application may be a bit more fuzzy. Providing a measure of uncertainty to your estimate turns your fixed estimate into a range of estimates with different probabilities.

    Actually, a machine learning algorithm is useful example to explain my next point.  A good ML algorithm can take time to train and tune and a bad one can be quick. You can take more or less time and still get an algorithm that works.  There is not only an uncertainty but also some elasticity since it is unlikely that an RFP (Request for Proposals) included stipulations on the accuracy of the ML feature.  Elastic features should exist as 2 options on an estimate. 1 for basic implementation and an other that provides a better implementation.  That way the advanced option can be explicitly accepted by the client.

    Next thing to consider is that not everyone’s estimates are equally good.  Some people are overly optimistic others tend to assume worst case, sometimes you have better knowledge that can help cut down the estimate while another person considers things more difficult.  By collecting estimates from many people you can average out their biases and with an open dialog hopefully team members can learn from each other.

    This brings up a couple of major factors that can influence a person’s estimate:

    • Anchoring bias – A person’s estimate can be influenced if they see someone else’s estimate first.  You mitigate this by having estimates done blind.
    • Optimism bias – People tend to want to impress.  It may be to stand out from the team as better, or because they haven’t thought of some of the complexity in a solution. There is a tendency to under estimate.
    • Lack of information – All estimates are made without complete knowledge.  The client likely doesn’t have all the information either.  When you don’t have all the information there is more uncertainty in an estimate.

    Anchoring bias can be dealt with through procedures that make estimates independent of each other.  Games like Planning Poker have rules to prevent anchoring bias (everyone turns over their card at the same time).

    Optimism bias is more difficult to account for.  Perhaps the best (though as of yet untested in software development) approach is to use reference class forecasting to provide some insight given historical realized costs on similar tasks.  If setting up a new server has for the last 20 projects taken an average of 2 days, but the team has estimated it will take 1 day then they may be some optimism bias in the estimate.

    Lack of information is accounted for by adding uncertainty to the estimate.  Although we don’t always know what we don’t know so some amount of unknowns should usually be added as a buffer in the final estimate.

    Using this information hopefully you can create better more realistic estimates for your clients.  If you are a client accepting bids on an RFP you should be looking for bids that detail where there is uncertainty.

  • Free Coding Caused an Avalanche

    It’s about a month since I started doing some free coding everyday as part of an evening ritual. The idea was to spend a minimum of 10 minutes writing any bit of silly code I could think of. It could be completely meaningless random bits of syntax or it could be a useful script. And after it was done I’d commit the file up to github. I even had a little script that would check github every hour after 6pm and nag me if I hadn’t committed any code yet for the day.

    Free coding started out as a bit of a struggle. Trying to think of something to code everyday can be difficult but eventually I started on some multi-day ideas. I wrote a piece of code to pull down daily stock prices for 3000 stocks in the NASDAQ one night and the next night I computed which stocks had the best one week returns for each week of 2011. (FYI: if you had bought on monday, sold on fridays and held the top 3 performing stocks each week in 2011 you would end the year with a return of 1100%)

    It got me thinking about a bigger project idea for a stock market analysis algorithm. So I wrote down some notes about it.

    Then I free-coded a couple of nights on a project template engine where you can have a template in github in which files can be written with moustache templates and the script will download it, ask you a bunch of questions required by the templates then render out the full directory structure given your answers. I spent a couple hours contributing back to an open source project as part of this effort.

    After that I got inspired by something at work where we wanted to answer a question like “which projects do we have that use service X?” So I wrote and open-sourced a library that can parse Ruby Gemfiles. It’s published on PyPI – first python package I’ve put up there.

    For the past week I have started to work on a project estimation web app. It’s still very rudimentary but when it’s finished I think it’ll be genuinely ground breaking.

    Over the course of one month I have gone from having trouble thinking of things to code, to having an abundance of great ideas I’m excited about working on.

  • How to Create a Billion $ Company in 8 Months

    If you want to get a sense of just how crazy the world of technology is for businesses that want to make money you need look no further than Slack.

    For those of you unfamiliar with Slack.  They launched a product in February 2014 which is a private communication tool for business inspired by IRC. It has quickly grown to 30,000 teams using the service sending 200 million messages per month. Now, just 8 short months after launch they have raised money at a $1B valuation.

    It is astounding growth and an amazing success.  How can you copy Slack’s success?

    1. Identify and launch into an under-serviced market.  Internal business communication tools really wasn’t a product category a couple years ago and companies made due with less than ideal alternatives like email and Skype.
    2. Look for big scale market opportunities.  Chat is something that could be used by millions of businesses world-wide. A billion users is entirely possible.
    3. Minimum Viable Product – most important word is “Viable”.  It’s easy to err on the side of too minimal and end up damaging your branding.  If eager early adopters look at your product and dismiss it, it will take a long time for them to come back and re-evaluate.  Slack was in development for over a year before it launched
    4. Create a low barrier to entry.  Slack’s integration features, and free trial made it easy to convince the boss and get buy in from the team.

    Of course if it was easy we’d all be billionaires!  Good Luck!