The path of the programmer


Hello my dear reader, I have written this text because I have seen many people struggling to learn programming simply because they did not know how to study it and also because I often see teachers teaching it in a way I consider very wrong and difficult to understand.

If you want to be a programmer then first you need to understand some things:

1- It takes years of dedication to become a programmer, so you will need patience.
2- Programming is an art and in order to be a programmer you need to be an artist, so only choose to become a programmer if you really like it.
3- Programming is difficult, it requires some understanding of math, logic, algorithms, hardware and electronics, so you have to be a nerd before being a programmer.
4- Just like anything else, in the beginning it will seem super difficult and you will feel totally lost, but don't feel intimidated, as the months pass you will build up your understanding and things will start making sense until you reach a point at which everything seems so easy and obvious.
5- The right way to learn anything is to take baby steps, that means starting always from the most basic and slowly walking your way up to the complex, never take leaps because you will hit your face on difficulties that could be avoided by taking baby steps.
6- You are not gonna get rich, most programmers do not receive a lot of money, if you are looking for money then I would suggest becoming a lawyer, it is probably much easier and you will definitely earn much more.

Now that we are done with the introduction, to business!

First you need to develop the mindset necessary to be a programmer. Do your best to adopt the following points of view:

1- What is a programming language: simply a code to tell the computer what to do, it is the tool you will use to make programs.
2- Why did they invent programming languages: because programming a computer manually would be too difficult, you need some sort of abstraction layer that allows you to send a high number of instructions to the computer with very little effort.
3- How do programming languages work: it is actually quite simple, a program called compiler or interpreter will transform the language into a high amount of instructions for the computer to execute one at a time, a single line of code can be transformed into hundreds (maybe even thousands) or instructions.
4- A programming language is just a language like any other, only that you use it to talk to the computer instead of using it to talk to another person. When typing code try to see each line of code as a phrase you are saying to the computer. Here goes an example:

#include <stdio.h> // include the file named stdio.h because we will use it.

int main(void) // start the main function with no arguments and set it to return an int.
{ // begin the main function and thus the program.
    printf("Hello, World!"); // print on the screen the phrase "Hello, World!".
    return 0; // finish the program and send the number zero to the operating system, zero means everything went OK.
} // end the main function and thus the program.

The statements after "//" are just comments, I added them to this piece of C code in order to show what each line of code is saying to the computer, that is how you must visualize your code. I like to look at the code as a LEGO project, each line is a LEGO piece and I build the program by attaching the pieces under each other. Don't try to understand the technical parts I have shown so far, focus on the idea I am trying to convey.

Second you need to get the understanding of how programming works, most programming languages will look similar and work in a similar way, how you make a certain program in C will not be very different from how you make it in Python or in D. Furthermore, a programming language is just a mean to an end, so what is important is to make good software, the language you use is not very important (but it does matter, you will later understand why). Some of the most popular languages are C, C++, C#, Python, PHP, Java and JavaScript. However knowing only C++ and Python should be enough for most applications, my favorite language is D (dlang.org). So focus on the logic of how your program works (algorithm), not on the language used to implement it, although it is important to choose one favorite language for you to master it.

With all that in mind I strongly suggest you go to the website https://scratch.mit.edu/ and study this "toy programming language". It is a game that pretends to be a programming language and allows you to do lots of fun and childish stuff like animations and games. It is very well made because it is really loyal to how real programming languages are and the shapes of the pieces are the same as they are supposed to be when drawing a flowchart (a diagram to illustrate how a software works).

Learn it well, play with it a lot and make several different programs until you feel you have mastered it. That should give you a good idea of what programming a computer is like.

Now you're ready to proceed to a real programming language.

I strongly suggest you start with Python because it is a language designed to be as readable and human-friendly as possible which means you don't need to worry about the underlying set up, it sets everything up for you, you just need to worry about the program itself directly. It is also very easy to use and very powerful since it is full of resources and it is one of the most popular languages in the world. However keep in mind that Python is only easy while you are still learning the basics, once you start entering the advanced stuff you will need to have some knowledge that you don't have yet. So for now Python is only for the basics, for simple programs that do simple stuff like solving a mathematical problem and showing the result on the screen. You should study C before entering the advanced parts of Python since a solid understanding of C will be necessary to understand most programming languages that are in popular use nowadays (many are inspired by C).

In order to get started with Python you need to go to the Python official website and download IDLE which is the software you will need to make your programs. Keep in mind that from this point on you will no longer be working with colorful blocks that fit together like in Scratch, you will be working with phrases, letters and numbers because this is what real programming is like, it is purely text based.

So you will WRITE your programs, the art of programming (also called coding) is about writing. This is why I suggest you learn how to properly set up your text editor with a proper font and the proper color settings. A dark theme is preferred by most programmers since it doesn't annoy your eyes with bright lights.

Only problem is, once you are done writing your program you will wonder how to make it work, you just have to save it with the correct extension (.py in this case) and double click it (Windows environment). IDLE does it all for you when you press F5.

Try to focus on learning how to use the language to do stuff, don't try to understand how the language works yet, it is not yet the time for that, for now you will only learn how to use it without understanding how it works.

Of course once you open IDLE you will need to have a tutorial teaching you how to use Python, that is actually very easy to find since the internet is saturated with learning material for Python because of how very popular this language is.

Keep in mind that since you are still learning the basics then all programs you make for now will be purely text based, no games, no musics, no images, just text on the screen, that is the way everyone starts, don't rush it.

Once you have learned the basics of Python then it is time to start learning some math that will be required to understand what comes next. You need to learn what a place-value system is and then you need to learn binary, hexadecimal and octal number systems and how to convert from one to the other. This will seem difficult at first but later you will realize that it is actually something very simple and easy. By the way, the internet is also full of material covering this, it should be easy to learn it on your own.

With that out of the way, it is time for you to study a little bit of logic. The basics of propositional logic (one of the easiest forms of logic) should be more than enough. So practice AND, OR, NOT and XOR operations by drawing truth tables. It is actually very intuitive and this is one of the easiest subjects you will be studying.

Now get an understanding of Boolean operations. Boolean operations (named after the mathematician George Boole) are simply operations whose result is either true or false, there is nothing in between, it can only be either 100% true or 100% false. Imagine I ask "How is the weather today?", that is something you would answer with several words as in "It is sunny, humid and warm.", so it is not a Boolean operation, but let's suppose I ask you "Is the cat alive?", if you are not Erwin Schrödinger then that is a question that can be answered simply with the word "yes" or the word "no", there is no "a little bit" or "partially"… unless you are insane. This is what we call a Boolean operation.

You are probably wondering why you need to know all of that stuff when all you want to do is make your own game or your own app, the answer is: the functioning of a computer is strongly based on all of that.

Now that you have the necessary theory, it is time to get your hands on some practice. Go to the website www.beecrowd.com, there you will find thousands of problems to be solved, try to solve many of the beginner level problems. Once you feel you have mastered the art of making small programs that solve problems in Python it will be the time to move on to a deeper and more complex form of programming: programming in C.

That will be very different from the Python you just got used to and therefore you will hate it, but learning only happens outside the comfort zone. That is a language which is difficult to use because it is very old and it was not designed to be user-friendly, it was created in the early 70s when computers were for experts only and therefore languages were made for experts and not for laypeople to use. There is also the fact that each language is created for certain uses and therefore this language is very minimalist (it has very few features) since it was conceived only to be a tool to create the Unix operating system. However it is crucial to learn it because it is no less than one of the most important languages in the history of programming since it served as the foundation for the development of many others, you will later notice that most popular languages used nowadays are very C-inspired and it is also the language used to create many of the operating systems including Linux, Windows and Mac, because it is super fast. All hail Dennis Ritchie!

Download the software Code::Blocks and then search for tutorials online, saturated would be an euphemism for this language when it comes to online material. To this day I see people writing more books and making more tutorials for it. I strongly recommend this course here: https://alison.com/course/c-programming-introduction.

You are probably wondering what Code::Blocks is, it is just an IDE (Integrated Development Environment) which is simply a text editor, like Microsoft Word, however designed for the writing of code rather than text documents. Just like Word is full of features that aid you when writing a letter to a friend such as the auto-correct and the auto-complete features, IDEs are full of features that aid you when writing a software. It colors the code according to the syntax, it auto-completes the boring stuff that you have to type too often and it even gives you information about what you are typing in real time so you don't have to be opening Google every time you use a function whose definition you don't remember very well because the last time you used said function was over a year ago (that happens all the time, we often have to use a thing or two that we thought we would never have to use again).

So far I have been giving you a bunch of technical terms you had never heard of and names of people you did not know had even existed. I suggest you always google this kind of information and at least read the intro of the Wikipedia page about it.

Here goes a website that you should have in your Favorites list: https://www.computer-dictionary-online.org/. This will come in handy when you need to know the meaning of a technical term.

When using C you will have to be manipulating the RAM of your computer with dynamic allocations and pointers. Dynamic allocation becomes easy once you master pointers but unfortunately there is nothing I can imagine that would make it easy for you to understand pointers themselves, pointers are actually the hardest subject for beginner programmers, but they are the soul of programming, you can't be a programmer if you don't know very well how to use a pointer.

Once you have learned how to use C you should go to the www.beecrowd.com website I mentioned above and practice a lot just like you did with Python. Programming is like math, 10% theory and 90% practice. Never stop practicing.

There are several Facebook groups about programming languages, some with tens of thousands of users, I strongly suggest you join a few of them because that way you can get help almost instantly. And by reading their posts and talking to the group members you will learn a lot and gather experience. Having friends who are experienced programmers also helps.

Something that REALLY helps when programming is to have a cheatsheet with all of the functions, statements, libraries, features, etc... of the language you're using because it is difficult to remember so much information and Google research takes too long. You can find very good cheatsheets for several languages on https://computingthesciences.blogspot.com/2020/02/cheatsheets.html.

I suggest you deepen your knowledge about C and Python and then learn other popular languages like C++ and Java. You will find out that each language has their pros and cons and therefore it is important to know more than one of them. Then I suggest you take the time to learn how to implement several different types of algorithms, they will be necessary when making serious programs that handle complex problems. It is very important that you learn how to use GitHub well because this is one of the main tools programmers use every day.

From this point on it is all on you. You now have the basis to learn all the rest by yourself. I wish you good luck!

Comments

  1. When reading this article, I remembered my starting days. For me, programming is my hobby. 10 years ago, Electronics was my main hobby. At a point I planned to learn programming to do some micro controller stuff. But I tripped and fell in front of C. Then I started learning python. But OOP's exaggeration wears me down. at that time, my work demands some windows automation tasks. So I found a nice scripting language called AutoIt. I wrote plenty of scripts and learned some basic stuff from their forums. After a few desperate days, I learned how to read a manual and how to depend a forum to gain more knowledge. Literally we can learn 80% of things from manuals. Later on 2014, I have started learning VB. Net. Then for a 6 years, it was my primary language. I have learned the OOP stuff and all. Joseph Bolen is an adjacent professor in OHIO, who helped me to learn programming. He sent me PDF books and helped me on private chats. We met through a facebook group. At 2017 I found Nim, but lost interest when I knew about the circular module dependency problem and forward declaration problem. Nim is a horrible language. After 1 year, I found D. I didn't like it at first sight because of the semicolon and braces. So I searched for another languages and found Odin. It's a C like language with rich features. No semicolon but curly braces are there. I completed my first GUI lib in Odin, since it's an easy language to pick. When I completed my gui lib nearly 50%, I got a courage to try languages like D or CPP. So I started reading about both langs and decided to learn D. Slowly started and guys on Discord helped me a lot. And now I finished my gui lib 80%.

    ReplyDelete
    Replies
    1. It seems to me you had a very rough path to learn programming.

      Delete

Post a Comment