The art and science of learning programming
Well these days, there is almost a mad rush to carve a career in technology. The younger diaspora is leaving no stones unturned to learn the fundamentals of the top ten emerging technologies. The scenario is nothing new. I still remember the time when I came out as an undergrad 19 years back. People were still trying hard to learn technology and use their newfound knowledge to crack interviews with top technology firms. It was a matter of pride if one cracked an interview with a top services company. Product jobs were completely unheard of , till you’d meet some boy wonder in a train/flight who worked with the likes of a certain Silicon Valley headquartered product company. The diaspora was happy ,etching out a career in a respectable services company and spend around a decade gaining experience building applications for client companies and grow organically. In the process they learnt some tips and tricks of management and ended up as a VP in a large technology company with an envious 7 figure salary.
However as a young programmer, barely out of college, I realised that my rudimentary knowledge in C/C++ won’t really take me anywhere. I mean I had just written some amount of code in my undergrads but keeping in mind the semantics of what actually happens in technology companies, my skills were definitely inferior in nature. I could write simple programs but never really knew how to build larger applications. Did actually try my hand at creating payment processing systems in my final year but I must shamelessly admit that more than half of the code was copied from someone else. So in a nutshell, my knowledge was zilch. I had zero skills to do a programmer’s job and by a stroke of fortune, I did end up getting an offer with a small services company. That is exactly when I figured out that a different world existed as Roberto Benigni figured out in ‘Life is beautiful’. My dissonance had led me to believe my skills were at par with what’s required, till hell came crashing on my head. I was almost like Atlas trying to balance the sky on his shoulder. It was hard because I had never designed classes or written subroutines and spoken about code optimization. It was all alien to me. It was hard adapting to something so dystopian that it shook the very foundations of my technical skills. It was like Andrew from Whiplash, trying super hard to please Fletcher but to no avail.
It was then that I came across this cult article written by Peter Norvig-the God of AI back then, about how someone needs 10,000 hours of practice to master programming. Though Malcolm Gladwell showed us the power of 10,000 hours in outliers but the theory is not backed by any psychological experiment. It is just an inference that most experts in music, writing or programming were mastering their art ever since they were kids and then by the time they entered adolescence they were already master craftsmen. Here I would like to talk specifically about programming. It is something that was always part of the computer science curriculum but no one gave it as much importance as it has gained over the past few decades and I would owe it to people like David Fincher or Mike Judge who used mediums like films or television series to popularize the tech culture although the film/series were a far cry from reality. Remember Steve Balmer shouting his guts out with his developer rant at a time when coders were considered these socially weird ,enigmatic dorks, no one really wanted to talk to.
But as much as we agree that Balmer was no visionary, we have to admit that he did figure out that one day programmers will rule the world. Marc Andreessen validated it through his cult blog ‘Why software is eating the world’ decades later. But the pertinent question that I am grappling with is how can one learn programming. There has been a bunch of books written on the topic but the answer eludes any element of rationality. So for the next 8 minutes or so, let’s try to understand how people learn programming. Let me use factual examples from my own learning journey to make my point.
To start with, let me quote my example. I primarily learnt programming by practising problems, taking part in open source projects, fixing bugs, reading code written by other people, reading books/blogs, reading queries on stackoverflow/coding horror. But most of my coding came from bug fixing and cracking problems. Now its important to understand that the feature development process is broken down into several user stories and each of those stories is typically handled by a developer. That doesn’t give one enough fodder to master technology especially when it comes to understanding the nuts and bolts of computer science. Most of what I learnt came through writing code to automate small things. It could be to check emails or scrap websites to pick up news or do something else. Building anything from scratch, gave me enough knowledge of how code worked. It also helped me understand decomposing a problem statement into several small parts and how all those parts could be independently solved to build a larger product or a feature. Once that is clear, its easy to design and develop products.
Most people can take cue from Erin Parker(check out this answer on quora) who was an arts major who wanted to design a fitness app for women. She did not know anything about computer science let alone anything related to coding. But she had enough passion and perseverance to learn everything from scratch. She did fail a few dozen times but she didn’t relinquish or languish. In the end not only she ended up creating an amazingly beautiful app for female fitness, she also managed to float a very successful company in the process. Now her Crunchbase profile reads that she is a successful serial entrepreneur and full stack developer with an interest in building iOS apps-truth is indeed stranger than fiction. In fact if that isn’t motivation enough then one can learn from Mick Haggen’s experience. Mick(read how Mick built a product in this Techcrunch article) wanted to build a technology startup but did not know anything about programming. He started learning the basics by solving problems and writing as much code as possible on a daily basis. He additionally connected with ace programmers and spent as much time as possible with them. They helped him understand the concepts more comprehensively and showed him how to optimize his code. He took the learnings and built the first version of Undrip all by himself. His sheer passion to go against all odds to build a product, set him miles apart from a lot of people who can’t go beyond a certain point to learn the things they want. Remember this article that Mark Zuckerberg had posted right after he built JARVIS his AI assistant. Zuckerberg is no entertainer but he did share is knowledge with the world and its actually quite good if one wants to understand how to build a simple AI assistant.
Now coming back to how I learnt programming apart from what I have already mentioned. I would say building a compiler and a parser with a friend really helped understand how things worked at the system level. In that meanwhile I came across this amazing book called ‘Computer Systems: A Programmer’s Perspective’. This is one of the finest books I have read that explains how the code written by a programmer interacts with the hardware. Its absolutely mesmerising to see what really happens under the hood. I did not learn anything in my engineering or on my job as I learnt building the parser and the compiler with my friend as a pet project. That was the point of inflexion for me. From there, I started participating in competitive programming challenges on the web. It was then that I discovered platforms like Topcoder where you could practice for hours on real time problems or participate in online challenges posted by tech companies. It wasn’t exactly how Mark Zuckerberg created Facemesh in ‘The Social Network’ and got grounded but it was pretty much like how Big Head graduated to being a VP at Hooli in the series ‘Silicon Valley’.
To add onto the above, I did start participating in open source projects which needed more contribution from the developer community. Writing code for these projects and getting them reviewed by some of the best programmer’s in the world, did give me a glimpse about the various coding styles, developers across the world employed to optimize their code. Joel Spolsky in his epic book ‘Smart and get things done’ talks about how a great programmer is almost a 1000X better than a mediocre one because he knows what not to write as opposed to what one can write. Clunky code takes away the user experience one can expect, and degrades performance. In fact the entire intentionality behind writing code is to see if it helps the user get the job done effectively or not. This is what Clayton Christensen talks about in his ‘Job Theory’ model. So as one starts growing in the technological utopia, one would notice how the coding style keeps on fluctuating. Clive Thompson in ‘Coders’ talks about how people who started learning programming on their own by building games and then eventually designing and developing scalable systems, discovered how their style of approaching a problem and coming up with a resolution changed with time. So after spending close to 2 decades in the industry with 13 plus years of programming experience, I found that programming is more of an art than a science. The science has limits but the art is limitless as Marc Andreessen said in his blog.
Not to digress from the original discussion, coding is an experiential skill. It cannot be taught through books or courses unless one uses it to produce a viable outcome. I remember a friend Meraj Faheem, who created the first coding school in India, talk about how he learnt coding. He had no background in technology and just wanted to help his father who worked in the stock market with an exchange rate fluctuation issue. That prompted him to learn programming and then write an algorithm to solve that problem. He managed to not only solve the problem but also managed to build a robust coding school in the aftermath of that. Today he teaches coding to small kids and is amazed by the brilliance kids show when it comes to creativity. In an interview I had with him on my YouTube channel, he explained how he helps his students learn programming by making them work on real world problems through which students can understand the outcome their piece of code generates. It is precisely the reason why Ecole 42 started with an experiential coding school in the first place. Ecole 42 invites the best of the best and subjects them to a gamified experience where students need to put in 14 hours, thinking through problems and then coming up with a solution. Students need to crack 21 levels to complete the program. At the end of 5 years or 18 months, whichever applies, the students complete all the 21 levels and are placed across the world with top tier tech firms, think tanks, consulting firms, investment banking firms and intelligence agencies. Imagine spending 5 years thinking through problems with zero faculty, zero syllabus and no exam and your mind would become unimaginably sharp to crack any technical problem thrown at you.
It was with this conception, I joined Stanford Code in Place in 2020. Stanford for the first time in it’s history had proposed the largest virtual coding class to teach python programming to almost anyone who wanted to learn. Out of 80000 people who applied, some 10800 people were picked up. I was one of the lucky ones. What was intriguing about the entire program was not that they taught python programming, but the fact that they gave you problems and forced you to think even before they started with python. I remember wracking my brains over a Karel Mid Point Problem, that took me forever to solve but the mere jubilation of cracking it was far more rewarding than anything money can buy. It also forced me to think in ways I hadn’t done over the last 4 years since I last coded. In fact coding an application is easy as opposed to solving a problem since getting a website up and running these days isn’t that big a deal. I loved Stanford Code in Place and would encourage any programming enthusiast to enrol for it. Also the sheer joy of talking with a community of programmers from across the globe is in itself a major learning experience and took me back to my programming days.
Now that I am citing, how I learnt programming in my career, it would not hurt to mention that I spent a good amount of years in Europe in the first leg of my career, working for FedEx. In that meanwhile, I remember I had an Israeli engineering manager. He would sit with me and walk me through the entire code base on perforce and explain the entire architecture to me through the code written. Those 9 months spent with him gave me a comprehensive idea about how algorithms are written and how does one optimize code. Pair programming too with another programmer helped clear a lot of doubts around the technical architecture of the product. We were using Core Java with Struts with different datasources(relational, OLEDB). Imagine sitting in a plush Belgian office in the middle of nature, coding for close to 10 hours a day. Life can’t get any better. In fact that was the phase I had to study database internals a bit and then using them in real time with the code written, made me see things which I was absolutely oblivious to. It was a moment of epiphany for me. I was mesmerised with databases and how effectively they store and pull information. It actually prompted me to take my next job in a BI company which was something really new to business.
So if I were to sum up my experience of learning programming, I’d attribute most of it to using those skills to building things and fixing bugs. In fact that is how most self taught programmer’s learnt writing code. There is no other way, one can learn coding other than trying to build things. Now with a half life of around 6 months to 2 years for a particular skill, most skills that one knows today, won’t be relevant tomorrow. So now when I come to think of it, coding as a skill is experiential like most skills we learn in our lifetime. One needs to use it to solve a problem and only through a series of failures, one learns how the system works. We learn walking on our own by falling several times in the process. We learn cycling by again falling several times and breaking our knees in the process but that is how we eventually pick up balance and ride our bicycle to glory. Similarly coding like any other skill, needs to be used to solve a problem. Remember Kevin Mitnick, one of the most notorious hackers, the world has ever seen, talk about how he gamed the government systems just for fun. His gratification came through small mischiefs and that prompted him to take up a career as a notorious hacker or a cracker in the initial part of his career and then subsequently as a security researcher.
If you’ve seen Mr Robot, you’d find sometimes coding is not merely a job but a way to change the system. Its called hacktivism globally and one of the shining knights of hacktivism is the late Aaron Schwartz. He battled with the US government to change things and make things more open and when things reached a boiling point, he committed suicide. But what is noteworthy is that Aaron left us a bunch of useful code that is still being used by folks across the world. In one of his interviews, Aaron expressed how he learnt programming. It was through an urge to solve a problem that he had seen and wanted to solve. He wanted to solve problems and wanted to use technology to make information accessible to everyone. The point I am trying to make has to do with intentionality. Most self learnt programmer’s over the past 50 years have learnt programming on their own to solve a problem. Life has just become a bit easy these days because of the sophistication of high level languages and storage becoming ultra cheap and universally accessible, thanks to cloud computing. Having said that, it is important to understand the basic building blocks of computer science comprehensively- namely Algorithms, Data Structures, Programming Languages, Operating Systems, Databases, Information Theory, Automata. One needs to know how these topics are applied in solving real world problems. Now with platforms like Kaggle, HackerEarth, HackerRank, LeetCode, AlgoExpert, Skillenza, one can actually crack problems to see where they stand in terms of their skill proficiency.
Once a person can code highly scalable applications effectively, the person is ready to be taught the math behind emerging technology. As Clive Thompson mentions in ‘Coders’, that creating an AI is a completely different job than creating a website or an app. The singular reason that plays out is because its still unknown how AI would behave. A recent example would be the way two Facebook AIs started communicating in a overly bizarre language. It almost seemed like Skynet talking to JARVIS. As much as Musk warns us about how AI will take over the world, we need more and more AI researchers and engineers to understand the space well. It could only happen if we already have a pipeline of talented programmers who can then jump not only the AI bandwagon but other emerging tech as well. Remember this video where Pranav Mistry showed how ‘Augmented Reality’ worked. This video evoked enough interest in augmented reality that led to the formation of billion dollar products like Google Glass( which died a painful death) and led to the creation of companies like Magic Leap. The innovation economy would need more and more thinkers, but for that to happen, we need people who can understand math and code. That can only happen in an experiential way and not through some course or a book unless it is Hogwart and Professor Dumbledore can wave his wand and ensure Harry becomes an ace programmer or unless you are Trinity(from Matrix) who can upload all the coding skills required and become a start coder in seconds. For the rest the path is difficult yet interesting. It would force one to think but didn’t Descartes say,”I think therefore I am”. Good luck building your technology career.