I bought an exercise ball for this purpose, but then learned that exercise balls can rupture under you with disastrous consequences. It may happen rarely, but I would rather not risk it.
I felt that way most of my first evening with it. Thankfully I stuck with it, because once I finally got the compiler to accept my awful C-in-Ada-clothes I was hooked. The damn thing worked, first time it compiled, no matter what I threw at it. And that's basically been my experience since, and I don't even need to carry all the paranoia I learned from C and C++ to do it.
I can even look up compiler messages if I need to, unlike my debugger state, which is nice.
I'm completely convinced it's worth it. What looks like pointless verbosity and sadistic pedantry at first turns into a comfortable security blanket that keeps you aware and in control of what the heck you're even doing.
I'd encourage anybody to try it out, just go into it knowing it's kind of similar to jumping into a functional language for the first time. You're going to need to adjust your paradigm a bit to really settle in. Ada is a bit deceptive if you're used to dropping into an imperative language and getting a decent feel for it in an easy afternoon.
On the bright side, even if you don't get as hooked as me on it, you might just get a new way to look at programs out of it. Never know when that'll come in handy.
A kind word or act takes a moment of your time but can leave the other person thinking about it for days, weeks, years. You probably have memories of other people doing nice things for you.
The OP is not about 10x more productive, it is about 10x productivity boosts. Using regexes can easily be 10x faster than manual editing, and property-based tests can easily be written 10x faster than a more or less equivalent battery of tests.
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.
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.
Mostly, yes. How often do you search and/or replace and/or extract text? Now imagine doing it while being able to specify patterns instead of just fixed text.
A couple examples:
- find all occurrences of some text only when near some other text, no matter the intervening text;
- transform calls to a routine to calls to another routine, while swapping arguments.
As for other tools, once you know them, you will find ways to use them.
Yes, their syntax can be difficult to remember, but most of the time you are going to use just a few patterns and will learn them by rote memorization. They will become second nature, and indeed I myself am sometimes surprised by the complexity of patterns that I write without thinking about it. Anyway, I recommend that you have handy a plugin for your text editor that highlights matches, to help in troubleshooting buggy regexes when they get convoluted.
I bought an exercise ball for this purpose, but then learned that exercise balls can rupture under you with disastrous consequences. It may happen rarely, but I would rather not risk it.