Lurker News
I'm reading Petzold's Code [1], and it dawned on me that I didn't understand logic gates intuitively until now. I took a Computer Architecture course back in college, and I understood what logic gates meant in boolean algebra but not empirically. Petzold clarified this for me by going from the empirical to the theoretical using a lightbulb, a battery, wires, and relays (which he introduces when he talks about the telegraph as a way to amplify a signal).

Another concept is the relationship between current, voltage, and resistance. For example, I always failed to understand why longer wires mean more resistance while thicker wires mean less resistance.
[1]: https://www.codehiddenlanguage.com/

Comments (913) 203 threads

Earlier comments
hospadar2 replies#
Voltage and amperage for me, years after a college electronics course and a childhood of soldering kits I finally started to get it. I was always tripped up with analogies about how it's like water in a pipe or something, which can be useful, but aren't quite right.
marshmellman1 reply#
Can you share what helped it click? I’m in the same boat, trying to understand it through analogies.
carapace1 reply#
These are physical properties that can be experienced (although there is some risk) for voltage you can touch a Van de Graaff generator, for current you can touch a battery to your tongue.

That's the way to understand electricity without analogies. :)
Anyway, voltage is always measured between two points (one is typically called "ground" but that's not important here.) It's a difference. (A difference of what? No one knows. That's just the way it is.)
Current is always measured through a single point. It's a count of the charge flowing past a point per time unit. (What is charge? No one knows. "Charge" is just a name for the mysterious something that "voltage" is a difference of...)
When electricity moves it obeys a (very simple) Law called (Ohm's Law) e.g.:

    E = V/R
The current (E) is the Voltage divided by the Resistance.

E.g. is I have a 5 Volt power supply and I put a 100 Ohm resistor across it (remember that voltage is always between two points) then 5/100 Amperes of current will flow through it.
Also, If I take just the resistor and drive 0.05 Amps through it, it will develop a voltage of 5 volts, as measured from one end of the resistor to the other end.
Now if that doesn't help you, remember the advice of John Von Neumann to Felix Smith: "Young man, in mathematics you don't understand things. You just get used to them."

_dain_1 reply#
>Current is always measured through a single point. It's a count of the charge flowing past a point per time unit. (What is charge? No one knows. "Charge" is just a name for the mysterious something that "voltage" is a difference of...)

I think you're being overly mysterious here. It's the number of electrons passing through the wire per second. And charge isn't the thing that voltage is a difference of; it's potential difference, as in electric potential energy. The "water in a pipe" analogy really isn't that bad; it's gravitational potential instead of electrical potential, and amount of water instead of amount of electrons.

Continue this thread — 1 reply

clarkdale#
I would love to hear this in a way other than water in various sized pipes.
shrimpx1 reply#
I studied functional programming and I took terms like "expression", "evaluation", and "value" for granted until it clicked that these terms have intuitive meaning when interpreted in colloquial/human terms.

- Expression as in someone expressing themselves, a tentative gesture.
- Evaluation as in scrutinizing something to learn what it's really about.
- Value as in "valuable".
We don't know if an expression is valuable until we subject it to evaluation, or we get an interpreter to interpret it for us.

dehrmann1 reply#
Have you ever studied compilers? You'll gets a good idea of these concepts from a toy compiler for an imperative language.
shrimpx#
Yeah I've built a compiler and several interpreters in an academic context. I'd appreciate any concrete suggestions for further playing/learning.
W0lf1 reply#
Discrete mathematics and all sorts of its application in real-world (software development) related problems. Also how any given solution to a problem in one problem domain can be transferred to a problem in another unrelated domain. Think Galois theory but waaaay less fancy :-)
philjohn#
When I did Mathematics A-Level's, we had to select four modules. I chose pure 1, pure 2, stats 1 and, new that year, discrete 1.

So many useful groundings in various super important comp sci concepts.

TheAceOfHearts#
It felt like my understanding of pointers was a bit vague until I learned assembly. I think programmers would benefit from starting off with a simple virtual machine that runs a tiny set of instructions with everything presented cleanly in a visual format which can be inspected and stepped through.

The biggest a-ha! moment I've experienced was in my Comptuer Architecture course when it finally clicked how you could build up a bunch of logic gates into a real modern computer.

Load more comments