Let’s take a break from programming for a while and talk about biology. More specifically, cells. I promise this will tie into message passing, just stick with me.
This is a repost from programmingwords.com. It’s a blog about about different computer science topics explained in a simple, understandable way. Check it out if you’re interested in compsci, compilers or programming languages! :)
We usually think of our bodies as machinery of bones and organs, pushed and pulled by muscles and neatly wrapped in a layer of skin. …
You don’t always think about mathematicians building stuff like engineers do, but the truth is mathematicians build things all the time. It’s just that the things they build exist mostly in their minds (and published papers). They’re not concrete things you can look and feel. They do this to prove theorems or properties. Turing did just that when he “built” the Turing machine.
To set the scene, imagine it’s around 1928 and no programmable computer was invented yet. But mathematicians did study algorithms and computable things. …
When a compiler encounters an expression, usually it tries to evaluate it. Evaluation is the process of getting the root meaning of a piece of code. The meaning of
5 + 3 is
8. Our brains also do this: when somebody tells you, "She's a good programmer!", your brain is evaluating the "she" in the sentence. If "she" was defined earlier, it will evaluate to a pointer to a person. :)
While most languages do this immediately, it’s not very efficient. Not all expressions are worth evaluating. …
You probably know how OOP works. The class
Dog inherits from class
Animal, which means that if you have a
Dog you access methods from
A class is a blueprint. It contains information about what every instance of that class has. It tells you which methods and properties are there and how you can use this class of things.
The class itself doesn’t actually contain any data. That’s the job of an object. A class is the blueprint for…
Recursion is, simply put, a function calling itself.
someFunction(x - 1)
If you try to run the above code, you’ll notice it will run in an infinite loop until something on your machine crashes terribly. This is why every recursive function has two parts: a base case and recursive case. In the above example, we only have a recursive case: that’s the part where you recursively call the function. For the function to ever complete, we need a way to break out of the loop.
if (x == 0)
someFunction(x - 1)
You’ve heard of object oriented, imperative and functional programming. These are all different programming paradigms, or ways of thinking about programs. The reason you’ve heard of these is because they’re really popular paradigms. But they’re not the only ones out there! There are probably more than 20 different programming paradigms in use today, and that’s not counting their various combinations and offshoots.
Today I want to talk about one of those less popular paradigms, and it’s called stack based or stack oriented programming.
To understand stack based programming, we first need to understand the concept of a stack. Stacks are…
What’s the smallest number greater than 0? This is one of those simple questions with complicated answers somewhere between “there is none” and “it depends”.
If you ask a mathematician, they will tell you that there can’t be such a number because it would break math. If you have a number n, where n is the smallest number after 0, then there can’t be a number n/2, because n is already the smallest. This means that division itself breaks down, which mathematicians don’t like.
If you ask a computer, you will actually get an answer. As opposed to the real…
Sometimes it feels like programming languages didn’t really change from the 60s up to now. When I feel that, I often remind myself of the cool tools and features we have now that make our lives easier. We now have things like an integrated debugger, unit tests, static analysis, cool IDEs, typed arrays and others. Language progress is slow and iterative, there are no silver bullets that will come in and change the game.
Today I want to tell you about the next step in this iterative process. People are still researching this technology, but it has the potential to…
I usually don’t wear a watch, but recently I found a watch I got as a gift at the bottom of my closet. I dusted it off, went to a watch repair shop to change the battery, and it’s ticking again. Wearing it for a few days, I noticed a really good advantage of wearing a watch: you can tell the time! Right now you are probably thinking “Are you kidding me?” and I’m not! By this point I’m used to pulling out my phone and waiting for it to wake up to tell me what time it is. …
As programmers, we spend our days battling the enemy. The enemy is tough, devious and sneaky. The enemy entrenches itself into your own lines (pun not intended) only to be found when it’s already too late. This enemy is complexity. It increases bugs, makes it harder to reason about your code and to change stuff later on.
But fear not, brave soldier! You have powerful weapons to fight this enemy! Design patterns, architectures, programming techniques, all of them try to reduce complexity, or at least push it around.
However, all great battles require a strategy. And in order to create…
iOS developer, programming language nerd