When noodling around on Reddit's /r/learnprogramming, it's common to find misconceptions about how JavaScript works: how does the compiler know to make it asynchronous? how do I make this function a callback? JavaScript is unusual because it is asynchronous by default and so requires a different programming model using callbacks and so on. That can be tricky to understand, which is why this question on Stack Overflow has nearly 6,000 upvotes. Read more »
The operating system (OS) is a very special program. It's the first thing to run when you start up your computer and it is the only program to have complete control over the system. Every other program has to go through the OS when it wants to access system resources. This is a good thing because a malicious or poorly-written program could otherwise steal your data or trash your expensive hardware. Read more »
Look at any computer program and you'll see two things: data and operations on that data. From the computer's perspective, everything is just a huge sequence of ones and zeroes. It is the programmer who creates meaning by telling the computer how to interpret these ones and zeroes. In this post, we'll start off with a quick summary of the distinction between data types and data structures. We'll then look at one of the most fundamental, but surprisingly interesting, data structures: the array. Read more »
Alan Turing (1912-1954) is the founder of computer science. In a single paper from 1936, On computable numbers, with an application to the Entscheidungsproblem, Turing presented the first precise definition of computation. He did this by devising an imaginary computational device, which he called an “automatic machine”, and proving that it was capable of carrying out any computation. In doing so, Turing proved that his automatic machine was equivalent to computation itself. Read more »
You can't go very far in computer science and programming without encountering binary and hexadecimal. Binary is important to understand because it's literally what computers are based on. Don't let your eyes glaze over when you see hexadecimal. It's easy to read and kinda useful. Bits and bytes A binary choice has only two options. Binary numbers are the same. There are only two possible states. A single binary value is known as a bit. Read more »