Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

Now. I am not a 10x developer.

But this concern here with writing a make_pizza() function:

> The problem is that these two pizzas just happen to have the same crust, sauce and cheese. Had we started out with two pizza types that have different crust/sauce/cheese, we never would have made this refactor.

You can solve for this by adding parameters with default values for all of those things. Use the defaults for the most common use cases, but of course for pizzas with different crusts and such, you can override the default.

Not all languages support default parameter values, it's true. And of course, there is a level of complexity at which this breaks down.



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

Search: