gabrielleeyj
Navigate back to the homepage
About Me

Common Things in Programming

Gabriel Lee
June 30th, 2020 · 2 min read

Its exactly, 3 years since I’ve started learning the concepts of programming. Though I’m not proficient enough to be called an expert nor do I have the confidence to call myself an expert. I believe that for any beginner who intends to learn how to program should know that it is not enough to know one programming language.

A quick search on google will tell you that there are at least 700 programming languages. And of the 700, about 10% is commonly used. The most famous of them right now is Python, Go, Julia, Javascript, C++, C.

How/Where do I start?

I have a few friends ask me this recently, this is something I’ve been asking myself for the past 3 years. My honest reply is, you can start with any programming language you feel comfortable with. Generally people start with Python because of its readable syntax. However, my personal preference would be to start with C you don’t have to go really in-depth but enough such that you are able to understand the concepts of programming. code reads from top to bottom , defining variable types , conditional statements, etc.

Learning 1 programming language may/may not make you a master. But in a real life working scenario, every “Tech” company uses a different stack/language. If you were to just be good at “1” language, you’ll just be bottlenecked. Recruiters will just throw your CV away at one glance because you dont meet the stack requirement for the prospective company.

In the following examples they will be in Javascript

Common Things 1: Variables

No programming language can ignore them. Variables are the bricks of any programming language. You have to declare/initialize variables they are like the data that the computer needs to feed on.

cookie monster

Common Things 2: Expressions

Expressions are what builds context to your program. It defines how unique your building looks like. It’s used together with statements/loops.

1// Conditional Expressions (Javascript)
2 > // more than
3 >= // more than or equals
4 < // less than
5 <= // less than or equals
6 == // equals
7 != // not equals (not)
8 || // or
9 && // And

Common Things 3: Statements/Loops

Statements are like the mortar/cement that combines the bricks to build a wall. Its the foundation of making things useful, without Statements (Conditional). The computer will not be able to understand what you are telling it to do.

if-else statement
1const variable = 1;
2const anotherVariable = 0;
3if (variable != anotherVariable) {
4 console.log("Not Equal");
5} else {
6 console.log("Equal");
7}
boolean (true/false) statement
1while (True) {
2 console.log("It works");
3}
while Loops
1const variable = 0;
2
3while (variable > 9) {
4 console.log(variable);
5}
for Loops
1const variable = 9;
2for (i = 0; i > variable; i++) {
3 console.log(i);
4}

Common Things 4: Arrays

Different programming languages have different styles of arrays. But generally arrays can be defined by square brackets []. Arrays are a more advanced version of variables. They store data more visibly, essentially they are like the individual units in a building. More commonly explained like a mailbox.

mailbox

Normally, if you were to create individual variables for every single item you have. It would be so daunting and reptitive, programming is supposed to make your life easy! Thus, the concept of D-R-Y Don’t Repeat Yourself is applied.

arrays
1// Normally if you were to create individual variables for items
2var watch = "casio";
3var watch1 = "g-shock";
4var watch2 = "baby-g";
5var watch3 = "rolex";
6
7console.log(watch); // prints : casio
8...
9console.log(watch3); // prints : rolex

Without arrays you need to have 8-10 lines. But with arrays everything can be simplified and more readable in 1 - 4 lines.

1// With arrays it makes it so much easier
2var watches = ["casio","g-shock","baby-g","rolex"];
3console.log(watches[0]); // prints : casio
4...
5console.log(watches[3]); // prints : rolex

So I hope this is enough to give you a broad perspective of what programming is all about. Apart from the complex algorithms and data structures and the time, space complexity of sorts. Programming can be fun, and you should enjoy it!

Build simple things that you like, create scripts to automate your work. Build a game!

I’ll shamelessly advertise my programming project here built with Pygame: Pygame-RPG Its a Final Fantasy style clone. Not complete but it works!

More articles from gabrielleeyj

Understanding CS50

Recently, edX was giving out free signups for HarvardX CS50. So I thought to retake and review the course once again but this time paying…

June 22nd, 2020 · 1 min read

How I learnt to code

Before I begin, let me warn you first that this is going to be a long read. I started to code in html and css back in the 1990s, when…

June 15th, 2020 · 5 min read
© 2020 gabrielleeyj
Link to $mailto:hello@gabrielleeyj.comLink to $https://github.com/kayigeLink to $https://www.linkedin.com/in/gabrielleeyj/Link to $https://www.instagram.com/gabrielleeyjLink to $https://www.facebook.com/melchsee