When you write a program, you’re singlehandedly building a system. The infrastructure (computers in all shapes and sizes, servers, the ‘cloud’, languages, protocols) that can accommodate these systems exists — what’s most of the time lacking is the program (the set of instructions) itself.
When you write a program using lines of code, you’re building a system that doesn’t just stay in the virtual realm. You’re building a system that transcends bits and, through mechanical electronics (mechatronics), affects the real world. (But that isn’t as important as we like to think it is anyway, since we’re getting more accustomed to living out our lives in the virtual world — reading news, talking to friends, getting entertained, booking trips, learning skills, playing games, and so on.)
To me, the beauty of code lies somewhere in the fact that it’s written, not made. You can sit in a coffee shop and write something that can make a dent in the world. Our imagination is the limit. If programmers come across something that hasn’t yet been written, they’ll write it. And so humanity inches closer to becoming a better overall system with every useful program (internet-of-this, automated that).
What amazes me the most so far since I began properly learning to code on FreeCodeCamp.com is that the classes are free. That basically means that anyone who is genuinely interested to pick up the tools needed to write world-changing programs can do so, with no subpar curriculum, for free.
Now, all you need to learn to code is heart.
The rest has been taken care of by programmers, teachers and entrepreneurs. All these people are welcoming us, waving enthusiastically at us, and yet, most of us walk away.
Worst among the lot are those who actually have a desire to take part in the tech community, but who give an awkward smile to the programmer-teacher-entrepreneurs and walk away.
I’d definitely consider myself one of them 9 months ago when I embarked on a quest to build a writer’s laptop. After graduating with a degree in environmental studies, I naively thought that I’d be able to become the business person in my new startup and somehow find the technical talent to build the product I envisioned.
I woke up 3 months ago and set aside my box of freshly printed namecards. With a heavy heart I took a day to do an autopsy of my business idea and reorganise my thoughts.
I realised my problem wasn’t that the idea wasn’t good — I still believe very strongly in the idea (but maybe in a different form factor) that writers in this age need a distraction-free, purpose-built modern tool for writing. The problem was that I couldn’t live with the idea of handing the blueprint off to someone for them to build it.
It might be a matter of ego, or something to do with ownership. I can’t place my finger on which is a better explanation. All I knew was that the product (and the company) wouldn’t be quite as good as I want it to be if I had someone else wire the chips and write the program while I was in the dark, pitching to investors in conference rooms.
Building the product entirely by myself isn’t the point. If anything, learning HTML5, CSS and JavaScript (so far) on FreeCodeCamp has taught me the tremendous power of open sourcing. Seeing ‘bunnie’ (Andrew Huang) use his open-source Novena laptop at a Hackware talk earlier in the year showed me how smart the open-source community is.
There’s absolutely no need for me to build my product myself. The need I have is to be in the know, and to not be left in the dark.
Factorialise any given number
I wrote my first algorithm today. It’s a function written in JavaScript that takes in any number and spits out the factorial of that number (5 factorial, denoted by 5! = 5*4*3*2*1).
algorithm (i/ˈælɡərɪðəm/ al-gə-ri-dhəm): a self-contained step-by-step set of operations to be performed.
Indeed, it was a trivial feat. But as the smile melted slowly away from my cheeks, I saw something beautiful about it. I had built (coded) my first small sub-system.
Staring at the few simple lines involving a ‘while’ loop and a conditional ‘if, else’ statement, it hit me that even the most sophisticated program that runs robotic arms in a car assembly line or the SpaceX rocket cockpit use lines like this.
It was a wonderful moment of clarity and satisfaction.
My simple ‘factorialise’ algorithm awoke me to something I’d never thought about before: that in order for me to appreciate the full beauty of any technology product that I hope to build, I have to understand what each line of code was designed to do. The system is everything.
(By the way, I’d venture a guess that a SpaceX rocket uses a lot of code that aren’t much more sophisticated (in principle) than what I’d written. The language might be, but the procedures are probably the same. Correct me if I’m off!)