The run-time tests are needed to prevent:
dt_getrole(reaction, mol); /* parameters swapped */Compare that to a more OO approach:
mol.getrole(reaction) # fails: molecules don't have
# a "getrole" method
reaction.getrole(obj) # while a reaction does
Using a more modern language gives us those capabilities "for free"
because they are built into the language.