5 things I wish I knew when I started programming

If you could go back in time to when you started programming, what tips would you give to yourself?

This post is based on Qazi’s video “4 things I wish I knew when I started programming” as a review plus my own input.


Programming is thinking
Stick to one language
Have a passion project
Programming is not like in movies
Extra: Learning is a long process: Enjoy it
Conclusion

1.- Programming is thinking

5 things I wish I knew when I started programming - Programming is thinking

When we spend time creating a new application, we spend a lot of time thinking. What type of database should I use: NoSQL or SQL? Which methods I should add to my classes? How do I structure the web application?

Yes, programming is also about writing lines of code, designing the visuals of your application, etc, but thinking is also a big part of programming. In fact, it is the most important part of programming.

And you should spend less time learning languages and spend more time on actual thinking.

You will learn more if you spend time learning how to solve different problems than learning more languages.

I know it sounds impressive saying that you have learnt 5 languages in just one year. But did you really learnt 5 languages? Or you just learn the bare basics of 5 languages, never going deeper than writing basic for loops and creating basic classes?

I believe that you don’t (really) improve by learning new languages, new frameworks, taking course after course like if it was a race.

Instead, I believe that you really learn when you learn the basic blocks of a language, and you start solving reallife problems.

For example, let’s say you go to French classes 3 times a week, one hour per class, by 3 months. Then you do the same with Russian, German and Italian language.

Would you say that you know how to speak 4 languages?

Maybe you know how to count, how to say ‘Hello, my name is X’, etc, but can you speak with a native or read a book on that language?

Then why you do the same with programming languages?

I know, because I used to think like that.

I did tutorial after tutorial, video after video, blogpost after blogpost, thinking I knew Python, Django, Flask, Laravel or Node.js just because I spend a few weeks watching videos in the afternoon.

But once I tried to start my own projects I froze. I even couldn’t create the basic scaffolding of a project.

But I did read all those posts, watched all those videos (for a few weeks), right? I should know how to create a project!

No. I should not. The same way I couldn’t speak French after 3 months of classes nor read a book in French.

What to do, then?

Part of what I said before is because I joined the #100DaysOfCode challenge.

Instead of learning the bare basics of a language or a framework, then moving to other one thinking that I already learn it, I would learn the basics THEN I start a project on that language or framework.

That is when you really learn: When you start applying what you have learnt. Because that is when you see that you remember only half of what you saw (if you’re lucky) and you start filling the gaps in your knowledge to solve a problem.

But also when you start combining different concepts of a language to solve problems that not everybody can solve. Especially if you claim to “have learnt 5 languages in just one year”

Takeaway: To learn how to solve problems is to learn to program, not just learning more languages.


2.- Stick to one language

5 things I wish I knew when I started programming - Which programming language

Now that you have read the first point, this should come to you as the next logic step, right?

Pick one language (I would recommend Python but feel free to pick the language you need on your job or the one you prefer) and stick to it.

Learn the basics, then learn how to problem-solve with that language. Not by doing tutorials, but by creating your own project. Something you are interested in.

You will face a lot of problems (How do I connect to a database? How I can retrieve all the users in my application? How I can display only the users with a Premium account?), but by solving real problems you will face, you will get real experience that tutorials won’t.

I’m not saying that tutorials are bad. In fact, they give a solid foundation on how a project is structured, how to solve basic problems, but you have to let the hand-holding at a point. Learn by tutorials, but don’t get stuck on Tutorial Purgatory, ok?

Real life example: Myself

I used a lot of programming languages: Javascript, Java, C++, C#, PHP, Python. But I can only code in a bunch of languages (Python, Javascript and maybe PHP and Java). As you see, learning a lot of languages in a small frame of time it doesn’t pay.

That’s why I focused on learning Python. I use Python and Javascript daily and I learn a bit more of Python each day.

I went from doing for loops in 4 lines to just one with “list comprehension”, how to use lambdas, etc. But the more I learn is by creating real projects (Like this Open Source project to create a Python Chat) or by reading Dan Bader‘s book Python Tricks.

Instead of ticking a box and going for another language, I’m going deep and deeper. Instead of learning 4 languages in a year, I choose to learn very well the language of my choice.

Of course, there are people with my experience (or less) that have learnt more languages than me. But do they know any language to the level I know Python? I doubt it.

I plan to keep doing this until I reach a really good level with Python. Then, switching to a new language would be easy, as I just need to learn the new’s language syntax: I already know how to solve problems.

Another real life example

Learning one language very deep (and limit yourself from job opportunities because you only know 1 or 2 languages) vs Learning a lot of languages (and limit yourself because you can’t do more than basic stuff) is a longtime discussion.

But let me ask you: If you had to receive a life-or-death surgery, would you prefer a surgeon with 5 years of experience or a doctor that dabbles on surgery, dentistry and did a course as an optometrist for 3 months?

Then you already answered the previous question.

Takeaway: Focus in one language and learn it very well. Highest paid jobs are for people than know how to solve the hardest problems in one language, not knowing 20 of them.


3.- Have a passion project

Have a passion project

Always have a project you’re passionate about, something than you think on your free time.

Maybe you like boxing: Create an application displaying their stats, match results, etc

Or maybe you like to cook. Then why not create a recipe web application where you can write your recipes! Then you add a ‘share this recipe’ feature. And then you add a ‘search by ingredient(s)’ option. Then voting for recipes. Then…

Nothing pushes you forward than doing what you like. Why no apply it to learning how to code?

Think in a project you want to do because it is related to one of your hobbies, or a problem you are facing, or maybe even something you can monetize. Then start building a small version of it, and keep adding features as you learn them.

Let’s say I want to create the best recipe web application and I want to create it with Django, a Python framework.

I would learn the basics, then when I learn something new, I will add it to the recipe web-app.

For example, I learn how to log in and log off users? I will add it to my project. I learn how to upload images? Time to let the users upload their recipe images.

If you don’t practice what you learn, you will forget almost everything. And what better to practice than a project you are passionate about?

Takeaway: Think about a project you want to commit for weeks or months. Create a basic version of it and start adding features as you learn.


4.- Programming is not like in movies

5 things I wish I knew when I started programming - Programming is not like in the movies

Programming is not like in the movies and series. You won’t write without thinking, as we saw in the first point of this post. You spend a lot of the time reading the code and thinking what broke your code.

And a lot of time searching online.

It is normal to spend a lot of time reading posts on StackOverflow, Reddit, other people blogs (you’re here after all!) and watching videos on Youtube.

Because of that, you need perseverance. Sometimes you won’t solve a problem right away, and you’ll spend hours (or even days!) to solve a problem. Don’t worry, it is part of the process.

But by reading and solving problems, you will learn a lot. Not only with the right answers but with the wrong ones. You’ll discover new features and things that you didn’t know while trying to solve a problem. Enjoy it.

Takeaway: Programming is not all about action. It’s a lot of thinking, reading and learning. And it is beautiful.


5.- Extra: Learning is a long process: Enjoy it

5 things I wish I knew when I started programming -  Learning is a long process

This one is not on Qazi’s video, but if I could go back in time to tell me one and one thing about coding, will be this.

When I started (in fact, until my last year), I did a lot of tutorials.

I would watch a video, sometimes at 150-200% of speed, then go for the next one. Yes, I always code along the teacher, but I rarely pause the video to read what the documentation says or to play with the code, trying to break it and fix it, to display new things, etc.

Now saying this makes me a bit ashamed of myself, but it is what I used to do. And now I see how much I wasted my time.

Instead, take your time. Enjoy it. If you learn a new concept, for example, for loops, stop the video. Create a for loop. Change parameters. Try printing the index. Try new things the teacher didn’t told you. Read the documentation to see what you can do, when you should use it and when not to.

You won’t win be first to finishing tutorials, but you’ll learn a lot. And it will stick, I promise.

Takeaway: Enjoy your time learning how to program. The slow and steady wins the race.


Conclusion

  • To learn how to solve problems is to learn to program, not just learning more languages.
  • Focus in one language and learn it very well. Highest paid jobs are for people than know how to solve the hardest problems in one language, not knowing 20 of them.
  • Think about a project you want to commit for weeks or months. Create a basic version of it and start adding features as you learn.
  • Programming is not all about action. It’s a lot of thinking, reading and learning. And it is beautiful.
  • Enjoy your time learning how to program. The slow and steady wins the race.

And a question for you: If you could go back in time to when you started programming, what tips would you give to yourself?