Hacker News new | past | comments | ask | show | jobs | submit login

You need to make your functions smaller and more generic...

This is something I keep fighting against myself on, but it makes my code more portable...




Making them generic is key to code reuse, smaller is sometimes only to improve readability.

As soon as you see a pattern appear in your code, something idiomatic that you've done a couple of time with small variations it's high time to abstract out a library function.

Do that a couple of times and you'll see the size of your functions diminish as if by magic.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: