Tips and Tricks for an Intro Computer Science Course

Ethan Parker Wong
4 min readDec 17, 2022

--

Whether it is a requirement or you want to learn computer science, every university has an introductory computer science course. But as someone new to programming, how do you succeed? This article provides tips and tricks for succeeding in any introductory computer science course.

Note-Taking

Note-taking can be daunting in a first-year computer science course, as typing in word or google docs might not cut it. Specifically for in-class examples, it is better to write it in an IDE to see how the program works. However, in many IDEs, the only way to take further notes is to comment in the IDE, which makes some in-class examples unreadable.
But there are specific IDEs that can handle both everyday note-taking and writing examples in the program; here is one IDE that does so.

Jupyter Notebook is a great way to start if the course is in Python. Jupyter Notebook is a web-based notebook-like environment that allows for notes and programming examples. Here is an example of the environment in Jupyter notebook.

Other IDEs with this notebook-type environment are Boost Note, Notion, Google Colaboratory, and Quiver. Note: some of these IDEs support languages like Java, Javascript, C++, etc.

Solving Assignments

Sometimes the assignments given in an introductory computer science course might be challenging and frustrating. However, do not give up! There are a bunch of resources online and tricks in the IDE that can help you!

Have you ever had times when your code gives the wrong result, or your IDE consistently gives you some error? Do not fret; there are many ways to solve the issue.

Firstly, in most IDEs, there should be a debugging tool; learn how to use it immediately. This debugging tool is essential in solving your issue, as it shows step-by-step how the program works.

Here is an example of using the debugging tool in the IDE Thonny.

Another way to debug is to insert a print statement in any of the loops or statements, as you can see in the program’s control flow.

Lastly, you can search the type of error you have on Stack Overflow typically has the solution of the error on it.

What if you fixed all your errors, but the code fails all the public, or private tests the professor has given you? Here is a trick, figure out all of the edge cases of the program. Edge cases are the best way to find out what’s directly wrong with the program, as they can solve fundamental and minor errors at the same time. Every time you start reading an assignment, I recommend you record all the edge cases you have and use them to test your program later.

Elegance of Code

Code that is hard to read is destructive, as when you are doing assignments, you might get lost, or during an examination, the marker might get lost in it; here are some ways to write elegant code.

Doc strings are essential in code. Here you can write out potential test cases, state what each function or class does, and keep sight of what input and output each function should compute. Doc strings increase the readability of code.

Here is an example of a doc string; writing these might be mandatory depending on the class. It might seem like an abundance of work but trust your professors; these help in keeping sight of what you are programming.

The second way to increase readability in code is to write comments. Comments are essential in stating what each compartment of your code does so that whoever is reading your code knows how exactly it works. Remember to comment only a little but also to comment only a little. There should be an excellent in-between in the usage of comments.

The third way to write efficient code is to write objectives on paper. Sometimes seeing code can be too much for a person. However, breaking an assignment up step by step on a piece of paper helps you organize and reduces any redundancy in code.

Final Words

Overall, an introductory computer science course in University is fun! I recommended for everyone to take one as it helps build important technical skills.

Anyways have fun and good luck programming!

--

--