Wednesday, 10 May 2017

How I Started Programming


Genesis

My journey in programming started in 2009. Funny enough, I did not know what it was. I’ve always wanted to become a pilot, and one day, I know I will be. The thing is, becoming a pilot requires a lot of money, which I could not access at the time. But my interest in aviation never waned. I think I’ve watched almost all episodes of the program Aircrash Investigation on National Geographic. I’ve also watched documentaries on the evolution of flight from the time of Leonardo Da Vinci through to the Wright Brothers to the modern stealth combat fighters such as the F22 Raptor. Since I knew I wasn’t going to aviation school any time soon, I started thinking about the contributions I would make to the aviation industry. By the way, I also love vehicles, and I’ve watched every episode of Top Gear from the beginning right until when Jeremy Clarkson was fired and the program went from amazing to what someone would use to define the word “boring.”

Taking pencil, ruler and a drawing book, I created a design based on the F22 raptor. For some reason, I love that aircraft. It can do amazing maneuvers and has one of the best aerodynamics of any aircraft out there. But if I was to create such an aircraft, it had to do something different. I couldn’t just reinvent the wheel and hope to help humanity in any way. So what contribution was my future creation going to make to improving life on earth? I decided to make a model aircraft that would circumnavigate the earth on a ridiculously low amount of fuel: a liter. Yeah, I can see that grin on your face and you are like, “This guy doesn’t know what he is talking about.” I also thought I was crazy. But, there are many things that we take for granted today that people once thought were impossible. For example, you can Skype with someone on the other side of the world in real-time. It’s like magic.

After drawing my concept, with cameras and all other flight surfaces, I knew that my aircraft would need brains to fly on its own around the world, or at least take instructions from me. So I had to find a way to communicate with the machine. I Googled and found that the only way to accomplish this was through programming, and the problem became even worse. There were a ton of programming languages out there with a crazy amount of things that I had to understand if my plane was ever going to move one foot on its own. At one point, I even started learning how to create my own custom operating system like Macintosh or Windows. Note that I was doing all this research on my phone, and it was an old phone with physical buttons and a small screen that took ages to load a page. 

I learnt that the language that is mostly used to create operating systems is C and that C++, which is an advanced version of C, was the hype. So I downloaded a C++ book in pdf forma through my phone and transferred it to our home computer via Bluetooth. I realized I didn’t have a PDF reader and started asking around town people who would assist me with a copy their PDF reader software. I was directed by a friend to a guy who would help me with the software, who coincidentally was a programmer. I entered his office and found him writing strange things on an editor, some with different colors from others. I asked him what he did and he explained everything to me. He gave me a copy of the PDF reader program and as I walked home, I was a changed man. I actually met someone who was doing something that I wanted to do. I met someone whom I aspired to be like. 

As I read the C++ book on the freshly installed Foxit Reader program, I knew my journey would not be easy. I was just out of high school with a lot of free time and a very big dream. I did not have a compiler and what I did instead was take very detailed notes on C++ syntax and data structures. I read the book page after page, taking notes and in about a month, I had completed the 600 page C++ book. The only problem was that I hadn’t written a single program on a compiler to see everything work. Still, I had made a few solid steps towards my goal. So I went back to the programmer who gave me the PDF Reader and asked if he could give me a C++ compiler. I expected him to ask for some money in exchange for the Microsoft Visual Studio 6.0, but he give me the disc without thinking twice about it.

I rushed back home and started installing the program on the PC. However, the CD that I received had so many scratches that I had to skip installing some components because the computer could not read from the source drive. I went back to him that very day to ask if he had another copy, but he told me to give him three days. So, I went back home and continued revising my C++ notes, that were now so many, that I had two huge spring files containing notes. On the third day, I went back and found that the guy had forgotten to create a copy of the compiler for me, but since I was there anyway, he ‘burned’ me a copy. I went back home but the installation wizard was still asking me to skip installing some components because it could not read from the source. This time, though, the process went a lot smoother.

My Experience with a Compiler

So after opening the compiler and creating a C++ project, I wrote some code from my file, but I did not know what to do to run the program. So instead of wasting time, I would write code, eliminate all the errors, try to explain to myself what was going on. Then because I didn’t know how to run it, I would delete the code and write another program from my notes until I went through all the programs. After two weeks of not knowing how to use the compiler, I started pointing at the buttons in my IDE to get the tooltip text, hence an idea of what the different tools did. I came across one that said “Run.” I clicked it and the computer did some background processes and the command line launched with the words “Hello World!” And that is how I knew how to compile my first ever program. To say that I was excited would be an understatement. I couldn’t sleep. I was always on the computer writing and testing all the programs that were in my notes.

Still, I couldn’t see how what I was doing could lead me to fulfil my dream of making a model aircraft that would circumnavigate the earth. In fact, I was having a hard time understanding certain basic concepts like pointers, constructors, arrays, overriding and overloading methods among others. But I knew that I was getting close. For a person who hadn’t seen the inside of a computer science class, I knew I was doing a lot better. After understanding the C++ standard library and standard template library, I felt I was ready to start making a GUI based operating system or a program that could run on a free operating system such as Linux or Ubuntu. This program would be responsible for controlling the flight surfaces of my aircraft. However, the compiler I had installed was incomplete.

I traveled 65 kilometers to Nakuru from my hometown of Nyahururu to look for someone who could give me a copy of a compiler whose every component worked. When I got home, the compiler still didn’t work, and I had paid $5 for it, which was a lot of money back then for me since I was jobless and still living with my parents. So instead of giving up, I started studying Visual Basic 6.0, which was a lot simpler than C++ because of its GUI interface. I developed a couple of simple applications and my younger brother, Wayne, was so impressed by the fact that one could teach themselves to program. He studied the Visual Basic 6.0 language and developed several programs, including a school management system that could help schools to maintain a digital record of their students’ performance. The program could even generate report forms based after students’ performance was input.

Joining University and Limited Access to Computers

I still felt unsatisfied because I wanted to build something that would make an immense contribution to the lives of all mankind, by either helping them increase the efficiency of using petroleum or giving them another undeniably good source of energy. What I was doing, however, was making small Windows-based GUI programs. Within a short time, I joined Chuka University to pursue a bachelor of science degree in Agricultural Economics. At university, my dream of making my machine was still alive and well. However, I had no laptop and the computers in the university’s computer laboratory were slow and didn’t have any compiler installed. Several times, I had to leave the lab to excuse other students who were about to start their introductory course in computers, such as how to hold a mouse. 

I also remember that there are things that I did not understand in C++. C++, by the way was my first love in programming languages. I loved the language and enjoyed working with its object-oriented nature. So, once I went to ask a senior lecturer in Chuka University about multi-dimensional arrays. He asked me to see him that evening and when I went, he was nowhere to be seen. I went to look for him several times after that and when I did find him, he was so rude and behaved like I was disturbing him, and that he had better things to do. I talked to a couple of his students about the experience and they told me that the lecturer did not understand most of the material he was supposed to understand. You can’t imagine how empowering this was for me. There was a likelihood that I knew more than the lecturer and this fact intimidated him. 

A few months later, my friend and classmate Martin got a job as a freelance writer. Someone in Nairobi who had a few clients in the US and Europe. These clients would pay $10 or more per page to have other people do their assignments for them. One day, I was browsing next to Martin and he was so swamped in work that he requested me to write one page for him, and that he would pay me during the next class. I did the paper and forgot about it. In the next class, Martin gave me half a dollar. It was little, but it opened many opportunities for me. I started learning of the different formats APA, MLA, Chicago, Harvard, AMA and others. I familiarized myself with writing tools such as Grammarly, and plagiarism checking tools like Turnitin. I worked hard, and I was making around $240 every two weeks. I bought myself a TV, a woofer, a GoTV decoder and a bamboo seat. I felt like a millionaire. However, my performance in school started suffering because I wasn’t attending class. 

I would leave my hostel at 4 AM and go to the university’s wireless access point. There I would stay until midnight doing other people’s assignments, dissertations and research papers. I only took breakfast and dinner, and most of the time dinner was half a loaf of bread and black tea. This was my life for the next five years. I put aside my pursuit of programming and focused on something that gave me quick money, no matter how small. At the back of my head, I still remembered what I wanted to do. I still remembered that there was a reason I was alive on this earth at this period of time, and I felt it had something to do with programming and software development. Two months ago, I decided that if I waited for the perfect time to start doing what I love, I would be there for long time. So I started learning Java. Why Java and not perfect C++? Well, Java is a lot like C++ and in fact is C++’s successor. The one cool thing with Java is that it is platform independent. You can write one program and it will learn on any platform that supports Java, be it a Mac, a PC or a machine that runs Linux.

I’ve learnt the fundamentals of Java through every resource that I could get my hands on, from videos, books, articles and other websites. I decided to study the JavaFX platform, and Android, which one can use to create cool GUI desktop applications and mobile applications. I love building programs and the more I build, the more I grow closer to my goal of creating a model aircraft that will circumnavigate the earth on a ridiculously low amount of fuel. The findings of the project will have significant implications on the way engines work and on life on earth. How will I know how to work with engines despite not having attended a mechanical engineering class, you ask? Well, I will use the same formula. Reads lots of books, watch lots of videos, talk and work with other like-minded people and persist until my vision comes to fruition.

Present Day

It’s eight years since I had this dream and still, my plane hasn’t moved an inch, let alone physically exist. But I am getting there. Never give up on your dreams. They will haunt you and no matter how much you ignore them, they will follow you to the end of days. You may be doing something you don’t love because it pays your bills. However, dedicate a few hours every day to develop you dreams and work on your ideas. Every hurdle is just the universe testing how much you want something. Right now, I am about to switch my career from being a freelance writer, to a full-time software developer. This, I know, will help me understand more about computers and other machines and pretty soon, my dream will come to fruition. It is the power of the law of attraction, where thoughts eventually become things. I hope you follow your dreams and see them through. When your time to leave this earth comes, you will remember this and you will smile.

No comments:

Post a Comment