The Biggest Cheat Code For Learning a Programming Language Fast
TECH NEWBIESTECHNICAL LEARNINGCODING
7/15/20243 min read
You have 5 days to code a feature in a new programming language, what do you do?
Options:
A. Browse the internet for a new course on the programming language.
B. Read a book on the programming language.
C. Do nothing – it’s impossible to learn what you need to in 5 days.
D. Look at the codebase of a pre-existing repo using this programming language and research anything new.
The Challenge of Learning Under Time Constraints
As self-taught developers, we often lean towards option A. We are used to having little time constraints when it comes to learning a new technology, so dedicating 39 hours to an "Ultimate Java Mastery Course" on Udemy seems practical. However, transitioning to a corporate environment taught me a more effective approach.
As a new developer, I quickly realised that there was a lot of new technology I would have to learn in order to actually contribute something useful to my team. I sought some advice from a senior colleague who also got into tech from an unconventional background. Their suggestion? "Just look at the codebase." Initially, this seemed daunting, but it quickly made sense.
The Practical Approach: Dive into the Codebase
Here's how I approached it:
Read Through the Code: I looked at the existing code and would translate it into plain English which I wrote in an accompanying Word document. Now, Whilst the Word doc isn't necessary, the ultimate goal is to be able to explain what the code is doing. I took note of any unfamiliar libraries and classes and googled them.
Contextual Learning: Seeing libraries in action within a relevant context helped me grasp how and why they were used more easily.
Understand Syntax and Structure: I observed the code structure, naming conventions and file layout. As this was a codebase that had gone through testing and reviews, I was fairly confident in its ability to help me learn good coding practices too.
Focused Learning: Instead of a broad, time-consuming course, I concentrated on libraries and code I was likely to use within this project.
When you choose the 39-hour course option, you are likely to be repeating content you already know. It can also give a lot of content that you won't necessarily need. However, reading the codebase focuses your learning on essential elements, making it more efficient which is key in a corporate environment.
Balancing Long-Term and Immediate Learning
While under a deadline, this targeted approach is very effective, you can still pursue comprehensive courses later to deepen your understanding. The key is knowing when to focus on immediate, task-specific learning versus long-term skill development.
Tools for Code-Based Learning
If you don’t have access to a codebase, several tools can help you mimic this learning approach:
Scrimba: I rage on about this code learning software all the time but its unique learning experience closely mimics that of a real-dev environment. The lessons encourage you to take some time to explore the repo, identify packages used and use this context to make code changes and additions.
GitHub: GitHub is another great tool to use. It is a bank of written code that you can use to help you learn. The only downside to GitHub is that code quality isn't always assured. So they may use bad practices or inefficient algorithms. Be mindful of this, do your due diligence and research alongside reading.
Conclusion
Next time you are faced with a requirement to learn a new programming language, try reading an existing code base in that language. Later, you can complement this with comprehensive courses to solidify your skills.
If you try this method, let me know at contact@ruthfultech.com.
Liked this post? You may enjoy:
What programming language should you learn first?
What to expect from your first 6 months as a developer
Happy coding,
Ruth