|
|
|
|
|
by qznc
3552 days ago
|
|
I like the 'weakly pure' concept in D. A function like pure int frignate(database db, const config cfg);
cannot change anything except the database object (and anything reachable from it). Can not mutate the environment. Can not mutate the config object parameter. This is finer control than pure functional programming and safer than imperative/object-oriented programming. |
|
And you can swap in non-IO based instances for testing, or whatever else you want.