Understanding the Benefits of Using Schemas Over Types in TypeScript
Hi all, I'm very new to Effect and trying to learn. I had a quick question about how Schema works.
Is the following statement true?
The reason to use schema instead of just types is the following 2 points:
1. You need a more precise "type". Email, number greater than 0, string of certain length, etc
2. You don't know what data you are receiving and you are assuming the "type" in typescript. It is better to do a schema so that we throw a schema error at runtime automatically rather than throwing an error later in the chain (or sometimes not even throwing an error and just leading to bad behavior from the program)
Is the following statement true?
The reason to use schema instead of just types is the following 2 points:
1. You need a more precise "type". Email, number greater than 0, string of certain length, etc
2. You don't know what data you are receiving and you are assuming the "type" in typescript. It is better to do a schema so that we throw a schema error at runtime automatically rather than throwing an error later in the chain (or sometimes not even throwing an error and just leading to bad behavior from the program)
