Mojza Blog

A Beginner’s Guide to Code

by Ali Irfan | 03 March 2024

In an ever-changing sea of technological innovation, coding has become an invaluable tool to navigate the oceans. There are numerous reasons, personal or professional, that everybody should learn how to code. But since you’re here, you’ve probably already found yours, so let’s not waste our time. Without further ado, let’s embark on a journey through these vast waters.

Choosing A Craft

Before taking off on your journey, you’ll have to decide on a programming language. If you intend to explore distinct areas of the seas, it’s a good idea to choose the right ship for the job. But since you’re just getting started, a few good options are Python, Java, or JavaScript.

Another common suggestion from more seasoned sailors is learning C, but I’d advise against it for now. C has a very steep learning curve and its syntax isn’t particularly friendly, not something a beginner would find easy to start with. You’d want to be working on your programming skills, not figuring out where you’re missing a semicolon. Instead, start with a ship that’s easier to pilot, and tackle C later down the line.

But remember, there is no one best option, and it depends on where you’re headed. Think of what you’ll be using your skills for. Here are the best options for a few of the more common purposes:

  1. General Purpose: Python, Java, JavaScript
  2. Web Development: JavaScript, HTML/CSS, PHP, Python with Django
  3. Mobile App Development: Swift, Kotlin, Java
  4. Game Development: C++, C#, Java
  5. Machine Learning and AI: Python
  6. Data Science and Analysis: Python, R
  7. Scripting and Automation: Bash, Powershell

Once you’ve made your choice, you’ll need to be able to control your ship. So spend a bit of time equipping the captain’s cabin. That is, choose an IDE/code editor to write code in. The best one depends on the language you’ll use, but the most popular options include Visual Studio, Visual Studio Code, PyCharm (Python), and IntelliJ IDEA (Java).

One thing to know is the difference between an IDE and a code editor. An Integrated Development Environment (IDE) is like a fully-fledged control room with all the equipment you need; it’ll give you a comprehensive set of tools to write, run, test, debug, and manage your code. A code editor, on the other hand, is just something you can use to write code and no more. Visual Studio Code is an example of a code editor; you can write code with the base program, but you need extensions to run it.

Learning the Ropes

Now that you’re all set up, it’s time to set sail, right? Well, not quite yet. You need to take a while to learn to steer your ship before you can set your sights on the open ocean. You can’t venture out into the vast sea before spending a bit of time in shallow waters.

Before I move on to anything else though, I can’t go without mentioning the holy grail of computer science courses. One of the best ways to get started with coding and computer science as a whole is Harvard University’s course, CS50’s Introduction to Computer Science. The course does start with C as the first language, though. But while I did advise against starting with C, the course goes through everything so well that it almost isn’t even a problem.

But past CS50, rather than trying to read through dense documentation or finding some old outdated programming blog, I’d recommend you start with video tutorials. While they are sometimes pretty terrible, especially with the amount of abhorrent “Learn XYZ in 5 minutes” YouTube videos, they are the easiest and most beginner-friendly way to get started. They let you see everything happen and learn visually.

You probably don’t want to waste your time sifting through dozens of them though. So, to make your life easier, here are a few good tutorials for the more popular programming languages:

 

But remember, you’re not just there to watch. No, you need to participate. Trying to learn programming without practice is like trying to sail a ship just by watching someone else do it. It’s just not gonna work. So if the videos have exercises, make sure to do those on your own. If they don’t, then look some up online. Even asking ChatGPT to come up with some practice problems isn’t a half-bad idea.

And of course, just because I recommend starting with video tutorials doesn’t mean you have to. Some of the best resources online are websites with text-based tutorials, like freeCodeCamp, Codecademy, and W3Schools. The resources you use should match your learning style. If they don’t, then you’ll learn slower at best, and not at all at worst.



The First Expedition

Great job on making it this far! You’ve made your way through the coastal waters, and you’re just about ready to sail into the high seas. Now, with the basics under your belt, it’s time to plan out the route for your first voyage. Your next step is to take on a coding project. But now the question is: what do you work on?

Well, it’s best to start simple. Think about how you go about your day. What do you do that you want a solution to? Something repetitive and something that can be automated. Think of a captain’s assistant going through hundreds of unsorted log files on the ship’s computer to find something. That’s something you can easily automate and save time on with a bit of code. What, were you imagining old-timey pirates with eyepatches and cutlasses? No, of course ships have computers now.

And it doesn’t have to be big either, maybe a minor inconvenience you want to get rid of. My first project was a little program to notify me when my laptop’s charging reached 90% since I kept forgetting to unplug when it was fully charged. Small undertakings like these get you used to working with code, and you might learn something new when researching libraries and algorithms for your project.

Once you’re more familiar with coding, I’d recommend learning how to use Git and GitHub to make it easier to keep track of things. It’s not a necessity if you’re just working on small projects, but they’re really helpful if you’re coding up something big that needs proper management.

Git is one of the most useful tools you can bring aboard with you, and GitHub is a great place to not only manage your work but also showcase it to other sailors and collaborate with them. And there are several other tools to enhance your journey. From management to documentation to testing to organisation, you can find a tool for just about every purpose. And you’re free to use it to make your journey better.

Venturing Beyond

After personal projects comes a career. If you just want to learn to code a skill, then this is just about where it ends. You’ve got a solid grasp on coding, you can code up a program or two, and you’ve got a nice bullet point for your resume. But if you intend to build a career in programming and computer science, then there’s much more to be done.

The journey’s going to be a long one, but the more you practise, the easier it gets. You’ll learn to steer your ship away from bugs and become more efficient at what you do. Along the way, you’ll come across advanced topics to explore, increasing your skill set and adding to your portfolio.

Networking will be a compass of sorts, guiding you through the sea of professional programming. Find online communities or forums to engage with, meetups to interact with fellow sailors in real life, and competitions or hackathons to collaborate with others and showcase your skills.

But your journey will have just begun, for beyond the horizon lies an ever greater expanse. From landlubber to a seasoned captain, you’ve come a long way. But there’s always more to learn and more to code.

Whether you’ve chosen to make it a career, or just keep it a skill, every leg of your journey has been a commendable one. Keep on exploring, coding, and creating. Bon voyage, and happy coding.

Acknowledgements

Author: Ali Irfan
Proofreader: Shaheer Ali

Mojza

About Mojza

Mojza is a student-led organisation aiming to provide quality resources for Cambridge students.

Other than such weekly blogs, Mojza offers resources for your O levels, IGCSE, and A levels journey. We have notes from reputable teachers, our own original notes and a library of other helpful websites and resources!

Check out our home page!

Published: 03 March 2024
Last Updated: 03 March 2024
Written by Ali Irfan