Category Archives: Free coding

For software developers there is an unhealthy prevailing belief that being a great programmer is some innate skill that others have. Brilliance with developing code is difficult to train for because it either requires some gift you don’t have or years of on the job experience.  There is a large amount of impostor syndrome within the community which is not healthy or productive.

Of course people who are top developers know that it takes a lot of hard work to understand core concepts. It helps to have a mentor and a solid education and access to training.

There is a tactic to getting better which more programmers should be using.  Deliberate practice is the most critical aspect to improving any craft and programming software is not an exception.  Like playing piano or painting or ceramics there is creativity and technical skill which can be improved on with deliberate practice.

If you want to get better at your craft it is not good enough to simply work on job tasks. For work you typically do something once and then it’s done, there’s few opportunities for repetition and critical evaluation.  If you were learning to play piano and you had a sheet of music the equivalent to developer workflow would be to play through the song once, stopping to go back and fix your mistakes then when you finished you’d put the song away move on to a new song.  Practising piano requires playing the same song hundreds of times, you start by playing and focusing on not making mistakes, when that is accomplished there is still practice at making the song sound good with appropriate pedal usage, tempo and dynamic, and finally when that is good enough you can continue to practice the same song and add your own touches – arpeggios, slurs, delays etc.

How many times have you implemented a deck of cards?  Can you write one top to bottom without looking up examples on stack overflow, or querying the documentation or searching through code completion lists? Could you write a deck of cards in a procedural, functional and object oriented styles?  Could you meta program a deck of cards? Could you make a deck that is thread safe? distributed? Web scale? Obfuscated?

Practice. Do it often, and do it deliberately.

My recent experience with daily freecoding taught me a lot about learning programming and about how you learn new skills.

There were several types of freecoding sessions that I did and each of them proved useful for different reasons.

I had a handful of memorized programs one of which was to program a deck of cards, shuffle the deck and print them all out.  I memorized this and practised several times recalling the whole program and typing it as fast as I could.  Getting fast at this reinforces basic syntax, it improves your muscle memory for typing and helps add to a repertoire of coding patterns that can be recalled quickly.  Since the bulk of programming day to day is loops, string manipulation and parsing, this type of practice can greatly improve your productivity.  However, it doesn’t help with your ability to solve problems.

Other days I would seek out a problem.  Rosetta Code is a good resource for coding problems that can usually be solved in just a few lines of code.  I’d find something that sounded interesting, implement my solution and then compare to the published one. This process helps with your ability to produce code that can do what it needs to do, but also by then reading other people’s solution you often learn about nicer or more concise ways to implement it.

The final type of freecoding I did was to find an interesting library or package I wanted to try out, and implement some examples with it.  From a learning to code perspective this doesn’t help a lot.  Much time is spent going though documentation and the temptation to copy and paste is high.  It did, however, let me explore a lot of variety and learn about some specialized things – such as what you can do with special non-printable terminal characters)

Some ideas I have to make the experience better going forward would be to add a scheduling component.  We remember things better if we try to recall them just before we forget them.  This is the concept used in Spaced Repetition Systems (SRS).  Applying this to a learning system for coding might include a development phase where you create a new piece of code that introduces new concepts and then a handful of recall sessions where you try to re-implement one of those previously created programs at a later date.

My recent camping vacation is what broke an epic 253 day streak of github commits.  Overwhelmingly this activity was a daily practice of freecoding to see first hand just how effective it could be at getting better at programming.

Freecoding is based on a writing technique called free-writing which is supposed to get the juices flowing and eventually lead to you developing a faster thought to fingers connection for getting your ideas out.  It is a popular practice for authors, but has never become something that programmers took up.

With a bit more extensive experience now with the process and it’s effectiveness I can draw some conclusions about how it works and where the difficulties are.

By far the biggest difficulty is trying to think of something original to write every day.  Unlike story writing where you can ramble out words with markov chain like inspiration, the strict syntax of programming forces you to think ahead about what you want the program to do.  I also found it psychologically difficult to finish a program that had syntax errors.  Finally, writing a script is not always easy to to linearly and jumping around the code provides an interruption that can stop the flow of thoughts.

There were a lot of positives though.

  • Finding interesting things to program everyday inspired me to keep a list of interesting projects and try them out
  • It gave me an excuse to test out things like how threading is limited by the GIL in python which I hadn’t run into with my job
  • was able to scour through the standard library and uncover some features that I now incorporate often into my code.
  • got a much better handle on parts of the language that I didn’t use often such as functional programming
  • took time to try some popular libraries in areas I don’t usually get to deal with (mathematics, graphing, and machine learning)

Through this practice I feel like my knowledge of Python was able to reach a new plateau.  Learning by doing and practising everyday is a tremendously good way to improve.

if you are curious what kind of code I wrote everyday for 253 consecutive days it’s all on my github account.

Programming is a great mix of both the creative and technical skills. Problem solving on a daily basis makes it one of the best jobs imaginable. Staying ahead of the technology curve and continuing to get better at your core skill is what differentiates an average programmer from the superb.

The three most effective ways I have found to get better at programming is

Read Books

The quality of a curated, professionally edited book written by a talented author is hands down the quickest way to learn something new. If you want to pick up a new language, framework or learn new concepts reading at least one book is a good start. I am always reading at least one technical book.

Practice Programming

I write code at a full-time job for 40 hours / week. That isn’t practice and professional experience doesn’t provide many opportunities to actually get better. Deliberate practice for software coding can come in many forms. Learning a new language? Try solving the Rosetta Code problems. I believe some of the Basic Computer Science algorithms should be committed to memory – for example – being able to code merge sort quickly because you ‘know’ it rather than having to figure it out.  Practice writing Software Design Patterns and code idioms until they become second nature and intuitive.

Peer Review

Often you don’t know what you don’t know.  In these cases having someone else review your code can really open your eyes. However, in a work environment peer review often turns into a cursory sanity check, or after a while you have managed to learn all you can from the colleagues who typically review your work.  Venture into the world of open-source by making pull-requests.  This will introduce you to a wider community of developers where you have the chance to learn some new perspectives.

Free coding is the practice of writing code quickly off the top of your head.  It should be done as part of a daily ritual for at least 10 uninterrupted minutes.  The goal isn’t necessarily to produce something useful or even complete.  You should strive to open the taps of originating thoughts in your head and pouring them quickly into a text editor.

Here are five reasons you should be free coding:

Continue reading