Declarative Programming with Prolog – Part 1: Getting Started

Have you ever run into a programming problem that seemed difficult to solve, but you could easily describe the rules of the problem? Think about games like tic-tac-toe, checkers, and sudoku; as humans, we’re able to understand the rules of these games pretty easily – and sure, you could write a program to implement them, but it wouldn’t be…

Why Random Numbers are Impossible in Software

The title of this post might seem preposterous to you – I mean, many programming languages have the capability to generate random numbers, right? You’ve got Math.random() in JavaScript, rand in Ruby, the random package in Python – the list goes on and on. Well, believe it or not, I’m here to tell you that it’s impossible…

Design Patterns: Dependency Injection

If you’re a developer, you may have heard of the phrase dependency injection (DI) before as a possible design pattern you can use. It’s been around for a long time, and many popular frameworks such as Angular.js use it by default. In standard code, it’s common to declare a dependency in the same lexical scope where you…

How Daemons, the Init Process, and Process Forking Work

If you’ve ever worked with Unix-based systems, then you’re bound to have heard the term daemon (pronounced dee-mon) before. My goal here is to explain exactly what they are and how they work, especially since the name makes them seem more convoluted than they actually are. At its surface, a daemon is nothing difficult to understand –…

How Public Key and Symmetric Key Encryption Work

Public-key encryption and symmetric-key encryption are two of the most fundamental cryptographic systems out there and they’re also the driving force behind the Transport Layer Security (TLS) protocol. TLS is an evolution of Secure Sockets Layer, or SSL, and it defines how applications communicate privately over a computer network (the most famous network being – yup, you guessed it –…

How Browser Caching Works

Have you ever noticed that when you load a web page for the very first time, it takes a little bit longer than the second, third, etc. times that you visit that page? That’s not just coincidence my friend, that’s browser caching, and today we’re gonna explore everything about how it all works. Before we move to…