Ask HN: What bits of fundamental knowledge are productivity multipliers?
413 pointsFor example,
* Regular expressions for simple text processing.
* Parser combinators for parsing.
* Parser generators (esp. packrat variety) for parsing.
* The concept of fuzzing and property testing for testing code.
* Calculus for solving all sorts of problems.
* MCMC for solving a huge class of probability problems.
* Search algorithms for solving a variety of problems (e.g. all NP-hard problems, sudoku, HTNs, scheduling, planning).
* Gradient descent for solving a variety of optimization problems.
* Vector Space embedding as a conceptual tool for a variety of complex AI problems.
* Effect composition (Haskell's IO or Scala's ZIO) as an incredibly powerful paradigm for concurrency and parallelism.
What are some examples of 10x multipliers that come to your mind? Fundamental ideas without which you would be drastically less productive.
Comments (418) 135 threads
Earlier comments(2) Integer linear programming set covering. A super nice way to get likely very close to optimal solutions to some really nasty real world problems in combinatorial optimization.
(3) My favorite text editor, Kedit. It is a PC version of the IBM text editor XEDIT, written by an IBM guy in France, apparently on his own time. It used Rexx as a macro language, and Kedit uses Kexx, its version of Rexx, as its macro language. XEDIT and Kedit are elegantly designed; the macro languages are also elegant. Kedit is my most important tool.
(3) Hierarchical file systems, e.g., Microsoft's NTFS (new technology file system). I just find the hierarchy in the file system as a natural a taxonomic hierarchy for organizing information.
(4) Yes, once I used Monte Carlo simulation of a continuous time, discrete state space Markov process to estimate the surviveability of the US SSBN fleet under a special scenario of global nuclear war limited to sea. So, it was potentially an enormously complicated calculation but due to the simplification of the Markov assumption, how the continuous time was handled with a Poisson process, and the Monte Carlo to do the numerical part, I got the whole project done in just two weeks.
- Vim bindings and macros
- AWK
…and, if you'd like to generalize that, I'd say "throwaway programming" is generally a good skill to have. Many programmers don't get that not every problem should be solved in an elegant, robust and maintainable way. The important part is that you recognize when that isn't the case and that you are able to improvise in these situations.
There are, of course, also situations when you absolutely don't want to go the quick & dirty route, and recognizing those is just as important.
Do you use it for text transformation? How do you use it exactly? Do you use it as code itself or as a tool to help you explore/write code?
I am a huge fan of Macros, I 100% understand their role in text transformation, but what problem does regex solve? I spend so much time trying to remember the correct syntax, it only ever works for me when solving a specific code problem, but Ive never used it in one-off workflow problems.
Curious if I have missed some huge place where it is helpful.
On the other hand, regexes saved my skin a couple of times when I needed to search/extract/modify/format a large number of text files (or one extremely big one). I suck at command line, so I usually open the file/folder in vscode and use their search/replace function. It's super useful for these "one shot" text operations.
Wow! Thank you.
Dreadful, but fast enough to let everyone know, there are 58 Java 7 taking prod load within an hour of the meeting where it was assumed there are zero Java 7 apps.
I once walked in on a coworker (who’s not a developer) who had copied a pdf into text and was laboriously scrolling through thousands of lines of text to remove footer text with page numbers. He spent hours doing this, it’s a 10 second problem with using regex.
In the same job, sometimes our clients would give me large files in the wrong format (like a word document) that couldn’t be normally be import. Notepad++ and some regex magic pulled out all the data I cared about in a minute. It would have taken years if my other coworker did it his way.
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.
A widespread example of this is linear regression analysis. Mathematically, it only works because we make assumptions about the data (and even these can be relaxed) & limiting the scope of the problems it can solve.
This also applies to delivering projects. A fully engineered & robust project could possibly require a great deal of human, physical resources and time. But if we start iterating over a list of problems your system solves (sorted by decreasing value), the project suddenly costs only a fraction of what it would otherwise.
This doesn't come for free though: your MUST understand the limitations & assumptions of your systems, otherwise you or someone will pay dearly. Look at Zillow & failure to understand its forecasting system. Look at so many other startups applying ML where it has no place.
Zillow's failure is the best case (though catastrophic): the principal paid the cost. But take something like Google, applying a fully automated system to make decisions about banning accounts. These are real world decisions that have a huge effect on people & businesses. In this case, Google saves money on providing human support & offsets the costs to third parties who often can't afford it.
https://en.wikipedia.org/wiki/Linear_regression#Assumptions
All comments shown.
Couldn't load more comments. Check your connection and try again.