Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Recipes try to micro-manage you instead of giving you the right information. This works in the same cases where micro-management works.

You had plenty of biscuits before, you know how you like them, and if you have experience baking them you know what can go wrong. So for biscuits the recipe model is fine. But for that lobster bisque soufflé you just picked off Joel Robuchon's cookbook? Not so much.



I'm not sure I follow. There are folks out there good enough at following recipes that they pretty much can just pick one up and run with it. Similarly, there are recipes that are so poorly done that they couldn't be followed in any reasonable sense.

None of this really addresses the imperative/declarative point, though. If you were to put together a recipe that was nothing but the declarations of all of the interactions that must take place to make the desired food, I'm sure it could be done. At this point, "executing" the program would really just be finding the correct order to make the interactions happen. However, my fundamental challenge is that this program would be no more approachable for other programmers than alternatives. Less so, actually.

As an example, SQL is a wonderful language for describing the data that one wants to get out of a database. It practically provides zero indication for how that fetching is actually done. For that, one creates an execution plan to logic about the process of getting the data.


Oh, but in what regards programming I fundamentally agree with you. And in what regards cooking, I'd go for an hybrid model as you mentioned, rather than a purely declarative one. I got side-tracked by your reference of one of my pet subjects and wasn't at all thinking about your real argument on programming, sorry for that!

Coming back to cooking: the best guys won't be much following the recipe but reading between the lines to get to the real information, mostly ignoring the imperative steps (which are usually declinations of techniques they already know by heart). Taking the SQL example: the recipe model gives you something like the result of an EXPLAIN command, often without the benefit of having the actual SQL statement. Sort of.


:) Completely agreed on the best cooks.

And no apologies necessary! I feel I owe a giant thank you to all involved in this entire thread. Has been a joy trying to digest all of the facets covered. In this subthread, it comes back to what is the program trying to accomplish? Communicating exacting steps to the computer to perform (as few computers will "ignore imperative steps"[1]), or communicating to the next programmer what was intended. Or both? Seems we both feel it is both, and hence needs a hybrid approach.

[1] I realize this isn't even strictly true. Computers are free to reorder some instructions, for example.




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

Search: