Live data from Hacker News

Ask HN: Concepts that clicked only years after you first encountered them?

news.ycombinator.com

161–170 of 946 posts

Re: Ask HN: Concepts that clicked only years after you first encountered them?

#161

It took me an embarrassing amount of time to fully grok what object oriented programming really means. It's one thing to have someone tell you what an object is, but it's another thing entirely to build a fully object oriented system. I remember what made it click: I was designing an animation system, which had a bunch of different interdependent moving parts. Once I started treating each part like an object and lett…

This one is the same for me. I'm not even sure I still totally get it.

It feels like something used an awful lot in ways that don't really add any value. But again, it must just be my lack of understanding. Maybe one of these days it'll click in.

Re: Ask HN: Concepts that clicked only years after you first encountered them?

#162
post #2

Unit testing and using dependency injection to write test-able code. I'm not sure if it was years, but it wasn't immediate. I just didn't understand why dependency injection was good at first, and not just someone's weird personal code style choice. I thought it was just people being "Enterprisey" which I'd encountered many times over the years. Once I committed to unit testing, I realized how necessary it is. Unfort…

> dependency injection The term is unfamiliar to me -- is it related to "fault injection"?

People would have way fewer opinions on it if it was just called "passing stuff in"

Re: Ask HN: Concepts that clicked only years after you first encountered them?

#163

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.

Can you share what helped it click? I’m in the same boat, trying to understand it through analogies.

Re: Ask HN: Concepts that clicked only years after you first encountered them?

#164

The power of an outline when writing. Over the past few years, I've been teaching myself how to write better. I'm not talking about elementary syntax or grammar. I'm not talking about writing the traditional, American English five paragraph essay. I'm talking about writing longer pieces of prose, articles or blog posts or short chapters with word counts ranging anywhere between 1500-3000 words. On this journey of imp…

I love a good outline and can't really imagine writing anything above 1000 words without one. Getting the outline into shape really feels like breaking the back of any piece - after that it's just filling in the gaps.

Something I realised much too late was how delaying the move to the keyboard was a useful strategy. Now I mostly start with pen and paper, sometimes with a mind map if I really need to organise my thoughts, and only hit the PC once I have a pretty firm idea of what I'm going to say. I've even done first drafts in longhand, which feels like double handling at first, but there's something about that added filter of transposing from paper to computer that helps you reassess objectively what it is that you're writing.

Re: Ask HN: Concepts that clicked only years after you first encountered them?

#165
post #145

Earlier quoted context omitted.

Getting rid of data abstraction and encapsulation is throwing the baby with the bath water. The abstract concept of OOP (messages between complex objects, as defined by Alan Kay) is an attempt at mimicking biological systems. Most modern languages implement data abstraction, but call it OOP, where they encapsulate some functionality with the data it operates on. Really helped with varying data formats in the AirForce…

OOP does not have a monopoly on abstraction and encapsulation. What OOP does, namely object-level encapsulation, is just a very extreme way of structuring code around mutable state. IMO the better alternative is to avoid mutable state as much as possible and keep data and code separate. Code structured as pure functions is easy to test and encapsulation can be done at the module level.

My point is that improving the state of unit testing has little to do with OOP, and everything to do with the environment that the code runs in.

Re: Ask HN: Concepts that clicked only years after you first encountered them?

#169

It took me an embarrassing amount of time to fully grok what object oriented programming really means. It's one thing to have someone tell you what an object is, but it's another thing entirely to build a fully object oriented system. I remember what made it click: I was designing an animation system, which had a bunch of different interdependent moving parts. Once I started treating each part like an object and lett…

I read the earliest articles on OO and SmallTalk in Byte Magazine, which IIRC would have been the early 80s. OOP was totally and utterly bewildering to me, a BASIC and Pascal programmer.

It "clicked" much later, in two stages, using languages that were "kind of like" OOP, even if not rigorously so: LabVIEW, HyperCard, Visual Basic. I think VB had a decent strategy for introducing OO to the rest of us. Out of the box, it was "object based," meaning that you could use classes that had been created by someone else. For a bit more money you could buy the version that let you do full OO, but I never did that. But by being a user of objects, it gave you an idea of what you'd want if you could create them for yourself.

Nowadays of course people range from being bullish to bearish on OO, and I've had the experience of doing it badly and making a mess of things, when a procedural or functional model would probably be better.

Kind of a lesser issue is that I finally grasped how to work with a modern OS after laying my hands on the first couple volumes of the Win32 programmer's manuals, which I think were vastly less forbidding than Inside Macintosh.

Re: Ask HN: Concepts that clicked only years after you first encountered them?

#170

It took me an embarrassing amount of time to fully grok what object oriented programming really means. It's one thing to have someone tell you what an object is, but it's another thing entirely to build a fully object oriented system. I remember what made it click: I was designing an animation system, which had a bunch of different interdependent moving parts. Once I started treating each part like an object and lett…

When I was younger I had a lot of trouble with OOP. It probably didn’t help that my two strongest languages at the time (PHP and Python) allow you to use them fully iteratively if you want. For some reason I never found an explanation that focused on state. A lot of the examples I saw I remember thinking it made a lot more sense to just rewrite the functions so they aren’t part of a class.

I still frequently see code examples online that are written using classes that don’t need to be. I imagine this is the reverse problem: people from languages like Java thinking everything has to be in a class.

Post reply on HN