Hi — author here. Yes, but that still requires manually defining structure upfront. With dynamic method generation, I could introspect a database and generate named methods at runtime, whereas Swift’s static approach is more boilerplate-heavy and less expressive. Not saying Swift’s approach is wrong — metaprogramming like this is antithetical to its goals as a language — just that I like having this ability when it’s available.
Is swift not polymorphic enough to re-use the same static method in multiple places instead of needing to dynamically generate new ones?
Hi — author here. Yes, but that still requires manually defining structure upfront. With dynamic method generation, I could introspect a database and generate named methods at runtime, whereas Swift’s static approach is more boilerplate-heavy and less expressive. Not saying Swift’s approach is wrong — metaprogramming like this is antithetical to its goals as a language — just that I like having this ability when it’s available.