Jul 22, 2017 · 1 min read
Great post. Because I recently learned about asserts and know that a newbie might ask “how are asserts and errors different” ?
I would say:
Asserts are similar to errors with try! as in both mean something didn’t go right. Yet have the following differences:
1. Asserts break execution meaning there is no way to catch or have a fallback. 2. Asserts can be configured to not work in release and only work in debug. Errors always work regardless of any scheme. 3. Asserts can have a specific log message.
