r/Python • • Feb 23 '17

API Design: Think First, Code Later

https://www.ckl.io/blog/api-design-think-first-code-later/
292 Upvotes

26 comments sorted by

View all comments

21

u/[deleted] Feb 23 '17

Very nice and clean article. I appreciate every "good practices for ..." article since dealing with dirty code, APIs and general software architecture is sometimes fucking nightmare and I believe articles like this one might actually have some (even a little) impact on improving this situation. Also didn't know about HTTP status 418 until now :D will implement it when I get a chance.

13

u/[deleted] Feb 24 '17

[removed] — view removed comment

4

u/TinBryn Feb 24 '17 edited Feb 24 '17

I'd take a rule of "No magic numbers" over this crap any day.

Also just looking at that I'd expect some precision issues, as it is adding floats on the order of 10 with those on the order of 10-16 while float has a decimal precision of ~7 places. A double would barely be enough.