Lovable Bastard
Join Date: Dec 2005
Location: Boston-ish
|
It's not that I don't understand it myself, it's that I couldn't explain it in a way which made sense to him. But that probably speaks to my understanding of it as well, which is why I'm here.
Long story short, I'm driving into Boston for happy hour the other day with my two friends Matt and Chris. Chris got an iPhone for his birthday and now he really wants a MacBook for his next computer. Chris has never really been into computers but he loves his iPhone, and the entire thing has gotten him really interested in computers in general. So we're about to get on the pike and Chris goes, "so, how does a computer work?" I look at him and say "that's a very broad question. Can you be more specific?" So he goes, "well, you write code, right? And it's words and symbols, it's something that a human could read. But then you feed that code to the computer and it does stuff. I thought that computers can only read ones and zeroes?" "That's right, computer hardware itself operates with binary code. I typically write code in what's called a high level language, which gets converted into ones and zeroes before the computer executes it." "Why don't you write in ones and zeroes?" "Well, I could, but it would be unimaginably tedious. We write in higher level languages because they provide abstraction, which means I can tell the computer what I want it to do using language that is more familiar to humans. Writing even the simplest command in binary would require lots of ones and zeroes and I only have to screw up one digit to make the whole thing crash and burn. You would have to be very talented to write something interesting in binary and it would take forever." "So if the computer can take the high level code you write and execute it, why do computers still have to work in binary?" "Because it's all the computer can understand. At it's most basic level, a computer is just a gazillion switches, and depending on how the switches are arranged, the computer does things. When we say ones and zeroes it would be more apt to say 'on' and 'off,' because whether or not certain switches are on or off is what determines the output. It sounds crazy but you have to take into account that we are talking about a lot of switches. You need a group of thirteen switches just to add numbers less than eight." "Yeah, but, as the programmer, you're still typing high-level code into the computer and the computer executes it. If I know Spanish and English and someone is speaking to me in Spanish, I don't need to write it down and translate it to English to understand it." "Well, the natural language analogy fails there, I guess. That's not how a computer operates; it has to convert code to machine code before it can do anything with it." "But if the computer itself is doing the converting, then why does it need to convert to begin with? If it knows how to convert it, then that means it understands it, and conversion shouldn't be necessary." At that point I didn't really know how to keep going with it. I couldn't come up with another analogy that would explain it to him. Has anyone successfully explained this to someone who hasn't studied it? It occurs to me that it may be a lost cause, and that this may just be one of those things that is too complicated for someone to understand after a 20 minute conversation, but I'm curious anyway. Strangely enough I've been asked this question before and I'd be nice to have a short explanation even if it isn't thorough. Logic, logic, logic. Logic is the beginning of wisdom, Valeris, not the end. Last edited by Kraetos : 2009-08-03 at 18:33. |
quote |
Banging the Bottom End
Join Date: Jun 2004
|
Explain that the code is in text, then converted to a processor-specific binary format. The compiler translates from human into binary as the CPU only understands binary; you hired a translator (compiler) because the computer doesn't understand human.
|
quote |
¡Damned!
Join Date: May 2004
Location: Purgatory
|
Nobody inherently "understands" anything. Any information received by the senses is broken down into electrical synapses (that would be the on/off part) and "recompiled" into something our brain can react to, be it temperature, voice, pain, etc.
So, in my analogy, "high-level" code could be the sound of a bee buzzing nearby. My brain breaks down the input into electrical jolts, recompiles it, then triggers the appropriate action to my arm/hand to shoosh it away. So it goes. |
quote |
Lovable Bastard
Join Date: Dec 2005
Location: Boston-ish
|
That's where he's getting hung up. He sees the compiler and the CPU as one in the same and I don't know how to make that distinction clear. To him, it's just "the computer."
Logic, logic, logic. Logic is the beginning of wisdom, Valeris, not the end. Last edited by Kraetos : 2009-08-03 at 15:45. |
quote |
is the next Chiquita
Join Date: Feb 2005
|
Maybe this relic will give you some idea as this is basically another guy same similar question.
As for the compiler/CPU, make sure you point out that compiler is a software itself. Furthermore, ask him how he would write a compiler. Maybe it'll help him thinking about how it had to come from a even more primitive version (e.g. assembler) and using assembly language was valuable when resources were scarce but now it's not so scarce, we can be more productive using high level language. |
quote |
‽
|
Stick to the natural language thing. Even if English is your "native" language, it's not the one your body works with. Organs communicate with each other by sending hormones, electric impulses, etc. — not by using the English language. And while humans appear to communicate with each other only with words, body language plays a big role as well.
In a sense, English compiles down to our truly native language the same way a programming language does to machine code. |
quote |
Thunderbolt, fuck yeah!
Join Date: Jan 2005
Location: Denmark
|
Well, that's simple:
The compiler is a piece of software that in itself is is made up of binary code. It's capable of translating your high level language into a binary language that the CPU understands. The CPU is a piece of hardware that only understands binary language. The CPU (along with the rest of the hardware) uses the binary code to execute software, such as a compiler. Yes? |
quote |
is the next Chiquita
Join Date: Feb 2005
|
One more point though I would hesitate to share if it's more likely to confuse: Even though all computer uses binary, how the CPU use binary is not universal, kind of akin to how Latin alphabet can be used among several languages but knowing the alpahbet does not enable you to understand the other languages. Every CPU (family) has their own instruction set (e.g. their native language) that may be similar but not identical to others' instruction set. Writing high-level language allow us to share the same function among several possible instruction sets. So yes, you could write in binary directly but that would mean you are now tied to a specific CPU. There's no guarantee that even the next generation CPU from same manufacturer will use the same instruction set, and that would seriously crimp on our productivity.
But this may end up confusing some people more, though. |
quote |
Lovable Bastard
Join Date: Dec 2005
Location: Boston-ish
|
Quote:
Quote:
Quote:
I don't remember his response but it didn't get the point across. Quote:
Logic, logic, logic. Logic is the beginning of wisdom, Valeris, not the end. |
||||
quote |
Veteran Member
Join Date: Jul 2005
Location: Unknown
|
Quote:
One person knows Spanish (programmer) - and he speaks this to another person who knows Spanish and English (compiler). The Compiler converts the Spanish to English (1's and 0's) and gives this to the CPU - which doesn't natively know Spanish. If that fails, tell him that once upon a time, someone had to sit down and write an English-CPU translation dictionary, and that this was all done in 1's and 0's. It took a very long time, and we never want to have to do it again. From now on, programmers just funnel everything through the translation dictionary. The End. Do you know where children get all of their energy? - They suck it right out of their parents! |
|
quote |
is the next Chiquita
Join Date: Feb 2005
|
One more thought. Could it be that your friend has mistakenly and unintentionally attributed some kind of intelligence or sentience to the computer? I remembered some people having the impression that the computer was "smart" when in reality it was just a cleverly designed program, in which case I would point out that computer is nothing but an automata carrying out orders mindlessly; it just seems creative only because it's reflective of the programmers behind it.
|
quote |
Lovable Bastard
Join Date: Dec 2005
Location: Boston-ish
|
Quote:
Here is the part of the conversation he appeared to be the most hung up on: Me: "The compiler has to convert things from high-level code to binary so the CPU can execute it." Him: "But if the computer does both the converting and the executing, why does it need to convert it? If the computer converts high-level code to binary code, why can't we make a computer which understands high-level code?"* I like 709 and chucker's analogy. Computers "think" in binary and have to "learn" programming languages, like a human thinks with electrical impulses and has to learn natural languages. You can't make a CPU which understands high-level code for the same reasons why you can't make a baby which can speak English at birth. Babies learn, computers have software installed on them. Quote:
Unfortunately the electrical impulses analogy may cement the "computers are smart" misconception. Maybe not, though, since I could point out that while humans can learn things on their own, computers are helpless without software written and installed by humans. *He then proceeded to tell me that there are clearly billions to be had if I could devise such a CPU. I told him he should stick with philosophy Logic, logic, logic. Logic is the beginning of wisdom, Valeris, not the end. Last edited by Kraetos : 2009-08-03 at 18:38. |
||
quote |
OK Mr. Sunshine!
Join Date: Oct 2006
Location: Toronto
|
I don't understand this stuff too much (but I've found this discussion to be really interesting), but this seems to make sense to me: You have three people. One speaks English, one Spanish, and one speaks both. There is basically a translator in between the two parties that converts their native languages so that they can understand each other.
That's what I understood, anyway. Edit: What zippy said. If he doesn't get it, open up a computer for him and show him the parts. Do not be oppressed by the forces of ignorance and delusion! But rise up now with resolve and courage! Entranced by ignorance, from beginningless time until now, You have had more than enough time to sleep. So do not slumber any longer, but strive after virtue with body, speech, and mind! |
quote |
is the next Chiquita
Join Date: Feb 2005
|
An alternative analogy to work is to go back to older form of computing where instructions was given by feeding in punch cards. Make the point that the Word, Excel, Safair, whatever are basically a bunch of punch cards that puts the computer in a state where it can understand input expected for each program (e.g. text, financial data, URLs) and act upon it & return result, then make the point that compiler is just a punch card that enables the computer to create new software (new punch cards created as a output) that can then be used as an application.
Maybe the usage of something more concrete than software will help illustrate the role of software (and consequently the compiler's role) more clearly? |
quote |
Veteran Member
Join Date: Jul 2005
Location: Unknown
|
The only other options I can think of are:
1) Go ahead and just reinforce that it IS just a magic box and that it's best not to try and understand something that isn't understandable 2) Tell him that we don't want the 'machines' to understand high-level language, or they will soon takeover the world. We only let them know 1's and 0's to keep them 'stupid'. Do you know where children get all of their energy? - They suck it right out of their parents! |
quote |
¡Damned!
Join Date: May 2004
Location: Purgatory
|
Quote:
Maybe a better analogy, though a little different, would be a Lite-Brite. You, as a programmer, provide the coordinates and colors of each peg. You may write "red" in the code, but the compiler (ostensibly a human, yes, but let's stretch it to say computer, since the human is just following your directions as a computer would) doesn't understand "red," being a human construct and all. Instead, it searches its databank for <red> and converts it into "its" language, which is 01101000100011. It sends the command to insert 01101000100011 at coordinate 000,001,057. Ad infinitum until the desired end is achieved. It could be a flower, a bunny, or the letter G. The compiler doesn't know, and more importantly, doesn't care. There is no sense of beauty or satisfaction of a job well done. It does. Because you told it to. So it goes. |
|
quote |
Lovable Bastard
Join Date: Dec 2005
Location: Boston-ish
|
Alright, well, when my friends come over later tonight for our nightly "get stoned and play Halo" marathon, I'll see which explanation works best.
|
quote |
¡Damned!
Join Date: May 2004
Location: Purgatory
|
"See, the Gravemind acts a the compiler, whereas the Flood act as..."
|
quote |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
Magic.
Or gnomes. And say it with a dead serious look on your face and after a second or two of silence, grimace and sigh softly as you slowly shake your head and walk away. That always gets 'em. The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting. |
quote |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
Oooh, or better yet: tell them to rent or Netflix a copy of Tron. Explain that the movie is a dramatic telling of what really happens inside computers... because it is, after all.
The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting. |
quote |
OK Mr. Sunshine!
Join Date: Oct 2006
Location: Toronto
|
It's funny, because I understand your friend's line of questioning. He's obviously not a dumb dude, though he clearly doesn't know a thing about technology. I really could have answered his questions at all until I read this thread, and I even know a bit about computers.
Do not be oppressed by the forces of ignorance and delusion! But rise up now with resolve and courage! Entranced by ignorance, from beginningless time until now, You have had more than enough time to sleep. So do not slumber any longer, but strive after virtue with body, speech, and mind! |
quote |
Lovable Bastard
Join Date: Dec 2005
Location: Boston-ish
|
Quote:
"You're good with computers, right? I've always wondered, how does a computer work?" "Magic." "Seriously?" "Unless you have several hours to spare, and are willing to learn boolean algebra right now, yes. Magic." "Sounds good." I have Tron on my computer, and now all I want to do is get my friends really high and then try and convince them that yes, Tron is a 100% accurate depiction of how computers work. Except Tron is 25 years old so now, everything is smaller and faster. And instead of Bruce Boxleitner, it's now Chris Pine. Logic, logic, logic. Logic is the beginning of wisdom, Valeris, not the end. |
|
quote |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
|
quote |
¡Damned!
Join Date: May 2004
Location: Purgatory
|
|
quote |
Lovable Bastard
Join Date: Dec 2005
Location: Boston-ish
|
"So for the same reason you cant have baby which knows English when it's born, you can't make a CPU which understands C."
"Makes sense. So now all you need to do is make a baby which understands English." "I'm on it." He seems to have a pretty firm grasp on it now. Thanks guys! Logic, logic, logic. Logic is the beginning of wisdom, Valeris, not the end. |
quote |
I shot the sherrif.
|
Actually the human body analogy is a good one.
You write code that says "move your finger" and the computer translates that to the equivalent of the electrical impulses necessary to make that happen. At the end of the day, we have designed computers that understand high level language, via software, compilers, assemblers etc. That doesn't change the underlying physical nature of the computer though, which is limited to electrical impulses. Just like simple computers can't understand complex programs, simple organisms can't understand language etc. They still operate using the same basic biology though, which is what he doesn't get. What he's saying is that you should invent a new computer at the cellular level, which isn't happening. Google is your frenemy. Caveat Emptor - Latin for tough titty I tend to interpret things in the way that's most hilarious to me |
quote |
Veteran Member
Join Date: Jul 2005
Location: Unknown
|
|
quote |
Space Pirate
Join Date: May 2004
Location: Atlanta
|
nerds
I'm going to beat you up and steal your lunch money. ... |
quote |
Stallion
Join Date: Feb 2006
Location: Milwaukee
|
|
quote |
Veteran Member
Join Date: Oct 2005
|
Your topic title would look better if it ended in "FML".
|
quote |
Posting Rules | Navigation |
|
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Wireless game adapter" + wired router: will this work? | Wyatt | Genius Bar | 0 | 2008-10-09 10:01 |
Does the Apple Remote work with the "EyeTV for DTT USB Stick" IR sensor? | Roberto Alvarez | Apple Products | 1 | 2008-05-25 14:27 |
Parallels Desktop getting Stuck on "Applying Computer Settings" | jcoley2 | Genius Bar | 11 | 2006-10-28 16:20 |
Please explain "index" in MySQL | nassau | Programmer's Nook | 7 | 2006-10-04 16:49 |
Feb 28: 13-in MacBook Core Duo confirmed. (according to some guy's "friend" at Apple) | AlexN | Speculation and Rumors | 32 | 2006-02-25 18:20 |