3 ms·
I'm reminded of Scott Meyers most important design guideline, which I may be paraphrasing slightly, but it goes: "An API should be easy to use correctly and ha
by asddubs 7y ago
I'm reminded of Scott Meyers most important design guideline, which I may be paraphrasing slightly, but it goes:
"An API should be easy to use correctly and hard to use incorrectly"
The dumbest link in the chain is always the guy writing the code, not the programming language, and not the machine executing it. So things should be designed in a way that makes it as hard as possible for programmers to make errors.
e: video is here for those who are interested
https://www.youtube.com/watch?v=5tg1ONG18H8 https://www.youtube.com/watch?v=5tg1ONG18H8
- JoshTriplett 7y agoThat idea is older. Rusty Russell advocated in 2008 that APIs should be "easy to use and hard to misuse". https://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html https://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html https://ozlabs.org/~rusty/index.cgi/tech/2008-04-01.html https://ozlabs.org/~rusty/index.cgi/tech/2008-04-01.html
- tialaramex 7y agoRight, this is more broadly applicable than even just APIs or software. Think about how often you blindly inserted a USB A or B (mini-B, micro-B) plug the wrong way first and had to try again. Why is the wrong way even possible? USB C's plug fixes this. A huge improvement to railway safety was the invention of Mechanical Interlocking. It was made essentially impossible to set signals in some inherently unsafe ways. When you tried to give a Clear signal to the Express, through a junction a late running Coal Train is already crossing, the huge metal lever you're trying to move to do that won't budge because all your controls are connected via elaborate mechanical interlocking to prevent this mistake. The signal remains at Danger, the Express stops, tragedy is averted.
- blattimwind 7y ago> Think about how often you blindly inserted a USB A or B (mini-B, micro-B) plug the wrong way first and had to try again. Why is the wrong way even possible? USB C's plug fixes this. To be honest this isn't really an issue once you notice that the logo side of the USB connector indicates up. I suspect this is mostly an issue because USB connectors have only a tiny self-alignment range (<1 mm), which leads to the "USB exists in a 4D state" meme.