Programming 101 – Why It’s Not As Difficult As You Think

Hey guys! Today I will be talking about all things programming! Often, when I speak with a non-computer science or non-engineering individual about programming they immediately think that it is an alien world – complex, impenetrable, and equally mysterious. I’m here to demystify some of the misconceptions about programming as it really comes down to one basic premise – the execution of logic.

There is hope.

There is hope.

Whether it is in C, Java, HTML, Perl or any other language, in programming the same basic principles are applied again and again. Advanced concepts are simply extensions, the “natural evolution,” of these basic rules. Let’s get to it!

A programming language can be used to create a set of instructions for a computer or device to follow. This set of instructions is sometimes called an algorithm. Oftentimes, a compiler is used to create the code that you write into an executable – something that your device can actively run. Many times a programming language will require you to access predefined code – the idea is that any new piece of code works with reference to and builds on top of existing code. These libraries are huge bundles of code that let you reference code so that your program can get inputs from the keyboard or have access to math functions like sin() or cos(). They contain a ton of symbols, functions, and values.

Each unique quantity in your program is known as a variable – think of these as containers for something meaningful like your age, the temperature outside right now, or your cGPA (sadface). Each of these variables has a type, similar to how your age will always be a number and your name will always consist of letters. Functions are the separate modules of a program, each module corresponding to a specific part of the problem that needs to be solved.

That sweet, sweet feeling when your program compiles without any errors.

That sweet, sweet feeling when your program compiles without any errors.

Onto more technical terms, a bit is known as a binary digit – it can only hold a value of 1 or 0. Think of a bit as a light switch; it can only be on or off. A byte is simply a set of eight bits, or eight light switches that have been grouped together. Characters like ‘a’ or ‘B’ or ‘?’ are stored as bytes.

Similar to bits, conditional operators always return either a true or a false value. An analogy would be that a twin can only be younger than or older than his/her twin sibling. Examples of conditional operators include the greater than (>), less than (<), greater than and equal to (>=), less than and equal to (<=), equal to (==), and the not equal to (!=) operators.

Logical operators are exactly what they sound like – arguments that are used to determine the next course of action as long as some logical requirement is met. When two separate conditions are both to be met, we use the && operator also known as the and operator. If only one condition is required to be met, then the || operator also known as the or operator is used.

To step up the game, we’ll be looking at building our first program on the following installment of Programming 101. Until next time, happy coding peeps!




Related Posts