|
|
|
|
|
by seanmcdirmid
3058 days ago
|
|
> The first correct algorithm I can think of, expressed in the programming equivalent of pre-K level English If I can think of it, then I hope it already exists and I can just reuse it. The tricky stuff that needs a lot of thought is the same stuff that you can't just reuse off the shelf. > It boggles my mind when people who are just building an everyday website If it is something so routine that it doesn't need to really be designed, then I guess you can do it right the first time from memory (shame you just can't reuse some functionality if it is so routine though). > The code you're writing now will likely not survive another 2 years I work in research where your code is lucky to survive 2 months. I don't disagree with you, but you can't crank out perfectly simple code on the first go if the design space is clear. Those abstractions usually don't exist because the programmer was trying to be clever, they often exist because the programmer was trying to solve the problem. Its only with hindsight that we can often see a better more simple way (and hopefully have time to go back and do the simpler way). |
|
There is also a cognitive load of 'using it' for simple algos and packages, like left-pad. Some end up the de facto standard of a community (Python's `requests` package), but other communities fracture (Node's SuperAgent, Axios, got, Request, reqwest, ...).
I like to think of code I write today as automatically being 'obsolete' 12 months from now. I might not replace it +12 mo, but if I _were_ to replace it, what comments, patterns, and hints might I leave my future-self to make that easier? Simpler code is easier to test and replace. Less magic code is easier to swap out with other languages. Verbose code is easier for my new team of +N engineers to digest, even if it takes twice as long to read.