|
(Disclosure, reposting from my r/learnprogramming comment in 2015)
Here's what I wish I understood when I started programming, in 10 sentences: "A computer receives, stores, and manipulates information.
Programmers refer to information as 'data'.
Data can be structured to represent concrete things - a song, a picture, a street address, an entire telephone book.
Data can also represent abstract things, such as the relationships between you and all of your friends.
Computers can only store data that can be represented as a collection of numbers.
This is where all those Zeroes and Ones come from - they are how the computer stores numbers.
Programmers write code, which is itself a kind of data, to tell a computer how to manipulate data.
Programmers break data manipulations into small, understandable steps, and then compose the steps together.
Programmers create abstractions by finding patterns in code and giving those patterns or ideas a name (and often a theoretical background).
Programmers gain productivity by layering abstractions, at the cost of not understanding or controlling the entire system." This really helps me think about coding as the process of writing data transformers. If I can represent something as data, then I can manipulate, transmit, and store a representation of that thing. I can allow users to control how the data is manipulated through a user interface. It also helps me gain clarity around my next steps. What data do I need to accomplish the task? Where does that data live, and where does it need to be? How can I get the data that I need from the data that I have, or from the people who interact with my code. Perhaps most importantly, it helps me grapple with leaking abstractions - and it helps me understand that there is always some cost paid for the abstraction, whether it's a lack of control over a program's runtime environment (with garbage collection, for example) or merely a more complex compiler or interpreter. It's never necessary to understand everything that a computer is doing, but when something unexpected happens, it is important to be able to peel back the abstraction onion and figure out where ones mental model of a computational task diverges from reality. Also, do check out r/learnprogramming for better resources than you will find on HN. (Edited to better match HN style guidelines) |