Lurker News

Comments (815) 300 threads

Earlier comments
abetusk14 replies#
"Premature optimization is the root of all evil"

More and more, I'm realizing this applies more broadly than just for code. Abstraction is a form of optimization and shouldn't be done before the space has been properly explored to know what abstractions should be built. Standardization is a form of optimization and shouldn't be proposed until there's a body of evidence to support what's being standardized.
Failure to validate a product before building it? Premature optimization.
Build infrastructure without understanding the use case? Premature optimization.
Build tools before using them for your end product/project? Premature optimization.
This advice comes in different forms: "Progress over perfection", "Iteration quickly", "Move fast and break things", "Don't let perfection be the enemy of good enough", etc. but I find the umbrella statement of not prematurely optimizing to encompass them all.

movedx3 replies#
> Build infrastructure without understanding the use case? Premature optimization.

Hence my issues with micro services and Kubernetes/containerisation (by default.)
I've always hated the fact people simply jump onto these technologies and methodologies as if they're automatically the right solution because everyone is talking about them. What they don't understand is that they're optimisations.
You build a monolith and put it on one machine to begin with. No load balancer. Just a single EC2 instance with snapshots. As the customer count grows and demand increasing you scale it out...
Now you're on two EC2 instances and might want to consider using RDS. You have an ALB and you're using ACM to offload TLS certificate management. More customers come along and the monolith begins to slow down, so you optimise the application this time...
Now you have the most successful/popular parts of your application split out into separate components but still using the same database. You're still just running Docker on a few EC2 instances though. You don't need orchestration yet. But now your customers start demanding more features and changes on a more frequent basis. Also your customer count is rising more and more. You're now ready to scale out and re-architect things again...
Now you've got 80-85% of your monolith split out into separate components, in Docker images, and you're using Kubernetes to orchestrate the whole thing because you need to iterate and deploy parts of the software on a near daily basis.
Taking it slow and keeping things simple in the beginning allows you to focus (from a systems perspective) on stability and security, which are much easier when you have a monolith and two EC2 instances. As you need to iterate faster and more often you increase the complexity of the network to meet the needs of the development team. It becomes much harder to secure and manage, but the trade off is worth it.
That's how you optimise your infrastructure over time.
The only situation in which I would contradict my self on this point is if you're developing a product that you know will need micro services and K8s to begin with AND everyone on the team has extensive experience implementing an application in that manner.

remmargorp64#
With many apps, you can completely bypass kubernetes entirely and just use something like elastic beanstalk or heroku for scaling (just by adding nodes).
remmargorp641 reply#
With many apps, you can completely bypass kubernetes entirely and just use something like elastic beanstalk or heroku for scaling (just by adding more nodes behind a load balancer).
mleonhard2 replies#
I invested several days setting up my product's backend on Elastic Beanstalk. After several weeks, I learned that Elastic Beanstalk is not reliable.

Then I spent several days learning Kubernetes and gave up when I learned that it is overly complex and mostly undocumented.
Then I wasted a week using Packer to build EC2 AMIs and deploy with terraform and run with supervisord. I learned that Packer is slow and Linux package repositories are unreliable. Both of these things could prevent me from deploying an emergency patch. Also, there are no reliable tools to clean up old AMIs generated by Packer.
Then I spent several weeks learning Docker and migrating my product's backend to that. Docker's APIs and tooling are hard to use but at least they're reliable. And I can run the same binaries in production and on my dev machine.
Throughout this process, I frequently looked at Heroku and then remembered how much they charge. I just can't bring myself to spend $500/mo for their ops automation. Perhaps I'm being penny-wise and pound-foolish.

Continue this thread — 2 replies

gonzo411 reply#
Why people start at the K8 end state is twofold, fashion and a lot of younger people don't look at highways and see they started out as either single lane tarmac or dirt roads that were remade in place. There's a lot more talk these days about refactoring complex systems. But its really a job for senior engineers or young folk who have time for it (Like the new grads who complain about being dumped on legacy systems :) ). When you're jumping from framework to framework and shipping features, sitting back and considering things is really tricky, and the inertia to build from scratch but also have 20 years of refactored improvements delivered makes jumping on K8's and the magic that brings seem like a no brainer.
gen220#
I really, really like your metaphor of the dirt roads remade in place. It’s fascinating to look down at the sidewalk in NYC and know that it was farmland only a few centuries ago. We know the aphorisms: Rome wasn’t built in a day, but we don’t always think them through.

At work, when a new person joins our team, it’s fascinating (in a non-cynical way) to hear “why are we using a dirt road here instead of a highway? Wouldn’t that be more efficient?” It’s fun to imagine the implications of such a project, and it’s a great opportunity to give perspective on the traffic flow of customers, developers, operations.
Could we build a highway there? Yes. But usually, it’s a better allocation of our finite resources to do some maintenance on the existing highway. Sometimes, we actually need to take highways apart and replace them with something more informal, since their maintenance costs more than they’re worth.
Something tangential this reminds me of is the concept of “Desire Lines”: https://en.m.wikipedia.org/wiki/Desire_path. The work of an SWE can be summed up as the identification and “improvement” of desire lines. If you build a highway, but it’s not on a desire line, you’ve just wasted a lot of energy!

dnautics#
Yeah, I just wish the quote were "folly" instead of "evil".
gridlockd1 reply#
All fine and well, just consider that Donald Knuth was talking about shaving off some cycles by carefully selecting machine instruction.

Donald Knuth, the same guy that got upset about being forced to use 64-bit pointers in a binary compiled for x86-64 even in programs where he would've been just fine with a 4GB address space.
He didn't exactly mean to say "omg wtf computers are so fast just use create-react-app", but that seems to be the general reception.

m463#
You're prematurely optimizing donald knuth out of the algorithm.
starpilot1 reply#
I'm at a big slow non-tech corp and as much as I would prefer "move fast and break things," I can't see it working here. "Move fast" becomes "hurry up and wait" as you end up being dependent on another group's input (10-20 people total get involved, 3-10 meetings) to move forward on something. You end up trying to over-plan because it lets you schedule things to happen in parallel. Everything has to be a huge depth first search because being on the wrong track can cost months and even be fatal. By the time you figure out it won't work, you're way behind schedule and restarting would take another 10+ meetings to coordinate. You have to exhaustively evaluate every path beforehand because it's so slow to right the ship, at an institutional level.
travisjungroth#
Well, yeah. You guys should stop doing that.

“Move fast and break things.” wasn’t advice given to every individual at every company. It won’t work if you’re the only person doing it. It’s the mantra from the top down for the whole company.

gdulli#
"The difference between over-engineering and under-engineering is that you can fix under-engineering."
jakequade1 reply#
> Failure to validate a product before building it? Premature optimization.

I largely agree with your comment, minus this. Unless everything after the initial idea for a product is an "optimisation" - which is quite a claim - building something shouldn't be lumped together with optimising it.
My point is that it seems like you're attributing more to this idea than is fair.

Nevermark#
Its a stretch of the original meaning, but a good one I think.

Building a product before a good indication it is the right thing to build is prematurely optimizing a business.
At any level of a project, it is important to do things in the right order, to avoid wasting unrecoverable time and effort on work that never needed to be done.

closeparen#
Consider:

- Programs we wanted to write so badly that we invented computers along the way.
- Programs we realized we could write & benefit from once familiar with computers and their capabilities.
Infrastructure shouldn't be totally clueless about anticipated use cases, but it shouldn't be too subservient to them either.

ryanthedev#
Proof of value vs Proof of concept.
dgb23#
Also YAGNI
globular-toast#
I would also add to that: adopting tools before you need them. Premature optimisation.

Too often I see people adopting tools just because it's the latest fashion or because they've seen their friends use them. But do you actually need them? The need should come first. For two reasons. First, you might simply not need that tool, so why not keep your life more simple and make it easier for developers to work on your project? Second, if all you have is a hammer, everything looks like a nail. Grow your project first, decide what tooling you need later. Otherwise you'll be constrained by the limitations of your tools. Some projects will need completely custom tooling, many won't, but you won't know until you get your teeth into the damn project.

friendlybus#
This is good when you have infinite time. The converse is putting an end date on all of your tasks.

Building a body of evidence to support a standard, but never building the standard because there's always more to do and everything has decayed into a mess of different forks by the time the deadline appears.
Spending time to investigate the use case and requirements change. You're further down the road with no infrastructure to show for it, a changing deadline will take you out.
Building tools as you need them works fine if you have an infinite project.
Planning work with a limited time-frame means you are required to 'prematurely optimize' everything. With perfect understanding you don't hit those problems. You're trading a lack of understanding that comes from revelation and analysis with spending time on process to compensate. Neither understanding or spending time are perfect, it's unsolvable, they are separate categories.

sooheon#
I agree, but I think it's overrated as wisdom as it's circular reasoning. Of course doing anything too early is bad, because it is by definition.
PaulRobinson#
You're right, but it's worth reading the rest of the paragraph:

"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%." -- Knuth
Knuth was trying to say you shouldn't guess. If you think you will get a performance gain, but you're not sure where or how the performance is going to suffer, hold back. But if you know you're doing something that is normally bad and you can fix it, it's OK to get on with it.
Your final paragraph makes me think we're both on the same wavelength here, but I think it's worth remembering that Knuth was not saying "never optimize until you have to"

beagle3#
I was thinking “premature action ...” covers it, but it doesn’t properly match the stuff in your last paragraph.

The way I usually put it is “level and division of effort should match and be informed by the level of knowledge”, but that also doesn’t cover “move fast...” properly, because some people take that to mean “I don’t know enough, so I should move slowLy” whereas often it should be “I don’t know enough so I should experiment quickly”

Waterluvian8 replies#
A decade of success against steep odds later, I ran into the high school teacher who I idolized and who helped me actually achieve something. Most teachers tolerated me or insulated the rest of the classroom from me. But he put in the effort to get me engaged with something that got me to sit down and try. I was excited to show him what his work had helped me accomplish. He had two things to share with me:

1. He doesnt remember me.
2. That he felt I was smarter than him, hearing what I was working on.
It hit really hard. And when I recovered it made me realise that all relationships are ephemeral if you aren't there to foster and cherish them. There's also a lesson in there I'm trying to parse. About how I always saw him as this brilliant teacher. But he's just a guy.

toufka2 replies#
But it's also much more than that - he's not just a guy, he's one of just a few guys that put in the effort to do their job well and honestly. And that positive daily effort had profound effects on the lives of people he cared about. (And conversely, those that did not put in that effort did not create profound and positive wakes).

And that idea can be paid forward. There are plenty of times one doesn't get to go back and thank their mentors and those that inspired them. But that practiced and daily support of others really can lead to outsized positive effects - that we might not ever hear about.
And if you step forward with the idea - the more people that work to support others in their daily routine, even without obvious immediate benefit, the more those wakes can become entire waves that lift everyone upwards.

Waterluvian#
It's so true. I started mentoring a robotics team and I doubt I'll remember most of the kids. But wow it's so soul filling to watch them learn.
iamgopal#
Paying forward is such a powerful concept. I know where I am being fairly successful is due to tons of people to whom I may not pay back, but doing the similar helpful gesture to other people is so empowering. Hopefully the link never breaks.
jbay808#
Sounds like he actually is a brilliant teacher. Keep in mind he has probably taught several hundred other students since teaching you, which is well above Dunbar's number. He might have had a similar impact on many of them, and he probably invested a lot of time, thought, and energy into his teaching for that to happen. Maybe he just doesn't have a good memory for former students.
lainga#
You might feel like some guy, but be someone's brilliant teacher.
divbzero#
To me this is completely okay and a heartwarming success story.

Sure there is the alternate history where you stayed in touch and he still remembers you and cherishes the relationship…
But it’s also wonderful that he impacted you so strongly and positively, yet has taught so many students that he doesn’t remember you specifically. If he did this for you he likely did it for other students too and we are lucky that we have him as a teacher in our world.
It also reminds us that though we know ourselves to be human with very human limits, we can still pay forward the kindness and guidance we received to the next generation.

ModernMech#
I think the real lesson here is you never know exactly how profoundly you're going to impact someone, especially young people. What was just another day for your teacher, helping one student in an endless stream of students, was a life-changing formative experience for you.
sibeliuss#
He's much more than just a guy -- in many ways he was the vehicle for your own success. Just because he didn't recognize you later, or his intelligence is less than yours, doesn't take away from the other unrecognized qualities that helped lead your life to this moment as if by destiny. He's very special; I hope you recognize and appreciate the strange gift in this.
phtrivier#
Well, it's sad that he could not remember you ; but maybe his mind was already full caring about his current students - whose life he's going to change too - that would be cool, he ?

Great that you could "pinpoint" someone that had a such a profound effect on you. Do you think there's anything in his behavior that can be "stolen", to try and have the same effect on other people down the line ?

Agentlien1 reply#
I've had a similar experience with a professor. We used to chat about more advanced topics after class and he seemed really happy that I took an interest in his subject.

Some years ago I was giving a recruitment talk at the university and I bumped into that teacher. I greeted him like an old friend. He said "Oh, you were in my class?" as he hurried off. It hurt and I felt so silly for it.
On the other hand, I've had elementary school teachers approach me with a smile while I was in my late twenties.

wadefletch#
I would imagine the job of an elementary school teacher is primarily to have a relationship with their kids and teach what general skills they can, whereas a university or even high school teacher is pulled in more directions (curriculum, standards, research, admin, etc.).
lootsauce4 replies#
My opinions are not mine and they are holding me back.

Give multiple and opposing views equal respect and disdain at the same time. Treating a thought as your own, as an opinion "you hold" greatly holds you back from a great deal of valuable perspective. Of course you surely hold some world-view and gauge things from that position but try to cultivate more of these positions as if you were someone else.
Don't get your sense of self so wrapped up in all the thoughts and ideas that flit about in your brain. You will surely be a different person in 1, 5, 10, 20 years and may well have a completely different perspective then.
There is very little original thought, mostly there is just repetition and re-contextualization of the same old stuff. That is not a bad thing but you should really divest yourself from being emotionally wrapped up in opinions (yours or others) and treat them as the conclusions of research papers with small sample sizes.
Now when you converse with someone, stop thinking about "your" response, and just listen, really listen to what they are saying and try to really understand where they are coming from so you can integrate that into your thinking.

pedalpete2 replies#
I think you may mean "My opinions are not me", or "I am not my opinions" gives you the space to separate your identity from your thoughts, giving you the freedom to change.
MichailP#
I heard similar phrasing used by one psychotherapist that I admire, "I am different from my wishes" and "I am different from my (past) behavior". He once said jokingly that if someone realizes that, he can give them a "60 year warranty on their mental health".

What I also find interesting is that this idea is rather old, it can be found in Christianity, for example, where "devil is tempting you", that is thoughts and wishes you have might not be your own (but from some demon tempting you). It may sound a bit silly in modern times, but it boils down to the same idea.

kortilla#
No, that’s something very different. The point GP is trying to make is that most opinions people hold on things are not actually their own formed conclusions, they are just regurgitations from authorities they trust.

This happens excessively in politics. Suddenly a huge chunk of a political faction will have the same “opinion” on a complex topic they have no day-to-day interaction with or previous educational coverage. When you try to dig deeper on these topics people hold such fervent “opinions” on, it turns out that it’s just a restatement of what they heard from a friend/talking head.

Continue this thread — 3 more replies

ignoramous6 replies#
I am going to cheat a bit and give you three things that have had a lasting impact on me:

First is this quote from Lincoln, "I hate that man. I must get to know him better".
This has helped me shed biases and prejudices that stop me from liking someone on the first few interactions. Instead of shunning them, I seek to know them better, in the hope that I see past the veil and reach out to the actual human on the other side. This ties in nicely with Stephen Covey's quote, "We judge ourselves by our intentions and others by their behaviour."
Second thing that has stuck with me is this zen-koan about a disciple having a tough time forgiving their master for a sin [0]. The koan ends with the thought that the disciple who's holding on to resentment, disapproval, outrage, disappointment, grudge is really the one who's in distress and enduring the punishment and not the master. It is really powerful, at least to me. If I liberally tie it to the 'broken windows theory' [1], it explains to me why such resentments over time aren't simply good for me, personally, despite how few the broken windows may be, they need to be fixed.
And the third is producer v consumer mindset [2]. Do not consume excessively, refrain from stifling the production line with tendency to consume all day, every day.
[0] https://medium.com/@soninilucas/two-monks-and-a-woman-zen-st...
[1] https://en.wikipedia.org/wiki/Broken_windows_theory
[2] https://news.ycombinator.com/item?id=3555237

Continue this thread — 6 replies

Load more comments