In functional programming languages, a developer is always cautious about writing pure functions. Some functional languages simply do not allow impure functions, and some other functional languages force to to state explicitly when something impure is happening. But in imperative languages, there is usually no such distinction between pure and impure codes/functions. And impure fictions are quite the norm in imperative languages. But someone can still write pure functions in imperative languages and that is good for code health in my opinion.
So, how can we convince or encourage others to write pure functions within an imperative languages?
Aucun commentaire:
Enregistrer un commentaire