47
Small functions are easy to test and easy to understand. Think of a car—it’s made of many small parts that are easy to fix individually. If the whole car was one solid block, you couldn't fix anything!
I always tell my students: one function should do one thing. If it's doing two things, break it in half. Your future self will thank you.
Log in to add a comment.