I will not lie to you, programming is hard and it never is easy. The more you know, the more you will realize what you don’ t know. But the good news is, it gets easier over time and if you are into puzzle solving (and like to have the control and command over things) it is getting more fun by the day.
Programming is hard for the most part, because when you start it is such a huge amount of content, you simply do not know where to start. I certainly had this problem. So this post is going to give you some concepts and guidelines how to start out. We will not dive into the code yet. You might think, how do I learn to code when I do not learn something about code? And the answer is you will learn some meta concepts here that will you get faster to the goal of understanding code. Oh well how convincing, but hey it is on the internet so it must be true :). One of the main points I always try to convey is the following. Before you start getting into the nitty and gritty details of the code, you need to think about your problem first. And I consider this concept true for most if not all of problems you want to solve in your life.
So how do I start?
First ask yourself the most important question:
What do I want to achieve with learning to code, or rather WHY do I want to learn to code?
Take your time to answer it. Picture yourself writing code in the circumstances where you want to apply it. Maybe write down the top reasons why you want to do this, and how this aligns with your personal values, dreams and goals in life. Close your eyes and feel like you were already in the position that you can write code.
I do not want to bother you with esoterics, but you become what you think about. So if you picture yourself as a programmer and really do believe it, you will become one. This is true for any other goal in life. At least in my experience.
I ask this question, because it is so important to have a goal upfront, so you will not get frustrated easily. If you did not find an answer yet, look at Why should I learn to code
For starters reasons might be:
- Help you get more efficient at your (office) job
- Automate your home, or your administrational tasks (like budgeting with excel or stuff)
- Understand the modern world a little bit better
- Just to see if it fits you
- Learn new ways to think about problems
- Make a professional career with loads of opportunities
- ….and much more
With that in mind you can go about what you need to learn, and are willing to learn to achieve your goal with the least amount of frustration.
Fake it till you make it!
Now before we step into the technical stuff, I want to give you some advice I wished I had when I started out.
First of all, no one knows all of this stuff in every detail. Some have a very good overview and thats what helps a lot.
What I get from that is that you should look at learning to program (or learning anything for that matter) in a sense of “fake it till you make it”. If it sounds a little fraudulent to you, it really is not. When you want to write high quality software it is one of the core concepts. It might not be articulated in this way, yet at its core it is true. You want to focus on one thing at a time and abstract all the other stuff away. In programming that means, you build parts of a system so that they are black boxes and give you some predifined information. And in later stages you substitute this with a “real box”.
So for learning programming this makes sense, because you cannot learn everything at once. So for example if you build a module/application/system you concentrate first on modeling the data, then the logic (how different things interact) and later on how and where to store the data. So in a sense you try to shield different parts from one another. And the same holds true for learning programming/computer science. First you learn some high level concepts like what is data, how do things interact and so on and so forth, and later you learn how the tools work to connect the “boxes”.
For example you would learn one programming language with its syntax and basic concepts, and after you know that you would proceed with how to store data, like in a database. But while you are learning the language you only need to know that there is the possibility to store your data somewhere.
So you could say, you learn what concepts exist out there, and then you put it in boxes and look at one box at a time. In the given example above, the language would be one box, where as storage would be another. Each of these boxes have a lot of smaller boxes in it and so on.
The community is you, you are the community
As I said before, no one knows everything and you do not need to know everything either. Programming is a team sport, and all people I ever worked with where happy to help in any given situation. I think this is mostly because everyone needs to start somewhere and no one is born with the skill of being a programmer. I mean, every master in any field was once a beginner at some time. If that does not motivate you I do not know what will.
You can see how helpful most programmers are when you look at social media like stackoverflow, github or any other code sharing platform. Also the open source community, and any programming community for that matter are extremely eager to help. So my point is, do not be afraid to ask anyone anything, cause you are working together to reach a common goal. That should be obvious in every job and situation, yet it often is not.
You will need to read a lot. I mean a friggin lot. From blog posts, stack overflow posts, articles to books and what else might be there. You should start a habit of reading one or more blog posts every day. Also you should try to read a book on programming a month or at least one in every three months. Last but not least you should read a lot of code. Not just your own but that of others as well. All of this helps to gather new ideas and get new insights. It is not a must, yet to git gud (dark souls anyone) it is a must, at least from my perspective.
Just do it
Another very important thing is, that all the reading and researching will not do the trick for you. In the end you have to be there in the trenches. Write a simple program here and there, learn what other programmers are concerned with. The more programs you write the more things you will discover to explore. Also revise some older programs you wrote from time to time.
If you do not know what programs to write, search the web for ideas or look at the following list.
- FizzBuzz simple, with objects, with user defineable numbers etc.
- Textprocessing (give the program a text file and let it count a user defined word)
- Calculator (in console or with UI)
- Rewrite common algorithms and data structures
- Write a program that creates random objects with random names that post random messages (in a command prompt or in some sort of UI)
- Write a program for everything you ever did twice on a computer (like backups, print your emails in a given way, open your browser with given websites and so on)
One of the hard things as a beginner is to find a solution to your problem, because you do not know how to articulate what you want to achieve. There is no single easy solution to that. I only can give you advice on how I did it most of the time. I used a process that is known as triangulation. In mathematics/engineering triangulation is a method where you find a point in question by forming triangles from a point you already know. You can apply this concept to questions in software as well. Search from what you know that you want to achieve on a high level, and work your way down to a solution from different directions. E.g. Type <language name> how to <concept>, and then type <language name> how to <synonym for concept>.
So how can you learn really anything? The easy way is to be consistent. Do not learn for a week with 12 hours a day and stop and touch it never again. Just do it for 10 minutes a day. Or even less. Start with 1 minute a day. This is some time everyone can spare. Write just one line of code and gather a new insight. Read one blog post a day, read one chapter a week, write one program a month or any other form of this concept. This is true for other parts of life as well. E.g. workout for 1 minute a day, eat one piece of fruit a day, focus on one thing at a time for a given time period and so on.
It does not sound like much, but to do anything in life you only need time and consistency. And with every day you will learn more and the 1 minute will grow to 10, then to 30 and at some point to a full day with one topic you are focusing on. And you will not know where all this time went.
There are also other methods that might help, which are the pomodoro technique, or the feynman technique. Yet you can search those terms for yourself ;-).
At last: learning to code is a never ending process. So to be succesful means to never stop. It sounds like it is a lot of work , yet when you reach a state where you know your way around, you will not want to stop. I guarantee you that.
Choose a programming language and stick with it
There are so many of them…and they are getting more by the day… So how would you ever find a language that suits you? You need to know that languages in software development are mere tools to achieve a goal. So it is not as important as you might think, which language you will learn. Today most of the modern languages use similar or the same concepts. So you learn one language and it gets much easier to learn the next one.
C# and .Net
Ok I am a little biased here, because in my professional career I use C# with .Net for the most part. Despite that fact, it is a beautiful language, that has all modern concepts that you can wish for. (Buzz word alert): Be it object orientation, functional programming, Promises or whatever. Also with the .Net Framework it is the defacto standard for Windows development. Additionally it is now available cross platform with .Net Core which makes it usable on pretty much any device and operating system. Further you can develop mobile apps, web apps, iot apps and what not.
Also it is incredibly friendly for beginners, because there are some extremely mature tools that help you with your programming. One is the Visual Studio Integrated Development Environment (IDE), which is arguably the best IDE on the market (an IDE is sorta powerful text editor with built in tools to make programming easier, by taking the repetitive stuff away and make you focus on your code). And the best thing is, it is free to use, even for small commercial applications. It is also available for macOs. It gives you some powerful features that are incredibly useful to lessen the things you have to know to get started. For example:
- tells you what you can use on objects, lets you autocomplete your words which leads to lesser typos and a much nicer feel.
- Project templates
- automatically import all needed packages and dependencies so you can focus on coding instead of setting up all the right dependencies just to get started.
- Compiler and syntax highlighting
- tells you what does not work out and makes everything better strucutred to look at
- Powerful debugging
- Integrated build (compile and run your program)
- And much much more. (I even learn some things from time to time, even though I use it since Visual Studio 2010)
I also like python a lot, because it has a nice syntax, and is very thoughtfully designed as a language. You can use it to run simple scripts to automate your office, for web devolopment, mobile apps, data science, artificial intelligence and much much more. It is very simple to learn and can get you quite far. It is also the goto language for playing with your own hardware like raspberry pi.
So if I’d try to be objective I probably would recommend Python to a beginner in programming.
First ask yourself, why you want to learn to code. As I said before, and will say again and again, before you start something, be it coding or whatever, you need to have to picture the goal, that you want to achieve, in mind. How you are going to get there is something you need to figure out later. First decide what it is what you want to achieve, the details will manifest itself on the way. See you wouldn’t start driving your car with fullspeed without knowing where you want to go and figure that out along the way (at least not normally, maybe in a car chase, but what do I know). When you know your destination and start driving towards it, the details of each turn and traffic and so on can be decided on the way.
In upcoming posts, I will also talk about some basic terms that are used around coding/programming, some basic concepts of comupter science, and concepts of modern programming languages. I will also talk about setting up an environment for the above mentioned languages and how to start your first application.