It can be challenging to start learning how to code, especially given how vast a field computer science is. For beginners,
it's not uncommon to be overwhelmed with questions like "what language do I start with?" or "how do I actually start coding?"
Those who know some coding may wonder, "What should I learn next?" The goal of this blog post is to provide a
brief overview of important CS topics that will hopefully answer some of these questions as well as provide new programmers a
roadmap of topics to look into.
We will be covering programming languages, text editors and IDEs, debuggers, version control, and the command
line. If you're not a complete beginner, you can probably skip the first 2-3 topics, which are meant for people with no CS
experience whatsoever. The remaining topics are things that aren't frequently covered in intro CS courses but are in fact
very important skills for programmers to know. While it's impossible to fully cover any of these in a single blog post,
it will hopefully provide you a detailed overview and set you up with an idea of what topics to pursue for future study. So
without further ado, let's begin!
Programming languages
One of the first questions that one asks when beginning to learn programming is what language they should start with. At
this point, the most common response you'll get is that it doesn't matter. There are many reasons for this: one is that
most languages aren't inherently better or worse than others; each has pros and cons, but choosing a language generally
won't limit the type of programs you can create with it (e.g. Python can be used for web development, data
visualization, scripting, etc.). Another reason is that after learning the fundamentals of computing in one language, switching
to another is as simple as memorizing a slightly different set of syntax. For example, after learning French, it's not
too difficult to learn Spanish, as both languages share some common rules and practices.
Nevertheless, below I've listed details about several popular languages and the use cases of each:
Java: the chosen language for AP Computer Science (taught in high schools) and often used in intro college classes
as well. It's a good general-purpose language that can be used for web development, Android development, and more.
Python: generally regarded as a good first language due to its simple syntax. Can be used in a variety of areas such as data
science or web development due to its versatility.
C++: a popular language due to its high performance and speed. As such, it's often used in programs where that performance
boost is extremely important, like in autonomous vehicles or low-level system.
JavaScript: despite its name, it's not at all related to Java. It's used in many, if not most, of the websites that you visit
daily. It allows web developers to add user interaction, animations, and many other features to a website.
Once you pick a language, it's time to start coding. To code, you'll most likely need to use a text editor or IDE
(integrated development environment).
Text editors and IDEs
You can think of text editors like Word or Google Docs for code, usually providing useful tools like syntax highlighting
or code completion. Most of these are programs you download onto your computer (some come with a default text editor,
like NotePad++ on Windows), but you can also find websites that let you write and edit code online. Popular text editors
include Sublime Text and Visual Studio Code.
IDEs are just like text editors but typically heavier duty. XCode, IntelliJ, Visual Studio (not to be confused with
Visual Studio Code), and Eclipse are all popular IDEs. They contain advanced features like debuggers and version
control (covered in the next two sections). For new programmers, I would recommend using an IDE or advanced text editor,
as these frequently allow you to run your code by clicking a button. Without this, you'd typically need to run your code
using the command line (covered in the last section), which can have a bit of a learning curve.
Debuggers
Debuggers are very useful for when something has gone wrong with your code. Maybe your code doesn't do as expected, shows an error such as ArrayIndexOutOfBoundsException, or gets stuck in an infinite loop. A debugger allows you to walk through your program line by line, seeing what's going on internally and helping you find any bugs. By setting "breakpoints" at certain lines, your program will run normally and then pause once it reaches those lines, giving you full control to monitor what's happening in your program. Although they may seem intimidating, they're quite easy to learn, and using them can save you a lot of time when writing your first few programs. Lots of IDEs come with debuggers, and enabling it is as simple as clicking the line number that you want to pause at and running your program in a "debug" mode.
Version control
Version control is kind of like Google Docs, which allows multiple people to work on a single document and saves all
edits into its history. Both of these things are important when coding, and as such, version control is definitely
something to look into as you pursue programming further. There are many version control "systems" and hosting
providers, but today I'll be focusing on Git and GitHub, the most popular of them all.
First, GitHub is a code hosting platform that allows you to collaborate with other programmers, show off your code/software
to others, or simply store your code files in the cloud for safe-keeping. You create "repositories" to store your code; for
example, you might have one repository for your programming course's homework assignments and another repository for a 2D
shooter game your building. If you make your repository public, others can freely submit code changes that you can review
and "merge" into your "master" repository if you approve of the changes. For both public and private repositories, you can
also add collaborators who have access to make changes without your approval.
Unlike Google Docs, you can't edit these repositories live. Instead, what people most commonly do is to pair GitHub with
Git, a version control system that's set up on one's computer. To make changes to a repository on GitHub, you can download,
or "clone," the files in the repository onto your computer using Git. Then, using a text editor or IDE, you can add, edit,
or delete whatever you want, and when you're done, you can track these changes in a "commit," which is similar to creating
a snapshot of your changes that you can revert to at any time. Finally, you can "push" the snapshots you make back up to
GitHub, and programmers who have their own downloaded copies of the GitHub repository can "pull" the changes you made onto
their computer to stay up to date with the latest version of the codebase. Thus, through Git and GitHub, you can collaborate
on coding projects as well as have a detailed history of the project through commits.
So how do you actually "clone," "commit," "pull," or "push" to a repository as described? One way is to
use the built-in version control functionality that comes with many IDEs, as mentioned above. These IDEs handle
the git operations behind the scenes and instead present you a graphical interface to do these operations. As a
result, pulling and pushing can be as simple as clicking a button, and committing is just a matter of typing a
description of your changes into a text box and clicking enter. The other main way is to directly use the git operations
in a command line interface.
Command line
The command line is an alternative method of interacting with your computer. Most people use a graphical interface, which is
essentially all the apps and functionality you have on your computer with a UI (web browsers, file explorer, etc.). With
the command line, you type in commands to interact with your computer rather than clicking or dragging and dropping.
On macOS and Linux, you type these commands into an app called Terminal (a Mac Terminal window is shown above), whereas for
Windows, you use an app called Command Prompt. For example, to list files in the current folder, you can type the command
ls
(or dir
on Windows, which uses a different set of commands). To change folders (aka directories),
type cd foldername
, where cd stands for "change directory." If you have Git on your computer, running git
operations is just like running any other command: git pull
, git push
, etc.
Although it seems insane that anyone would use the command line instead of a graphical user interface, it's
very common among programmers and is an important skill to learn. More powerful capabilities and faster
execution are just a few of its benefits over graphical user interfaces.
Of course, there are hundreds, maybe thousands, of commands; especially for beginners, it can be very difficult to
memorize them all. Given time, however, the most important commands quickly become second nature to you. In the meantime, if
you use a Mac and need help keeping track of your Terminal commands, go to the home page to try out Bidbar,
a snippet manager that also allows you to run or copy your commands using keyboard shortcuts.
Conclusion
While I definitely wouldn't expect new programmers to delve into these topics all at once, it's helpful to at least familiarize yourself with them. As you continue to learn how to code, getting a head start in these areas will help you in the long run. And don't worry if you didn't fully understand everything; it will all make sense eventually!