How to finally learn to code in 7 easy steps

tldr

  1. What to Learn?: If you don’t know which programming language to learn, seek help from relatives or colleagues before looking for advice from people on the internet, as they might be biased.
  2. Make a Roadmap: This part can last a maximum of 2 weeks. Start by listing your practical goals (What is my final objective?) and document what you need to know for each part. Then create a roadmap with specific steps. For each important step, add a final project. It does not need to be clear right now. You can share it with other more advanced people to get feedback.
  3. Collect Resources: This part can also last a maximum of 2 weeks. The goal is to collect resources that match your roadmap. Be flexible; it is okay to change resources along the way.
  4. Take Notes Along the Way: The best way to maintain your level is to take time to make your own notes so that if you are absent for a long time, you can quickly recover most of your level. Also, learn good practices; they help you at any level. Stop coding only. You have to realize that the best way to practice coding is to focus more on things around the code.
  5. Learn the Basics: Always start with the basics. Even if you start with a crash course, learn the basics anyway and as soon as possible. It will help you understand the programming language better and solve errors. You do not need to master all the basics since you will come back to them later (and often).
  6. Engage in Projects: Projects are fundamental to anchor your knowledge since they require you to use many simple concepts that seem detached at the beginning. By doing your project, you will need to go back to the basics and find resources to complete your knowledge.
  7. Revisit the Basics: After projects, you will understand better the importance of basics. Revisiting the basics is not only rereading the documentation or redoing tutorials but also helping others, teaching, creating resources, or joining communities.
  8. Collaborate: Working with others helps in many aspects such as being exposed to different coding styles, improving problem-solving skills, discovering new things, and having feedback. If you are not willing to collaborate (or you can’t), simply put your code online so other people can see or use it (share it!).

This blog provide an example at the end.

Introduction

Whether you’re diving into your first programming language or adding another to your list (let’s become polyglot!), there is one thing many of us share: the journey of learning to code on our own. In today’s world, it seems easy to embark on this journey, given the plethora of resources available. However, this abundance brings many challenges.

Learning to code independently often leads to what is known as the famous “tutorial hell”. It is a common trap where learners, in their quest for the perfect guide, find themselves circling in a maze of tutorials. This endless search makes every tutorial appear difficult to approach and even when the right tutorials are found, months can pass in study without the sense of real progress, leading to frustration and discouragement. It is normal to feel lost.

Another significant problem is the well-known ‘perfect time’ to learn. Many struggle to find or make time in their busy schedules to dedicate to coding, further prolonging their learning journey. If you need advice on that we have a nice blog post for you: “The two-minute rule for busy coder/learner”

The following 7 steps are designed to help you navigate these challenges more smoothly and effectively, ensuring you won’t face the same obstacles that have hindered others. These steps are:

  1. Make a roadmap: Plan your learning journey.
  2. Choose the right resources: Select materials that suit your learning style.
  3. Take notes along the way: Documenting your progress aids in retention.
  4. Learn the basics thoroughly: Strong foundations are key.
  5. Engage in projects: Apply what you learn in real-world scenarios.
  6. Revisit the basics: Regularly reinforce fundamental concepts.
  7. Collaborate: Learn from and with others.

In the rest of this article, we will dive deep into each of these steps, to provide practical advices to make your coding journey a successful and enjoyable one.

0. Help! I don’t know what language to learn!

Note: If you exactly know what you want to learn you can skip this part!

If you’re feeling overwhelmed about where to start your coding journey, you are not alone. “What should I learn first?” is an increasingly common question, not just due to the big number of options available, but also because of the ongoing ‘wars’ between different programming languages, each claiming to be the best (not the programming language but their hardcore fans). Navigating through these passionate and often subjective debates can be tricky. It can lead to two main issues: difficulty in making a choice (which leads to procrastination) or ending up with a language that doesn’t really suit your needs.

Take, for instance, the classic debates like “The best programming language for…”, “Which JavaScript Framework to choose?”, or the famous “Python vs. R”. These discussions are recurrent and can be more confusing than helpful. So, how do you cut through the noise?

The simplest approach is to avoid starting your search on the Internet. Instead, make a list of your own needs and objectives as clear as possible. On the Internet (in discussion), there is a risk that others will decide for you, pitching a language as the be-all and end-all (though, thankfully, not everyone does this). Approaching with a clear idea of what you want to achieve helps limit bad influence and indecision.

Also, consider the support and resources available around you (friends, colleagues or books) and align them with your personal or professional plans.

If you’re still in doubt, it’s okay to pick an option at random or go with a ‘default’ choice. Take your time but don’t linger too long in this phase of decision-making. Remember, you can always pivot to another language later – no learning is ever wasted.

The beauty of programming is that the core concepts are often transferable between languages. Different programming languages are just tools – it is how you use them that matters. For example, if you start with Python due to its simplicity and later decide to switch to Java, you will find that many concepts like loops, variables, and data structures are similar, just with different syntax.

But who to talk to?

It’s a legitimate question - as a beginner, we don’t necessarily know how to translate our needs into clear, domain-specific objectives. Before going on the Internet, it’s always wiser to talk it over with a more advanced acquaintance. Now, in the age of artificial intelligence, an in-depth discussion with a model like ChatGPT can be enlightening. But becareful it might be really really really biased! Use it as a last resort!

1. Make a roadmap

Having a roadmap is crucial. The path of least resistance often leads to joining online curricula or courses on platforms like Coursera, Udemy or freeCodeCamp. While these courses are beneficial and avoid the need to design your own program, they are, by nature, very standardized. They may not align perfectly with your objectives or your preferred learning style.

If you find that these courses don’t meet your unique needs, creating your own roadmap is a viable alternative. It is tempting to dive straight into tutorials and start coding, but this approach can often lead to confusion and discouragement as discussed in introduction. The key is to have a clear goal. You should be able to answer questions like, “Why do I want to learn this programming language?” or “What do I specifically want to create with it?” Remember, a programming language can serve many purposes – from developing websites (like HTML/CSS/JavaScript for front-end development) to creating data analysis tools (such as Python for data science). In the case of R for instance, you may want to learn it for biologie, social science, or outside research, for finance or building web app.

Once you have defined your objectives, the next step is to break it/them down into smaller, achievable, and measurable goals. For instance, if your aim is to build a website, start by learning basic HTML and CSS. Then, gradually progress to more complex tasks like JavaScript and back-end/front-end development.

With these smaller goals in mind, order them and compile them into a learning roadmap. The more personalized your roadmap, the better. However, it’s essential to start with the basics regardless of your ultimate goal. At this stage, your roadmap does not have to be incredibly detailed, but you should at least know what skills you need to acquire at each stage.

If it is hard to make goals, find online ressources that compile ressources specific to your need or, in last resort, already made roadmaps. For instance, for R UseRs I highly recommand the big book of R that compile many (almost) free ressources on R for many subject (data science, finance, natural science, etc.). It can give good ideas.

Don’t underestimate the importance of this planning phase. Dedicate a good amount of time to it – up to two weeks, if necessary. During this period, don’t hesitate to seek advice from more advanced individuals.

Remember, your roadmap is not set in stone. It should be a living document that evolves as you gain more knowledge and understanding of the subject. You can’t know everything from the start, and it is perfectly fine to adapt your plan as you progress. Especially when it comes to projects (see “6. Engage in projects”).

2. Choose the right resources

Selecting the right resources is a crucial step in making your roadmap more tangible. It is not necessary to have resources for every step right away; you can discover new resources as you progress. The key is not to focus too much in finding the ‘best’ resources, as this can be a laborious and often futile task. Focus on finding resources that best suit your learning style.

To help you with this, ask yourself some guiding questions: - “Am I willing to spend money to learn?” - “Do I prefer paper or digital resources?” - “Do I prefer static or interactive resources?”

For each of these combinations, there are corresponding resource types: - If you’re open to spending money and prefer paper resources, consider investing in comprehensive coding books. - If you prefer digital and are willing to invest, paid online courses on platforms like Udemy or Pluralsight offer structured learning paths. - For those who prefer free resources, there is a bunch of YouTube tutorials and online documentation. - If interactive learning is your style, platforms like Codecademy or freeCodeCamp offer hands-on coding exercises.

For more interactive learning ressources (exercices) I wrote a blog post here: “Free programming exercice website”.

It is important to note that preferences might change based on your experience level. For example, if you are learning your second programming language, you might find more advanced resources like technical blogs or community forums more beneficial.

However, each type of resource has its shortcomings. Books can become outdated, online courses might not cover the latest technologies, and videos can sometimes lack depth. Don’t hesitate to ask for recommendations from experienced coders or online communities for a list of useful resources.

A great way to start strong is by taking a crash course (written or video) of maximum 2 hours, and coding along with it. This approach helps you quickly grasp the syntax and philosophy of the language. Remember, it’s crucial to practice actively and not just passively follow along with the theory. For more advanced programmer with a good understanding of programming concepts reaching their new programming language a website like “learning x in y minutes” might be a good ressource (but you can also try it at any level even if it is your first programming language).

Keep in mind that there’s no such thing as a perfect resource. It is okay to change your resources as you progress. The most important thing is to work hard and stick with it for as long as possible.

3. Take notes along the way

Take notes

This section emphasizes a good practice crucial for avoiding stagnation and deviation in your coding journey: taking notes throughout the learning process. While some programming languages like Julia have exceptional documentation, others like Python boast a plethora of tutorials by individuals. Then there are languages with more challenging documentation, such as Haskell or Nim. But ultimately, the best documentation is the one you create for yourself.

This can take the form of personalized notes in a style that suits you best, be it a text document, a Word file, or a Markdown file. Another vital type of documentation is the code you write yourself. Ensure it’s clean and well-commented (but not excessively so). This code becomes a valuable resource when you need an example later. Additionally, organize your code and folders effectively to easily navigate your work.

Finding help

When it comes to seeking help, autonomy should always be your first approach. This means trying to solve problems on your own by testing and researching, sometimes for hours, before seeking external assistance. Remember, making mistakes is a fundamental part of learning. Relying too heavily on others for answers – whether it’s a more experienced colleague or the internet – deprives you of the crucial problem-solving experience at the heart of programming.

The risk with relying on artificial intelligence for help is that it can provide answers without limit, which can lead to a dependency on external solutions. Without honing your problem-solving skills, your learning becomes slower and less effective, leaving you reliant on others or tools for coding. Strive for independence.

Learning best practices and tricks

It’s also important to learn the best practices and tricks of the language you’re studying. The beauty of these tips is that they can be learned at different stages of your journey. However, the sooner you incorporate them, the more quickly you’ll boost your productivity. Embracing these best practices early on is always beneficial.

In summary, keep detailed notes, stay organized, seek autonomy in problem-solving, and continuously learn best practices and tricks in your chosen programming language. These steps are fundamental in developing a strong foundation in coding, leading you towards becoming a proficient and independent coder.

4. Learn the basics thoroughly

The foundation of understanding any programming language lies in mastering its basics, which is why it’s a crucial first step in your roadmap. However, learning the basics isn’t just about grasping the syntax; it’s equally important to understand the philosophy behind the language. The best way to solidify your understanding of these basics is through practice exercises, underscoring the importance of choosing the right resources.

Universal concepts in programming languages

There are several universal concepts common to all programming languages that you need to ensure you master:

  1. Variable declaration: Understanding how to create and use variables.
  2. Data types: Familiarity with different types of data (e.g., integers, strings).
  3. Control structures: Knowledge of if-else statements, loops, etc.
  4. Functions/methods: Creating and utilizing reusable blocks of code.
  5. Input/output operations: Handling user input and system output.
  6. Error handling: Managing and responding to errors in code.
  7. Basic data structures: Using arrays, lists, and dictionaries.

As data scientists or statisticians, we have the impression that these concepts are not important to us as long as we don’t code as a programmer (we can use R without knowing how to program, for example), but this deprives us of essential knowledge that will help us in our learning process (in particular, understanding and resolving errors).

Tips for learning the basics

  • Take your time and don’t rush the learning process.
  • Practice as much as possible with small coding exercises.
  • Use your notes as a reference and keep updating them.
  • Don’t be too hard on yourself.
  • Don’t try to understand everything perfectly, you will come back to it latter if needed.

Estimated learning times for programming languages

Here is an estimated learning time for basic concepts in various programming languages (non-exhaustive and subjective list), ordered from easiest to most difficult:

Programming language Level of difficulty Estimated learning time
Lua Easy 2-3 weeks
Python Easy 3-4 weeks
R Easy 3-4 weeks
Julia Easy-Moderate 4-5 weeks
JavaScript Moderate 5-6 weeks
Go Moderate 5-6 weeks
Java Moderate-Hard 6-8 weeks
Nim Moderate-Hard 6-8 weeks
C/C++ Hard 8-10 weeks
Rust Hard 10-15 weeks

Remember, it is okay not to master everything at first. Your understanding will deepen as you work on projects and revisit the basics later. The most important thing is to take comprehensive notes during your learning process. You will come back to it latter!

In conclusion, give yourself time to thoroughly learn and understand the basics of your chosen programming language. This solid foundation will set you up for success as you progress in your coding journey.

Warning: You don’t want to go too fast, but you don’t want to take too long either. For the moment, it’s technical knowledge, but for it to become technical skills, we’re going to have to start working on projects, and as quickly as possible (see bellow).

5. Engage in projects

Projects are arguably the most effective way to learn programming. They encompass an array of steps, reflections, and errors, making them instrumental in understanding and applying the various tools and concepts you’ve learned. Projects make the abstract concepts tangible and help you start learning autonomously. If you haven’t already included projects in your roadmap, it’s time to do so. Projects will not only enhance your learning but also serve as benchmarks for self-evaluation.

How to choose your project

Initially, choose a very guided project, preferably one accompanied by a video or tutorial that leads you step-by-step. This will help you understand the project flow and the intricacies involved. After completing a guided project, move on to less structured projects. If you struggle to find suitable projects for your programming language, seek inspiration from the internet or ask someone experienced to help you select. Don’t hesitate to look at projects in other programming languages for ideas.

For subsequent projects, consider working on something personal and meaningful to you. This approach keeps motivation high and makes the learning process more enjoyable.

Project Ideas for different levels and specializations

Non-exhaustive list

  • Data scientist
    • Beginner: Analyze a dataset using basic statistical methods.
    • Intermediate: Create a predictive model using machine learning.
    • Advanced: Develop a complex data visualization tool.
  • Web developer
    • Beginner: Build a simple personal or portfolio website.
    • Intermediate: Develop a dynamic web application with a database.
    • Advanced: Create a full-stack application with user authentication.
  • Cyber security
    • Beginner: Set up a basic secure network.
    • Intermediate: Conduct a penetration test on a test environment.
    • Advanced: Develop a tool for automated security testing.

If you find yourself struggling with a project, it’s a sign you might need to revisit the basics or seek more documentation. It’s completely normal to oscillate between learning and applying. Creativity is a key asset in this phase, so let your imagination guide your project choices.

In conclusion, engaging in projects is an invaluable part of your coding journey. It solidifies your learning, enhances your problem-solving skills, and helps bridge the gap between theory and practical application. Remember, it’s about the journey, not just the destination.

6. Revisit the basics

Even as you progress and become more adept at your chosen programming language, it’s crucial to regularly revisit the basics. With the experience you’ve accumulated, your understanding of fundamental concepts will deepen, and you’ll often gain new insights. This revisiting is not only a refresher but also a means of reinforcing and solidifying your skills.

In my opinion, one of the most effective ways to strengthen your grasp of the basics is to teach or help others. Once you’ve completed your first project, you should be at a level where you can offer valuable advice to beginners. The power of teaching lies in transforming your practical, personal knowledge into accessible and comprehensible information for those who are just starting out. This process not only hones your pedagogical skills but also compels you to develop a clearer understanding of fundamental principles. You’ll frequently find yourself answering the daunting “Why?” question, which in turn deepens your own comprehension.

Additionally, teaching requires you to discern what is essential to convey, further clarifying your understanding of the basics. Engaging in online or in-person groups where you can teach or assist others is highly beneficial. It not only enhances your own skills but also contributes positively to the learning journey of many others.

If teaching directly isn’t your preference, consider creating written or video resources to share your knowledge. Documenting your learning process and explaining concepts in your own words can be just as enlightening.

And if you don’t think you have what it takes, don’t underestimate yourself! You certainly do!

In summary, revisiting and reinforcing the basics is a crucial step in your coding journey. Whether through teaching others, creating resources, or simply reviewing concepts on your own, this practice ensures a solid and continually evolving understanding of your programming language.

7. Collaborate

Collaboration is a cornerstone in the realm of modern programming. Far from the stereotypical image of lone geniuses coding in isolation, programming today is deeply rooted in social interaction, sharing, and collaboration. Without these elements, the landscape of programming – filled with free educational resources and open-source tools – wouldn’t exist as it does today.

The Importance of collaboration

Working solely on your own projects limits you to a single perspective. By collaborating, you expose yourself to different methodologies, ideas, and problem-solving approaches. This exposure can significantly enhance your skills and may introduce you to techniques and concepts that can dramatically improve your work. Collaborating on code and in learning environments brings numerous benefits, including:

  • Exposure to diverse coding styles: Understanding different coding styles enhances adaptability.
  • Improved problem-solving skills: Collaborating on challenges leads to more innovative solutions.
  • Networking opportunities: Building relationships within the programming community.
  • Feedback and peer review: Gaining valuable insights and suggestions for improvement.

Ways to Collaborate in Programming

There are various avenues for collaboration in programming:

  1. Joining coding communities: Platforms like Stack Overflow, Reddit, or local coding groups (like WeData) offer opportunities to interact with fellow programmers.
  2. Contributing to open source projects: Engaging with projects on GitHub or GitLab allows you to contribute to real-world software, understand codebases, and work with other developers.
  3. Pair programming: Working alongside another programmer on a project, either in person or remotely, facilitates a shared learning experience.
  4. Participating in hackathons: These events are great for teamwork, innovation, and testing your skills under pressure.
  5. Code reviews: Engaging in code reviews with peers can provide new insights and alternative approaches to problem-solving.

For each of these collaborative methods, consider concrete examples: - Communities: Ask and answer questions on Stack Overflow or join discussions on programming subreddits. - Open source: Contribute to a small open-source project on GitHub, fixing bugs or adding features. We have an article on that here: “Contributing to projects on GitHub” - Pair programming: Collaborate with a friend on a small project or find a partner through online coding forums. - Hackathons: Join local or online hackathons to work on innovative projects with a team. - Code reviews: Exchange code with peers for review, or participate in code review sessions within your community.

In conclusion, collaboration not only enhances your technical skills but also enriches your journey in programming. It opens doors to new ideas, methods, and connections, making your experience in programming much more rewarding and comprehensive.

Samira’s example

Let’s delve into the inspiring journey of Samira (imaginary character), a complete novice in Python, who embarked on a quest to master it for deep learning applications. Her story is a testament to the power of following the principles we’ve discussed.

The beginning

Samira’s journey began with uncertainty. She knew she wanted to dive into deep learning, but the path was unclear. After scouring through various reputable sites like Coursera, edX, and freeCodeCamp, classical social medias (Reddit, Twitter and YouTube) and Python’s tutorials, she decided to focus on creating web applications using Python to implement machine learning models. This decision formed the basis and goal of her roadmap, a path she was eager to explore.

Crafting the roadmap

With her goal set, Samira outlined her roadmap. She started with the basics of Python, dedicating weeks to understanding its syntax and philosophy. She utilized free resources like Python’s official documentation and YouTube tutorials for visual learning. Her notes were meticulous, filled with insights and reflections, making them a personal encyclopedia of knowledge. Her roadmap:

Phase 1: Grasping the basics of python (Duration: 3-4 weeks)

  • Week 1-2:
    • Focus on basic syntax, variable types, and basic operations in Python.
    • Resources: Python’s official documentation, beginner-friendly tutorials on YouTube.
    • Exercises: Simple programs like a calculator, basic data manipulation.
  • Week 3-4:
    • Introduction to more complex concepts such as control structures (if-else, loops), functions, and basic data structures (lists, dictionaries).
    • Building small projects like a simple text-based game or a to-do list application.

Phase 2: Intermediate Python and introduction to web development (Duration: 5-6 weeks)

  • Week 5-6:
    • Learning about APIs and how to fetch data from the internet.
    • Project: Building a weather application that fetches data from a weather API.
  • Week 7-8:
    • Introduction to web frameworks in Python (like Flask or Django).
    • Project: Creating a basic web application that allows users to interact with it.
  • Week 9-10:
    • Deepening knowledge of Python by exploring more advanced features.
    • Beginning to learn about databases and how to integrate them into her projects.

Phase 3: Diving into machine learning (Duration: 4-5 weeks)

  • Week 11-12:
    • Basic concepts of machine learning and data science.
    • Resources: Online courses on platforms like Coursera or edX, specialized in Python for data science.
  • Week 13-15:
    • Practical application: Starting with simple machine learning models.
    • Project: Building a simple prediction model.

Phase 4: Expanding skillset - learning R and Julia (Duration: 6-8 weeks)

  • Week 16-18:
    • Introduction to R: Focused on data analysis and visualization.
    • Project: Data analysis of a dataset using R.
  • Week 19-23:
    • Introduction to Julia: Focused on its application in machine learning.
    • Project: Implementing a machine learning model in Julia.

Phase 5: Deep learning and advanced projects (Duration: ongoing)

  • Continuously working on more complex machine learning and deep learning projects.
  • Collaborating with others in the field, contributing to open source projects, and possibly teaching beginners.

Of course her roadmap wasn’t like that at the beginning and she adapted it in the way. ### Engaging in projects

Samira’s first project was a simple Python-based calculator. Guided tutorials helped her at this stage, but she quickly moved on to more complex projects, like a weather prediction app. This project required her to delve into APIs and learn data handling in Python, a challenging yet rewarding endeavor.

Collaborative learning

Understanding the importance of collaboration, Samira joined a local coding club. Here, she not only shared her knowledge but also gained insights from more experienced programmers. This exposure broadened her understanding and introduced her to new perspectives and coding practices.

Expanding horizons

As Samira’s confidence grew, so did her curiosity. She ventured into learning R and Julia, recognizing their specific strengths in data analysis and machine learning. This expanded skill set allowed her to approach problems more flexibly, choosing the right tool for each task (sometimes mixing the languages for powerful projects).

Overcoming challenges

The journey wasn’t without its hurdles. Debugging her first machine learning model in Python was a particularly daunting task. The model’s performance was initially poor, leading her to revisit the basics and adjust her approach. It was a lesson in persistence and the value of continuous learning.

Samira’s growth

By applying the principles we’ve discussed, Samira transformed from a beginner to a proficient programmer, capable of handling complex deep learning tasks. Her story is a vivid illustration of how dedication, a well-structured approach, and the willingness to explore and collaborate can lead to remarkable growth in the world of programming.

In essence, Samira’s journey is a source of inspiration for anyone looking to start or enhance their journey in coding. It shows that with the right mindset and approach, the world of programming is not just accessible, but also a fertile ground for personal and professional growth.

Conclusion: the journey of learning to code

As we wrap up this guide, let’s reflect on the key elements that make the journey of learning to code both achievable and fulfilling.

  1. Make a roadmap: Start with a clear plan. A well-thought-out roadmap is your compass, guiding you through the learning process.
  2. Choose the right resources: Select resources that resonate with your learning style. Whether it’s books, online courses, or interactive platforms, the right tools are crucial.
  3. Take notes along the way: Document your learning. Personal notes are invaluable for reinforcing concepts and tracking progress.
  4. Learn the basics thoroughly: Solidify your foundation. Understanding the basics is essential for building advanced skills.
  5. Engage in projects: Apply what you learn. Projects bring theory to life and are critical for practical understanding.
  6. Revisit the basics: Revisit fundamental concepts. Teaching others and reviewing basics deepen your knowledge.
  7. Collaborate: Share and learn with others. Collaboration expands your perspective and enhances problem-solving skills.

Remember, learning to code is an ongoing process that values consistency over talent or speed. It’s about steady progress, not leaps and bounds. As the saying goes, “Slow and steady wins the race.” Embrace the journey with patience and perseverance.

As you embark on this path of learning and growth, remember that “Consistency is more important than perfection.”

Your journey in coding is not just about acquiring a skill; it’s about growing as a problem-solver, a thinker, and a lifelong learner. So keep curious, stay dedicated, and enjoy every step of this rewarding journey.