3 ms·
I try to create new types if needed instead of passing to a function too many parameters. Also say a function needs the user email you don't pass it the big Use
by simion314 5y ago
I try to create new types if needed instead of passing to a function too many parameters. Also say a function needs the user email you don't pass it the big User object you pass only the email.
The issue I hit though is with code that evolves over years, it starts simple and then each team member had to add some new feature and the simple functions get larger and alrger , the number of parameters increases etc , the solution is to take the time and re-analyze the updated problem and refactor or rewrite the solution to be again composed from simple parts that do one thing.
let me know If I misunderstand the thing you said about types, or you referring mainly about REPL