3 ms·
Yeah, it ended up being one of those things you look at a second time and wonder why it seemed so hard the first time. It was a good lesson for me, though. Now
by twodave 3y ago
Yeah, it ended up being one of those things you look at a second time and wonder why it seemed so hard the first time. It was a good lesson for me, though. Now when I hit something particularly dense I have a lot more patience with it.
- wharvle 3y agoI must have bounced off a half-dozen books for OOP and OO languages that were all like “Cat inherits from Animal…” before finally realizing (while reading OO code, not looking at a book) it’s just goddamn structs with some sugar and automagic for inheritance and auto-passing “self” and such (conceptually, at least) and a method is just a function with a different name for no good reason, et c et c. If my intro had just been that one Pascal book appendix that describes OO by how it actually works (lookup vtables and such) it would have been so much easier. Instead this easy thing was “hard” for me because every book couldn’t stop introing it with stupid, abstract toy examples.
- taneq 3y agoYeah, that was the ‘aha’ moment for me, realising that “objects” were just a struct and a bunch of functions that work with that struct.
- SoftTalker 3y agoI still mostly just do the struct and functions approach. OO is so much harder conceptually for my brain.
- justinclift 3y agoIf you're ever interested in Go (the language), that's pretty much how it does stuff. Define a structure, and then add some functions for that structure. Works pretty well.