20 years of programming
23 points by ds
23 points by ds
Just wanted to say I appreciate these kind of posts, they’re really helpful for learning or solidifying some knowledge I already have (“Oh I am not alone thinking this”).
Just out of curiosity, have you been programming for a similar amount of time? I do notice that once you hit the 10+ year mark, people generally crave checking out what others have learned (for comparison.) I could be wrong though.
I’m slowly reaching the 10 year mark indeed, give or take.
I still feel like I just started though.. The more I know the less I know.
Read more code. Like, seriously, read more code. More than you think you should be reading.
At jobs I read every commit from my team. Why did they do it this way? Are they using any features or idioms I don’t know? Can I imagine bugs that would slip through these tests? Are there patterns in recent commits that aren’t expressed explicitly? I didn’t often comment on the commits, just work through them a bit in my head. I’ve learned a ton about the codebase, language, tools, and culture from it. After a year or so I’d end up one of the most knowledgeable people about the codebase.
Reflecting on it now, I’ve always had this tendency to question things that we/I have to do without knowing why we/I do them. I call it my anti-tradition and anti-dogma trait. It’s one of the key traits that contributed to the amount of technical knowledge I have now. It’s also got me in trouble before, and I’m sure it will still get me in trouble in the future, but I just can’t help it when I see things being done without knowing why they have to be done.
I wonder what the author means by “trouble”? I have the same trait and it leads to distraction, yak-shaving and procrastination. It’s why Forth just clicks to me, you tell the computer to do what it actually does. What the hell is a public static void, some kind of portal? It makes you think about code, differently: I remember back at uni my buddy was writing a parser for some language with Haskell and didn’t understand why he had to parse the whitespace, and from my perspective (having basically gone from Ruby to Forth and C) that wasn’t even a question, because from the bottom-up the whitespace has to go somewhere, but if you’re used to accepting things work this way because they just do, then it might not even occur to you that the tokens aren’t real and it’s just bytes-in-order. He had the advantage though, because he could just do the high-level thing he wanted to do without digging too deeply into it (he’s a mega boffin now though, legend) and I was reading STM32 data sheets trying to figure out why you had to do x,y,z to send a signal over a wire (and I failed that year of uni for it).
I wonder what the author means by “trouble”?
My guess: authority figures getting annoyed at them.
Yep, pretty much this, especially at workplaces, both culturally and technically. For example “we need to deploy service X before service Y” and when asked why, nobody can answer that, they just repeat that this was said to them by people on the team who had already left.
The way I see it is that you have to be able to think in different layers, and be able to decide which layer is the most appropriate for the given task.
Being able to hide from view the layers beneath your current one is just as beneficial as being able to dig as deep as needed. Like if you are too preoccupied with some low-level details, you might fail to realize, design and implement a much better abstraction on the high-level, that might open up e.g. parallelization/caching, etc. and possibly many orders of magnitude improvements.
Nice write up!
“why do I have to write public static void main? What do these words mean?” […] Reflecting on it now, I’ve always had this tendency to question things that we/I have to do without knowing why we/I do them. I call it my anti-tradition and anti-dogma trait.
Relatable.
Purple/light purple links (the colour changes if you’re reading on light or dark mode) are purely informative links with no constraints or extra behaviour. Yellow/Brown links have an additional constraint that each part of the text in the link must have the same content. I also made it possible for you to click any word with an yellow/brown link to rename it.
The interactive renaming demo is very interesting. I wonder what’s the closest technical implementation of something like this (maybe Smalltalk?).
It also reminds me of markup code for generating a book with an index, in which the index is the source of truth of the terms, and changing it somewhere changes it everywhere.
Some challenges come to mind for a fully implemented system:
In the 80s, Infocom (the text adventure company) made a DB-like program called Cornerstone where the visible name was, internally, tracked by a unique ID. By separating the “name” like that, the user could rename any variable and have it updated everywhere in the program.
I wonder what’s the closest technical implementation of something like this (maybe Smalltalk?).
I haven’t seen anything that can be directly compared to that demo (it’s still on my list to play with Smalltalk), but (as spc476 says on their comment) almost every system with a DB already shows a similar behaviour: for relational DBs, rows have a primary key and you can usually update other fields while keeping the primary key unchanged, and if the rest of the system always queries the DB for the latest info on a key, that covers pretty much the same behaviour as the one in the demo.
It’s also why I’m experimenting with replacing the entire filesystem with a DB-like abstraction.
Extra work to set it up, even for things that might not get refactored, or which might be deleted entirely by refactoring the container structure.
I believe this can be strongly alleviated by proper supporting systems, which is one of the reasons why I say I don’t really want to see an implementation of that demo currently: everything else on the stack/ecosystem wasn’t built with this behaviour in mind.
If one wants to associate a code object with comments explaining it, it might have to deal with plurals, shorthand aliases, and even paragraphs that refer to the object implicitly.
The purple/light purple link already does something similar: the text in them doesn’t change, even if the other entities have their names changed. Having more types of constraints would probably be the way to go to make it easier to deal with this scenario.
I got up, went to him, and asked: “Dad, why do I have to write
public static void main
? What do these words mean?”
One of the many very nice things about the Head First series of books is that it must have been tested with readers because it addresses common questions like this. Sometimes the answer is “we’ll get to that later, don’t sweat it” like you’d get from a teacher. It’s not a reference manual that is compelled to be exhaustive from the first reference, it’s an introduction with voice to it. Conveniently, O’Reilly’s book sample includes this exact example.
This resonates a lot with me. I am almost the same age, started programming at almost the same age and also started out modding MMORPGs and writing Flash games with ActionScript. We seem to have a lot in common despite being on opposite sides of the globe - that is the beauty of the internet.
This reminds me of Ramsey Nasser’s A Personal Computer For Children Of All Cultures. The problem it’s trying to solve is a bit different (how to avoid privileging any specific language with naming of interfaces), but I think the ideas about separating name and identity presented there would be applicable here too.
I’ve also been thinking of similar things in context of programming interfaces for touch devices; having to emulate a keyboard to type in a name in order to refer to something you’d already have on screen feels clunky. What if instead you could go into an identifier dropper mode (c.f. colour dropper in image editors) and tap that?