2 ms·
I use Struct for some things because it enforces and documents the shape of the data. This is especially helpful when code gets complicated and you have a lot
by kayodelycaon 4y ago
I use Struct for some things because it enforces and documents the shape of the data.
This is especially helpful when code gets complicated and you have a lot of hashes being thrown around.
Instead of trying to document and enforce a nested hash structure through multiple layers, you can use Structs to make mini classes that do that for you.