Hacker News new | ask | show | jobs
by loves_mangoes 1537 days ago
I agree with you :)

I actually like those little patterns a lot, there are problems where you might absolutely take 10x longer because you didn't know the algorithm or the right machine learning concept.

The OP talks about becoming "significantly more productive when solving a large class of problems", and where my interpretation differs is what you mean by large class of problem.

What's large for you is really going to be relative and will vary based on your personal experience, so I can't say you're wrong. I know I speak at least for myself I when I say that in my day to day, most of what I do is not leetcode-type problems, so despite knowing many algorithms I don't think I would be 10x slower if I didn't know them.

If your interpretation of OP is that these boosts will on average give you 10x more productivity, that's the only place where I really disagree.

1 comments

On the point of regexes, I think you might be misunderstanding OP. Regexes have absolutely given me a 10x productivity boost over the years, but not because I write production code that relies on regexes to parse things, extract things, etc.

The 10x productivity boost I get with regexes is being able to effectively automate out a lot of text manipulation on a large scale. A couple examples. Say I get a file with a bunch of junk in it that contains some IDs that I need to use as input to other commands. I write a simple regex in a text editor, find all, delete everything else, then use other regexes (or multiline editing) to wrap those IDs with the commands I actually want to run. A more impactful example. Several years ago I was writing a new loadtest suite, when I realized that it would look A LOT like some existing load tests we had. They weren't close enough for composition or inheritance to solve the issue completely (we were already both in a few places in the codebase to help out), so I used a similar process that I laid out above to write the new loadtest suite. I barely wrote any of the code manually, I was doing most of the work from a level of abstraction above, making broad code changes with regexes. I did it all in an afternoon.

To get the 10x multiplier from regexes you've got to basically bake them into everything you do.

That's entirely fair. I do the same, a lot. I like writing macros, using regexes, or even short awk scripts to automate any manual text workflows.

I'm not trying to deny your experience, so I can accept your word for it that it would take you 10x longer to complete tasks if you weren't able to do this.

At this point the core of the argument becomes more what sort of mix of tasks your daily work consists of, I think. I agree that there are patterns that solve some problems very efficiently, but in my daily life if I try to look at people who complete projects 10x faster than average, I can't point at any single method or bit of secret knowledge.

So I think the twofold response is first that the average developer is actually able to use search-and-replace and already has some vague notion that regexes are a tool they could reach for, so this is really saying that "0.1x" productivity exists in a way. And I think that's uncontroversial: if you imagine an hypothetical programmer who is still using the `ed` text-editor and hand-writing machine code to address business problems, in a world where people throw together microservices running in K8s in 100 lines of code, they're going to be a lot slower than average.

But I think the question is really about whether starting from an average (or if you want, median) dev there's any single thing that will give you a 10x productivity boost, that's not already something normal the average person knows about.

The second answer I have, and that I keep coming back to, is that if we had such a thing it would be more popular than coffee and morning meetings. It would automatically and very quickly have become something that companies rapidly adopt and that becomes the new normal (like search and replace!).

So finally the point is not that there aren't thing like regexes that slow you down a lot if you don't know them, it's more that there aren't any such things that are also well-kept secret. If the effect size is a whole order of magnitude, you won't have to scour forum threads for secret methods that turn you into a Mythical 10x Programmer, it will just quietly already be on its way to being the new 1x, and it will most likely be a gradual improvement over time.