When reading Duniter v2 code, one aspect of programming style surprised me. It’s the use of variables representing something hypothetic instead of something real. Examples:
-
next_creatable_identity_on
instead oflast_certification_date
(expressed in BlockNumber) -
removable_on
instead ofis_removable
-
expire_on
instead oflast_activity
-
first_eligible_ud
instead oflast_claimed_ud
(or start of membership if no UD ever claimed)
At least this is consistant in the codebase, but it can be a bit unsettling at start. The reason why I prefer real variables is that it makes implementing edge cases easier (for instance changing the interval between certifications, changing the inactivity time before which an identity is forgotten…).
(just wanted to keep track of that)