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…