How to Start Programming with Zero Experience
2020-09-11 12:34:20 |
So you want to be a programmer, but don't know where to begin. Or maybe you just want to automate parts of your job. You may not even have a specific goal in mind. You may be thinking this is going to involve a lot of math and sitting in front of a computer screen. Or you may be wondering how long it's going to take to actually get good at coding. Don't worry.
This guide is going to answer a lot of questions you might have about programming. Firstly, concerning how long it will take to get good... generally, it takes about as long to learn as one of the easier spoken languages. You might be able to say a few phrases within the first day, but to develop real fluency could take months. And yes, it will involve some math, but not as much as you might think.
Is Learning to Code Worth It?
Yes, learning to code is absolutely worth it, even if you aren't in the IT field. Chances are, you're reading this article on a computer — a machine with vast amounts of processing power. With just a basic level of fluency in Python or Bash, you can have a fleet of tireless bots at your disposal. You have the ability to automate tasks, perform calculations, mine data, scrape websites for information, process large files, measure the environment, visualize information, and the list goes on. And you can accomplish everything mentioned here with simple scripts.
Do I Need to Go to School to Learn How to Code?
No, there are many self-made programmers working at Google, Facebook, Apple, and a variety of other companies. Some have even started their own companies. There are tons of resources available to help you learn. We even offer private tutoring at Codebox Systems.
Where Do I Begin?
This guide is a good place to start. Our focus here is to teach you some programming fundamentals, without bogging you down with too much technical jargon. If by the end, you feel lost or overwhelmed, contact us using this form, and we will steer you in the right direction.
What Skills Will I Develop as a Programmer?
Programming will challenge your problem-solving, reasoning, deduction, and debugging skills. And depending on the specific IT role, it may not get more complicated than that. Most websites, for example, don't require you to flex your calculus, trigonometry, algebra, or even multiplication skills. Rather, you'll be working with data and rendering it to the browser. This involves fetching data from a service, understanding REST API documentation, structuring HTML, and styling with CSS. Backend services and databases, on the other hand, are a bit more complicated, but still won't be flexing your calculus muscles.
Whether you're a web, software, QA, or infrastructure engineer, many challenges can be avoided by having clear requirements, mapping out all possible scenarios, writing clean code, following best practices, and testing your code often. The most challenging math is usually reserved for game engine developers, quants, security engineers, and researchers.
With that said, the more fundamentals you learn, the better. You'll find it's easier to utilize libraries, having a sense of the underlying components. You'll have the ability to write your own libraries that are more performant. You'll even start to develop a sixth sense for bugs and issues in the code. Sadly, there is no shortcut to developing this intuition. But once you do, you begin to feel your way through the code and intuitively know what's causing your program to crash. Until then, expect to stare blankly at the screen, wondering if you have a misplaced comma or quote somewhere in your thousands of lines of code. Yes, one misplaced comma could bring your whole program crashing down. Does this sound like a nightmare? It is, and we all go through it. But the more you're exposed to these scenarios, the easier it will be to get out of them, through brute force, by repeating the following steps over and over again:
- Write code.
- Break code.
- Google the resulting error message.
- Fix code.
Really, it's that simple until you develop a searchable index of solutions in your head. To study all of these at once would be far too overwhelming and, frankly, a waste of time.
It's ok not to know how everything works, under the hood. And as much as you try to avoid it, you'll form a few bad habits in the beginning, but you'll also break those bad habits and develop good ones. And even after you've organically memorized solutions and discovered patterns, you'll still be Googling. Why is that? Because technology changes so fast. There's always a new language, framework, or programming methodology to learn, and not enough documentation.
Accept the fact that you're about to embark on a long journey. There is good news, however. With this series of articles, you'll be speaking your new language within the first day. You will write your first program today.
Your First Program
Try It Yourself
Click the "Run" button above, and you should see "Hello world!" displayed to the console. Now change print('Hello world!'') to print("I am alive!") and click the "Run" button again. Congratulations, you've written your first program with the Python programming language.
To instruct the computer to print messages to the screen, we enter a word or phrase, within quotes, into the print() function. A function is just code/instructions that is packaged into a name we can call whenever we want to execute that code. So with the print() function, we don't need to worry how it does its job or how many lines of code are involved. All we need to know is that if we pass a phrase into this function, it will print our phrase to the console. This is otherwise referred to as a black box. We don't need to see what's inside. We just need to see what goes in and what comes out.
It's very easy to create our own functions. We'll get to that, later. Before we go on, we should explain the if __name__ == '__main__': code on the first line. For now, just think of this as a way to tell Python that this is the main entry point of our program and that it should execute everything within. We explain this in more detail in one of our tutorials, but you don't need to be concerned with those details, now. With any programming language, you're going to see some strange syntax, once in a while. Our goal here is to ease you in and get you fluent, as soon as possible.
Now, let's talk a bit about why we're learning Python vs. all the other programming languages.
Why Is Python a Good Programming Language for Beginners?
Python is very readable and easy to approach, reading more like English and less like computer code. It's not verbose like C++ or Java, so you don't need to learn about tons of bloated code just to get a simple program running. It's also very versatile, and can be used to write simple programs as well as large systems/services. YouTube is written with Python, by the way. Our primary focus here is to write a simple program/script.
Your First Python Calculation
Try It Yourself
In the example above, we instruct python to add two numbers together. There's actually a lot happening behind the scenes of this calculation. Python designs mathematical operations like this to be simple an readable to humans, but this gets translated into something a computer understands. The + part of the code is called the mathematical operator. We also have the following operators at our disposal. Try swapping them out with the + operator and rerun the program.
|+||Addition||1 + 2|
|-||Subtraction||2 - 1|
|/||Division||10 / 5|
|*||Multiplication||4 * 3|
So now you know how to perform some basic math operations. At this point, you have a good foundation for learning the Python fundamentals.