Software Dev

Swift API Design Guidelines

Here are some really sensible and helpful guidelines for writing an API in Swift. This is from the Swift team itself, so they’re pretty much the experts on what works.

👉 Swift API Design Guidelines

The focus is on clarity. Guidelines include “Clarity is more important than brevity”, “Include all the words needed to avoid ambiguity”, “Omit needless words”, “Stick to the established meaning”. Most of these could practically apply to real life. 🤷🏻‍♂️

But this one just sounds cool: “Take extra care with unconstrained polymorphism.” 🤯 (Always a solid idea.)

Image result for swift

Note: much of this should be seen in practice in the Swift Standard Library.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.