2 ms·
Most of the time, you should not be inventing your own equivalents of off-the-shelf algorithms. (Let alone something like crypto.) How much you evaluate the b
by kazinator 3y ago
Most of the time, you should not be inventing your own equivalents of off-the-shelf algorithms. (Let alone something like crypto.)
How much you evaluate the borrowed alternatives (or whether you even evaluate alternatives) entirely depends on how much that choice matters in the situation.
Situations in which the choice doesn't matter are very common, and in situations in which it doesn't matter.
The scientist isn't concerned with "does it matter" but with "does it make an observable difference". But the latter concern is often a luxury or idle preoccupation for the engineer.
Writing code is mostly a kind of engineering; more rarely is it science.
Engineers usually select existing materials and patterns of putting them together to put together a solution.
Engineering isn't entirely creative in every detail, like painting or music. Even painters and musicians reuse from others.
"Why did you resolve this G7 chord to a C?"
- barbariangrunge 3y agoCounter point: writing things from scratch once in a while sharpens your skills and helps you make better decisions in the future about tradeoffs, and let’s you evaluate different implementations without having to resort to a search on hackernews, stack overflow, or GitHub to find out what the trendiest option is Take exercise for example: it’s all unnecessary work, but it makes you stronger so that you maintain your fitness longer and so when you need to be strong for something, you’re ready
- geophph 3y agoAgreed. I also like calculus as an example. First you gotta write out derivatives by hand, then you learn you can “drop the exponent then subtract one from it.” Doing it the long way without the shortcuts helps you understand it better inside and out I’d think for when you do use existing code. I find sometimes it’s fun to write out a program to do something without any (or at least very minimum) imports just to see how I’d solve it (for a reasonably real use case). Helps to better understand the concepts / tricks the “real” implementation might use. Some fun examples: building an animated UI spinner “by hand” or setting up a sub-pub implementation for passing data around my app.
- kazinator 3y agoIf you're not making something from scratch in every development assignment, probably, get another job. The article isn't simply disparaging using existing code, but using an existing approach. Using an existing approach might mean, say, reading a paper about it and writing your own implementation from scratch, using only the paper's description and pseudo-code as an example. That goes a long way to keeping you on your toes as a programmer, and can exercise some computer science muscle as well.