Monday, July 6, 2009

Programming is like Cooking

I like to cook. And I like to program. I dont know if this is a common thing or not but I know at least one other person like myself. There must be something to it. Particularly because of the common phrase "spaghetti programing". And now I come to find that's not the only food analogy that's been coined. I've been missing out!

So, spaghetti code is what you'd expect: meandering code that loops in on itself and becomes a tangled unsortable mess.

But what about ravioli code? Well that's an analogy to object oriented programming, of course!

Then there's lasagna code. This is code that is structured into, you guessed it, layers! Each layer (or tier) is separated by a well defined interface (a noodle).

But the one I like best of all is the Spaghetti with Meatballs coding style. I see this a lot, especially with PHP programming. This is messy, tangled procedural code with a sprinkling of objects thrown in! Because like meatballs, objects make everything better!

Now I'm hungry. I think I want a meatball lasagna with raviolis on top. mmm.

No comments: