2 ms·
Even when I only really need C, the contract programming that D provides is really helpful as it provides a macro free way of doing rigorous assertions etc. in
by mhh__ 7y ago
Even when I only really need C, the contract programming that D provides is really helpful as it provides a macro free way of doing rigorous assertions etc. in a way that I can turn off without infecting the actual logic code.
If a struct's payload cannot be null, for example, getting the compiler to insert checks into all uses in debug builds can be done easily
That and metaprogramming in D is all compile time so you get RSI-free hands, for free.
- pjmlp 7y agoC++20 is also getting contracts, just as info. The more languages that support DbC the better.
- vram22 7y agoEiffel may have been one of the first languages to support DbC (Design by Contract). https://en.wikipedia.org/wiki/Design_by_contract#History https://en.wikipedia.org/wiki/Design_by_contract#History