My first steps as a programmer

sam
7 min readJan 2, 2020

What is programming and why learn it?

In 2016, when I finally started working as a programmer after a full year of studying, I thought I was “starting late” (I was 21). I thought I was automatically disadvantaged, seeing all those 18-year-olds in my class who looked like they were born to code, building computers since they were little kids, speaking a language that was incomprehensible to me — a young woman going through the drastic change from teaching languages to Computer Science.

This article was written in collaboration with my great friend, mentor and computer wizard Joaquín Tumas

Three years later, I see these so-called disadvantages as a highlight in my résumé — I speak several languages, I have good social skills, I was brave enough to move from something I didn’t like to something that I was passionate about. And that’s why I’m writing this article, to encourage everyone who wants to learn more about programming, maybe even start a new career, and doesn’t know where to start. The programming world is still seen as somewhat mysterious and magical, built by nerd guys hiding in a basement — but it doesn’t have to be that way.

Although women occupied central roles in Computer Science in the beginning, today women account for about a third of students and workers in this area. In addition, many technologies, such as social media, are controlled by extreme monopolies, whose billionaire owners have power to influence what you see and buy, and even elections outcomes, as seen in several countries. To build a more just and more democratic world, I believe it is essential to cultivate and spread knowledge about how technology works, how to create and how to change the tools around us, not being simply passive consumers.

So let’s start by learning what programming is and what it is used for, some basic concepts and also some exercises for you to try at home. This is the first article in a series, so you might want to subscribe to keep updated about the next ones — and if you have any questions or suggestions, leave a comment.

But after all, what is programming?

The most common definition of programming is

“The act of telling a computer which tasks to perform.”

A computer program is a series of instructions that the computer executes. A computer is any device capable of processing code, such as tablets, phones, and laptops. The central goal of programming is to solve a problem, and usually the process involves breaking the problem into several smaller parts and using logic to build the solution. Programming is used to build websites, mobile apps and games, for example. A lot of people ask if we developers fix computers — this is not usually a part of the job.

Which programming language do I have to learn first?

This depends a lot on the type of problem you want to solve — that is, the type of program you want to create. Before I talk about this, I would first like to explain what code is and how programming languages ​​came to exist, to give this question a little more context.

The code

The code is a text we write during programming, with instructions on what we want the computer to do. Upon completion, this code will be the program and it will be processed by the computer.

A set of files written in a programming language that make up a program is a source code. These files are usually in plain text and the only difference from a source code to any other text file is the content and the filename termination:

Draft.txt — Normal text file
Program.js — javascript file
Program2.py — python file

The natural language of computers

Let’s magine that we want to communicate using only a flashlight. To transmit information, we have two options: flashlight on means one thing, flashlight off means another. You can combine these two modes to produce a sequence of signals by creating a phrase that would look like “on, on, on, off, on, off”. And you can agree with someone else that if they see this sequence, that means, let’s say, “come here”. This is exactly how the computer communicates.

This “language” is called binary, and this flashlight is called bit. A bit can have two values: 0 (flashlight off) and 1 (flashlight on). These values ​​are stored in memory units, such as the computer hard disk. When we put together 8 bits, we formed a byte:

We can only imagine how writing an entire program using only two numbers would not be very pleasant or efficient, let alone human readable. This problem became apparent for programmers from the beginning, and different languages ​​were created to allow us to interact with computers in a way that was easily understandable to someone new and also to help us to model complex programs without having to manage hundreds of thousands of bit files individually.

Interpreters and compilers

However, the computer cannot directly understand a programming language. These languages ​​need to be interpreted or converted to binary, and for this reason we need interpreters and compilers.

An interpreter is a program that takes what code written in our human-readable language and translates it into binary for the computer to execute immediately. It will continue to run until it finishes, or until it encounters an error.

A compiler is similar to an interpreter, except for the fact that it doesn’t need to execute compiled code immediately. The compiler instead generates a binary file that we can execute whenever we want. It terminates when it has processed all requested code or if it finds an error.

When all instructions have been executed — or an error is found— the program closes. While it is running, our program will reserve some of the computer’s physical resources: memory, disk space, processing power. Upon completion, all these features are available again for other programs.
These compiled files are usually called apps nowadays.

Now, what language do I learn first?

Python is the most commonly used language for learning how to code. If you’re looking for a web development oriented language, you can start with Javascript. In addition, Ruby is also widely used for beginners. All three are interpreted languages ​​and therefore accessible to begin learning because they encourage experimentation and enable rapid learning.

To start using a language, you must go to the language’s official website, download it, and use a command line interface — or interactive CLI— to write and test the expressions you create. For this example, we’re using Python, but you can also download Ruby, Javascript, or any language of your preference.

For simplicity, let’s use a Python online interpreter and start exploring. Click on the link and look at the screen: We’re using the black screen to type our code, and the green run button to execute it. Our first task is to try to create short sentences and simple mathematical operations. For this, we will use the print command, and in parentheses () the sentence or mathematical operation that we want to show on the screen. Take the example:

In the last line, we are using the + symbol and the str () command to combine sentences and mathematical operations.
When you click on “run” you should see the following result on the screen:

Our second task today is to look up a list of the most popular programming languages ​​today, and do some research about each one. You can download them from the official websites and try to repeat the previous exercise in another language. The commands and rules for each language will vary slightly — this is normal and part of the job of a programmer is to do some research and look for examples.

Photo by Alizée Baudez on Unsplash

The complete series:

Thank you for reading this far! Sign up if you want to read more about technology, traveling, learning languages and living abroad.

📝 Read this story later in Journal.

👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. Read the Noteworthy in Tech newsletter.

--

--

sam

Front-end developer, passionate about UX and Angular.