You may have heard the old programmer's joke:
There are 10 kinds of people in this world:
Those who understand Binary,
And those who don't.
This is an excellent introduction into the topic.
Computers, being dumb machines, are composed primarily of a host of switches. These switches have two states: ON and OFF (or CLOSED and OPEN). When the
For part 1, see CS 101 - Introduction to Logic
Solution to last week's problem
In our last post, we considered the following problem:
if( m == k * k || i == 1 && j == 1)
printf("What's the result?");
It turns out that boolean (read: computer binary) logic also operates on
Computers are dumb.
Computers follow very rigid patterns of logic, which we call programs. Without understanding this logic, we cannot cause a computer to perform even the simplest tasks, leaving us without the foundation for the more complicated tasks.
What is logic
Logic is, fundamentally, a system of rules by which we can derive certain truth. It
The journey of a thousand miles begins with a single step.
You have to crawl before you can run.
In order to become an effective computer scientist, you have to learn the basics. It's disturbing how often this is glossed over these days, but it is the truth. This series will cover a host of
We have it pretty good these days. For decades, graphic user interfaces (GUI) have blessed our computer screens, allowing us to perform amazing tasks with relative ease.
Well, maybe not amazing tasks.
And maybe not so much ease.
You see, there is one thing that the GUI can never truly improve: writing. Every time you take your
Stop me if you've heard this one. You've just put together a program, and the logic looks alright, so you start handling error cases. As you go, you drop in dozens of new variables, lay down return values every other line, and throw down hundreds of print statements. Worse still, you might resort to
During my recent experimentation with the OpenSSL API, I have run across this style of error handling:
char * astring = set_value();
ssl_err = ERR_get_error();
ASSERT(NULL != astring);
if(!(NULL != astring))
print_error_string(ssl_err, "Error initializing astring");
I have come to understand that the ASSERT() function is a test which breaks out of the program on failure. This means that in
I am no longer the Dallas programmer, as I have transitioned into Fort Collins.
The content I seek to provide is similar to that I provided