Have you ever watched a Roomba work its way around a room? They work in a random and chaotic manner - first they go a bit this way, then a bit that way. They bounce off of walls, chew up cords, and generally make a nuisance of themselves. Sometimes, they sit for a few
As we design functions, we have to consider how they will work in the real world. There are two common considerations as we compare solutions:
Time complexity - The amount of time it will take for our solution to complete
Space complexity - The amount of memory that our solution will consume
Unfortunately, because we can't afford
The hardest interview I ever had: someone told me to go up to a whiteboard and solve a programming problem, in code, optimally, on the first try.
It's a basic fact of our field that we iterate toward the final product. Not unlike a sculptor bringing the David out of a piece of marble, we
It's amazing how often programmers forget the simplest rule of programming: 1=1.
This is the principle of logical unity (or modularity - they're largely synonymous).
Unity of Function
If we adhere to the principle of top-down modular design, all our functions should be relatively small. At the bottom of the tree, every function serves one purpose and
How many times have I seen this pattern in object oriented code?
All members of the class are private
All members can be accessed with accessor functions
All members can be changed with modifier functions
I hate to break it to y'all, but that's just a struct. The only thing you've done is add a hundred lines
Quality often looks like a buzzword to programmers and users. What is quality, we wonder, and how can we honestly know whether a product is quality? We have three measures in the software world for quality: operability, maintainability, and transferability.
Operability refers to how the system operates (kind of self-explanatory). While there are many subjective
Programs are essentially computer recipes - a series of steps and ingredients (variables) which produces a result. However, when dealing with large problems, we have to create larger and larger recipes. This is why we break down individual solutions into processes we call algorithms.
Algorithm - An Overview
An algorithm is a step-by-step solution to a
Editor's note: This is about as close to a conspiracy theory as I care to share with most people. Take that as you will.
When I say conspiracy theory, your thoughts immediately turn to 9/11 truthers, birthers, and alien enthusiasts. If you are particularly nerdy, they may turn to your favorite episode of the X-Files.