I’ve always wanted to jot down random thoughts as my brain functions throughout the day so this series of blog posts is meant to keep track of tidbits and stories and I randomly picked up and processed. Also, I realized that the action of blogging actually helps me remember the stuff that I wrote, since the amount of blogs that I wrote is a reasonable finite number.
So every time I have a conversation that is related to my work, whether it’s with a technical, remotely technical or non-technical one, the topic of “what does it actually do” typical comes up. Quite frankly I like talking and do in fact talk a lot. Strangely enough I found explaining to non-technical folks more interesting and rewarding than others, mainly due to the fact that they always question the very fundamentals of computer and computer science. Sometimes when I can’t answer those, my inner curiosity forces me to go look it up, and there goes the momentum of knowledge.
A few weekends ago a friend of mine, whose field of expertise is not remotely related to coding or computer at all, asked me this: “I really don’t understand how you can write code to do stuff. How does that happen?” It is indeed a fundamental question. I recall taking my 1st computer science class and not questioning such thing, but follow the instructor’s directions instead, earning points like a little kid.
It is not until after taking quite a few amount of courses that I realize computer architecture and design mimics the very same concept as human thought process. After all, it is human who evaluates and assess how well certain algorithms function. So how do you write code to do stuff?
“Code”, IMHO, is a set of instructions that, in turn, instruct certain entities (can be machines, humans or animals) to complete certain tasks. Now imagine machine as a Brazilian (or pick any country man who doesn’t understand your language), Portugese, at some level, to me is just like code. It’s a mean of communication from an entity to another entity.
A machine can only understand binary, so there’s definitely a “translator” from codes to binaries, which I won’t go into details. Binary also very much represents human thinking in terms that there’re only 0 and 1, yes and no, true and false, right and wrong. I believe that every human question can be answered with simply yes (1) or no (0). The method to do that is to break down the question into atomic decision, which in turn will guide the machine to a final decision and execute certain operations.
For example: “What’s today’s weather?” can be achieved from yes’ and no’s based on a set of knowledge: Is it raining? Is it sunny? Is it windy? Is it snowing? How does machine define “raining” and such? It doesn’t. Such information can be input as a fact or derived from a set of conditions, such as the humidity, temperature…
The list of decisions build up to a form of a “decision tree”, where a set of answer can lead to a different output, or same output depending on the level of distinction. So given that “stuff” is a piece of knowledge that was given and “do” is a final output from a series of decision tree, that’s basically how I instruct (code) another entity (machine) to do (make decision) stuff (on a certain piece of information).