1. Typescript Makes Me a Better Developer

Coming from a background in strong-typed languages such as C and C++, I often miss writing function prototypes with explicit type declarations. I miss the feeling of knowing exactly what is coming in and out of my programs with the compiler holding me accountable every step of the way. Although higher-level languages like Python and Javascript allow you to develop faster with shorter lines of code, they come at with the cost of bugs being more able to slip in. When you write thousands of lines in an application, it is easy to forget the data types of all your…


Photo by Raul Varzar on Unsplash

The internet is a pretty rad place. I just googled “pictures of cats” and got back 2.9 billion results in less than 0.48 of a second. How insane is that?

Whenever we use a search engine such or any website for that matter, we often take for granted the number of steps that are happening behind the scenes in order for us to get content to display on our screens. …


Photo by Jens Kreuter on Unsplash

Internet 2.0

I remember fondly when I first encountered the internet at the ripe age of eight and thinking it was the best thing on earth. I was able to download music at blazing 56 kb/second speed, read about my favorite video games on GameFAQs.com and chat with my friends/random strangers on Aim Messenger. It was truly a brand new world.

Twenty years later, the internet is still pretty awesome. Many things have changed since then; it is no longer a nice thing to have, but rather a necessity in our everyday lives. The internet is a digital fabric that is woven…


Photo by Domenico Loia on Unsplash

Love it or hate it, sorting is a task that every software engineer will be asked to study or implement at one point in their career. In today’s world, there are countless algorithms used to achieve this purpose, each with their own strengths and weaknesses. Some perform better in time complexity but require extra space, some perform extraordinary well in speed but are limited with positive integers only, while others will turn your computer into a portable heater.

Today I am going to test the speed of 10 different sorting algorithms in Python. …


Photo by Adam Muise on Unsplash

How machine learning works:

Interviewer: What’s your biggest strength?

Computer: I’m a fast learner.

Interviewer: What’s 11 * 11?

Computer: It’s 65

Interviewer: Not even close. It’s 121.

Computer: It’s 121.

Artificial Intelligence

The first thought a lot of people associate with artificial intelligence is killer robots taking over the world like in blockbuster movies such as Terminator and Ex Machina.

Although that inevitable future is still quite far away, AI is very much a big part of all of our lives in the devices and technologies we use. From applications like Amazon’s Alexa who orders our groceries for us, or Netflix…


Photo by Roman Bozhko on Unsplash

What are Hash Tables?

In computer science, a hash table is a data structure that implements an array of linked lists to store data. Using a hash algorithm, the hash table is able to compute an index to store string different key-value pairs.

Today, I will demonstrate how to create this data structure in C++. This is my first application written in this language so all criticism and feedback to help me improve is welcome. :)

Starting Small

The first thing we need to do is create a Node class to store our key-value pair.

class Node
{
private…


Photo by Marius Masalar on Unsplash

In Python and other Object-Oriented languages, classes are considered the blueprint to creating objects. An instance is a copy of the class with actual values.

To define a class in Python3, you can do the following:

class Monster:
pass
m = Monster()
type(class)
# <class '__main__.Monster'>

Class Attributes

Class attributes are attributes which are owned by the class itself. They will be shared by all the instances of the class. Therefore they will have the same value for every instance. We define class attributes outside of all the methods, usually, they are placed at the top, right below the class header.

Let’s…


Photo by Todd Quackenbush on Unsplash

Introduction

Object-oriented Programming, or OOP for short, is a programming paradigm which provides a means of structuring programs so that properties and behaviors are bundled into individual objects. In Python, every data type underneath the hood is actually an object with its own attributes and methods. Similarly to other OOP languages, Python uses classes as an object constructor or a “blueprint” for creating objects.

id, type, isinstance

Using the interpreter, a user can find the type of object a value or variable is by entering the following:

type(5)                # <class 'int'>
type("hello") # <class 'str'>
type([1, 2, 3]) # <class 'list'>

You can also…


Photo by Mikael Kristenson on Unsplash

Ones and Zeroes

In computer science, integers can take up 1, 2, 4, or 8 bytes in memory. Each of these bytes is comprised of 8 bits, each of which can be either be a 1 or 0, true or false. Like lights turning off and on, the combination of these bits together represents characters and numbers that we see on our screen. When people say computers only understand 0’s and 1’s, this is essentially true on a very large scale. Computers can compute billions of these bytes per second and perform bitwise calculations at incredulous speeds.

Numbers Have Life

Today we will look closely at…


Photo by Andy Brunner on Unsplash

Today we are going to write a function that determines if a singly linked list is circular and if it is, we are going to return the node where the cycle begins. This solution is based off of Robert Floyd’s algorithm, first discovered in the 1970’s.

What is a Singly Linked List?

A singly linked list in C is a linear data structure where each element is a separate struct (or class/object in other languages). Linked list elements are not stored at contiguous memory locations; the elements are linked using pointers. Each node of a list is made up of two items — the data and…

Tu Vo

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store