YAGNI and KISS. When I was a junior developer I used to overthink and overdesign solutions, most of which was never needed. It took many years and a lot of battle scars to realize that less abstraction is more. Today I see a lot of juniors do the same mistake and I ask them to revise their designs to keep it simple.
I use the rule of threes to kill off any premature abstractions. ie. Don’t think you need to make this generic if you have one or two different variants of it. Most often it’s one- so it’s very easy to see that you’re just solving imaginary problems at this point. Each abstraction has a mental cost for reading and understanding the code so I try to be sparing. Too many code bases in my youth were a nightmare to navig…
Ask HN: Concepts that clicked only years after you first encountered them?
371–380 of 946 posts
Re: Ask HN: Concepts that clicked only years after you first encountered them?
#3721. Everyone is the main character in their own story. This manifest in all sorts of ways - from people not being there when you need them the most, from friends dying off as soon as proximity changes, to how and why get people get promoted in jobs. This isn't necessarily bad, but if you don't know how to navigate this it can be quite painful and confusing. 2. Representation matters. I knew this for a long time, but i…
“The ultimate, hidden truth of the world is that it is something that we make, and could just as easily make differently.”
Re: Ask HN: Concepts that clicked only years after you first encountered them?
#373At some point I realised the connections between the two worlds e.g., graph operations as linear algebra [0] or the transition from continuous Laplacian to graph Laplacian via a discrete Laplace operator [1]
Re: Ask HN: Concepts that clicked only years after you first encountered them?
#374It 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…
Re: Ask HN: Concepts that clicked only years after you first encountered them?
#375Related : I have a request for the 1 major concept that has never clicked for me --> Can someone help me understand 'productive value' in an economy ? I have tried hard, and can't for the love of me understand what lies at the bottom of trade, what is the base value of assets / activity. It just doesn't click. Questions like: - Can a services based economy work if the consumers of the services weren't producing some…
> Is a Fiat currency just 'vibes based economics' ?
I'd think of it more like contract-based/trust-based. If a government has promised you can pay your taxes and debts in a fiat currency, and you believe them, then you'll value that currency. You may need it some day. When the trust erodes, so does the value. I don't think this is simply "vibes", it's people behaving rationally about what they expect the future to hold. And in fact this is just what "value" means for all things generally. Someone thinking rationally about how to value a gold-backed currency is still asking themselves whether they expect gold to be worthwhile in the future.
> How is it NOT a zero sum game ?
A zero-sum game would be one where there's just a fixed amount of value to allocate however, and you're stuck to the pareto frontier; that is, there is no re-allocation which would leave someone better-off and nobody worse-off. But in reality there's obvious misallocation all of the time! That's why you would ever buy or sell something: because two parties both believe they benefit from that exchange. Whether that exchange is actually positive or negative for society depends on externalities. But it seems pretty clear to me that a lot of activity is a negative-sum game (if it cause pollution, addiction, etc), and a lot of activity is a positive-sum game (most other things), and almost nothing is actually zero-sum. How is it NOT NOT a zero sum game?
> Is speculation on artificially limited assets (housing) just a pyramid scheme ?
Kinda.
Re: Ask HN: Concepts that clicked only years after you first encountered them?
#376Also importance of reading books even later. My mother told me this all the time but school books were not the best choice. In high school I started reading fanfics, then occult books and finally I landed on self-helps and ones related to my SWE career.
Re: Ask HN: Concepts that clicked only years after you first encountered them?
#377The 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…
Re: Ask HN: Concepts that clicked only years after you first encountered them?
#378Superconductivity. I did four PhD projects regarding superconductivity properties at nanoscale without really getting hold on the concept. For instance, how zero resistance is related to cooper pair tunnelling and BdG Hamiltonian. Only when I was forced to write introduction a month before my thesis submission I gave my best last try for the farewell and it clicked. Note the title of my thesis “Quantum effects of sup…
I no longer know when I figured out this trick, but I have been using it for at least twenty years. I wish I had known about it earlier.
Re: Ask HN: Concepts that clicked only years after you first encountered them?
#379Earlier quoted context omitted.
> dependency injection The term is unfamiliar to me -- is it related to "fault injection"?
Dependency injection is one of those technical terms that are made up to describe something that has been done for decades but with a new name because the creators of the new term don't have much experience and/or they want to gain notoriety for creating a new programming technique. If you've ever written a constructor for a class that has arguments (within the constructor signature) that are used by the instance of…
In any case, DI is not at all a new trendy term. Inversion of Control dates back to the gang of 4 patterns book from the '90s. Yes, constructor parameters are one way to implement DI, but not the only one. I'm ambivalent on the whole pattern movement, but they are a great educational tool for novice programmers, and it is good to have some standard terminology for core patterns.
To put it another way, constructor based DI is not simply the use of constructor parameters, it is understanding the OO design principle that side-effecting code should be isolated into objects, rather than just dumping a bunch of DB queries into your functions, like we did back in the stone age.
Re: Ask HN: Concepts that clicked only years after you first encountered them?
#380Earlier quoted context omitted.
As a white guy, I'd certainly encourage you not to worry about this -- if we're talking about an upper middle class, professional-ish activity, you can be fairly sure that all those white people feel self-conscious about their group being so white and would welcome you to join them. Anyway, I'd be interested to hear more about the psychology of this. I remember when I was growing up in the 90s and 00s in California,…
The better question to ask yourself (you the white guy), is would you join a group [insert som hobby like hiking] composed 100% of Cholitas. If yes, are you sure? if not, why not? *Not singling out Cholitas, but it's a group that may feel "other" to you.
With regard to the Cholitas thought experiment, I think my major source of discomfort is that at least one of them would look at me and think to herself "he's a patriarchical colonizer" and feel hostility from that. I'd feel more comfortable if I had a friend in the group who could vouch for me. Otherwise I'd worry the Cholitas didn't want me to be there.
I suppose that works in reverse as well -- an ethnic person might look at a group of white people and worry that one of them was present at Jan 6 or what have you.
What I miss from my childhood was the feeling that we're all in this together as human beings and race just isn't important. In the time & place I grew up, if someone was to start denigrating others on the basis of race, everyone would consider them to be an unimportant wacko. In that cultural context I wouldn't feel as much apprehension joining a group of Cholitas.