Live data from Hacker News

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

news.ycombinator.com

121–130 of 946 posts

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

#121

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've always found OO programming completely natural. n fact, it's the only kind of programming i've ever really done - create a structure with data members, and then create functions to work on that structure. you can (and should) do this in low-level languages such as C and assembler.

Of course, if you want to go the whole polymorphic route, i'd suggest using something like c++, but the key ideas are really structures, and functions that operate on those structures.

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

#122
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…

+1 to this. It doesn't help that some dependency injection frameworks' (ahem, looking at you Dagger2) error messages can be convoluted and hard to understand.

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

#123
The Kalman filter. I felt like I understood it watching some videos but it always turned out I didn't really understand it well enough to put it to use or explain it to others.

Gaining a better understanding ultimately just took a lot of time playing with the equations and understanding how measurement and process noise/uncertainty get incorporated into the Kalman gain, and how that in turn affects the updated state estimate - e.g if you have zero noise in the measurement, you end up fully trusting your measurement. This tutorial [1] is the one I ended up studying. This is a case where memorizing the equations (with the help of Anki) helped me reflect on them and keep everything in my head long enough to improve my understanding.

http://www.cs.unc.edu/~welch/media/pdf/kalman_intro.pdf

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

#124
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…

Seven years into my career I'm increasingly convinced that the emperor has no clothes with respect to unit tests that are just transcripts of the code under test with "mock.EXPECT()" prepended to everything - 95% by volume of the unit test code I've ever read, written, or maintained.

I call those lockdown tests and they're a smell. You don't want to dictate the implementation, just the inputs and outputs. The former leads to very brittle code, the latter describes and validates the contract. It's also important where you put the logic of the test in the code base when you have multiple layers. This latter part is harder and system dependent.

In many cases mocks are now over used where previously they were important in say 2008. Especially now with languages that support functions as objects, better generics, and other features which weren't common a while back. Likewise frameworks are and languages are generally way more testable now which means you're doing less backflips like static injecting wrappers for DateTime.now into libraries to make tests work. This further allows more contract and less implementation specific testing.

As with most things there is a lot of nuance/art to doing it well and smoothly

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

#125
Working with others.

Really.

I was super annoyed and insanely annoying to work with for years.

Then I understood that difference is hard to cope with, but more often than not, good. As it trades some short term efficiency to long term one.

Same with your output. If it is dumbed down to a level everyone can understand it, you really learned it.

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

#126

I was at a Denny's around 2AM once and in an instant became totally convinced that I understood the Ontological Argument perfectly and that it was 100% correct and undeniable proof of the existence of God. But then I lost it.

which of the many Ontological Arguments?

(eg Gödel's https://en.wikipedia.org/wiki/Gödel%27s_ontological_proof#Ou... is an exercise in order theory, in which one proves that a certain axiomatically presented mathematical structure has to have a maximum, which then, for the religiously inclined, could be identified with God)

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

#127
post #109

Power of static typing, that it allows one to develop complex programs faster and better, not slower.

I think the develop faster thing is a poor argument for static typing. The refactoring piece of the equation is the most important to me. Static types provide confidence (and speed) while making sweeping changes to code.

That's what I meant by developing faster. Refactoring is an indispensable part of the building process.

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

#129
post #99

I have one example and an anti-example. Both are related to algorithms and computer science. A) Packing a binary tree into an array. Anyone that has attended an algorithms course has likely created a binary tree with nodes, leaf nodes, left and right child etc. Seen the pine-tree like sketch with a larger example where each node except the leaf nodes have a left and right child. So how do you pack this tree into an a…

A) I've seen this before but I've never thought of the "index as a bit-sequence describing when in the tree a left vs. right path was taken" before! This is a very nice intuitive explanation that'll really help in describing this to others.

B) Did you mean Floyd-Warshall's?

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

#130

It took a couple years in college for me to understand entropy. Entropy in classical thermodynamics is presented in a mysterious way that leads to confusion. Entropy in statistical thermodynamics, however, is logical. Once one understands basic statistical thermodynamics, entropy isn't mysterious. The book in my statistical thermodynamics class was An Introduction to Thermal Physics by Daniel Schroeder, which is an e…

I also have chosen entropy for my most memorable grokk! :)
Post reply on HN