CS50, Low-level Vs High-level Languages & What is Big O? - Lecture 1,2 & 3 Review

cs50 review
cs50 review

Day 195

Lecture 1 Review

So what's the verdict after watching Lecture 1? Entertaining and extremely helpful! David's energy is on fire and it feels like the content is just getting better and better. I was re-introduced to general programming fundamentals like conditions, boolean expressions, functions and loops. Understanding how these basic building blocks can be used with each other to solve complex problems.

To start things off, we got a fun introduction to the visual programming language called Scratch. He coded up some programs to illustrate what we could do with a couple of basic ideas and stacking them on top of each other. For example, making an object move across a screen in a loop, turning 180 degrees once it made it to either side of the screen. To a fully functioning game where a character, controlled by the user, was programmed to move through an obstacle course while avoiding moving objects.

After that, we got into IDE's (integrated developer environments, software, developers use to code programs), the `command line` and how it's to talk to a computer without a mouse via it's terminal. And finally, 8bit to 64bit computer memory and its use-cases. I was already familiar with some of these topics, so this lecture was an awesome refresher.

programming meme ayo adesanya

Lecture 2 Review

Lecture 2 dove deeper into understanding data structures, functions and programming languages in general. Discovering how we can code in a way that abstracts complexity away. An Abstraction in computer science generally means a simplification of something more complicated. Abstractions are usually created to make a human's ability to program and solve problems more straightforward and intuitive. But there is typically a price to pay for this simplification, but that's a blog for another day.

If you're familiar with the various programming languages out there, Think of it like this.

1. Assembly-line (a very low-level programming language) is an abstraction of machine code (1's and 0's), the lowest level language.

2. C, a low-level language but simpler to write and understand than assembly-line code, could be seen as an abstraction of Assembly-line, but is still regarded as a low-level language.

3. Javascript, PHP, Ruby, Python, C++ (high-level languages) could be seen as abstractions of C.

However a low-level language like C is still used in some areas of industry today due to its faster compile time (the time it takes to translate the C code into machine code, machine code being the lowest level language). Remember the price we usually have to pay for abstractions? We typically pay in speed and efficiency, but in recent times this isn't seen as an issue anymore unless you are building rocket ships and every nanosecond matters.

Higher-level languages, generally across the board have simplified older languages making the coding experience more accessible. Some developers would even argue more enjoyable too.

In all, the lecture was super insightful!

low level to high level programing language ayo adesanya

Lecture 3 Review

Lecture 3 was my first time looking at algorithms. I found it really compelling as it's an area I really want to get great at.

Building powerful applications that manage and process huge data sets are pretty challenging to do without a good understanding of knowing when and how to implement the right algorithms and data structures. As a web developer, I can't neglect this part of programming if I genuinely want to write efficient and scalable code.

David talked about 'Big-O notation', and its importance in describing the worst-case length of time an algorithm will take to finish a task (aka time complexity), along with explaining omega and theta notations. Omega deals with the best-case, and theta is used if the best and worst-cases are the same in terms of time complexity.

There is much more to Big O, like considering space complexity, but that's the basics. If you would like to learn more about Big 0 notation, click here. It's an important and fun topic that will make you a better problem solver for sure. It's already changed how I think about problem-solving completely after learning more about the subject.

Overall, this lecture was a cool introduction into algorithms and I can't wait to start implementing some into my own code in a few weeks!

Until next time, make sure you get your 7 or 8 hours of sleep ;)

Recent Articles