Setting the role of a user with code

Just adding my two cents, as I read many others have, for this option . It would be nice to set a user’s role through code based on a registration entry. I think it will be a worthy feature for many developers. Thank you for the consideration.