4 ms·
Declarative vs imperative. Languages have state and behavior. I've had to convert 50k class-based schemas to a declarative DSL; the requirement is to be declar
by kuchenbecker 3y ago
Declarative vs imperative. Languages have state and behavior.
I've had to convert 50k class-based schemas to a declarative DSL; the requirement is to be declarative, not rely on external state. and portable as-is with as little interpretation as possible.
The flexibility of a language means some bug deep in a library will cause your infra to delete or misconfigureitself on accident.
An API requires transactions or at the very least a read-modify-write cycle. The API need to always be up so engineers can merge their modifications to infrastructure. Recovery and undo is also a problem that needs to be solved so you need a system with point in time recovery.
My Preference is to have an actual language generate what the system will do in a human-readable format, and you check that in, but Git and JSON or YAML with a Proto DSL act as the API, and then anything that can write a flat file can be used to configure your system.
- globular-toast 3y agoYeah, but we're adults and just because we can do something doesn't mean we have to. You can write shit code and you can write shit configs. Python can be written in a declarative style with perhaps a little magic sprinkled when pragmatic to do so. Completely banning imperative programming is like throwing out the baby with bath water.