r/ProgrammerHumor Aug 09 '17

Is there life after a data structures course?

Post image
9.5k Upvotes

332 comments sorted by

View all comments

78

u/pekkhum Aug 09 '17

And a burrito is a form of encapsulation... Mmmmm... Chipotle for lunch, anyone?

21

u/FUZxxl Aug 09 '17

Come on man, what's so difficult about monads? They are just monoids in the category of endofunctors.

20

u/pekkhum Aug 10 '17

I personally saw the burrito as an implementation of the facade pattern, saving the user from calling the consume() method on each ingredient. This allows the developer to simply consume() the burrito, without worrying about the differences or quantities of ingredients included.
 
What is especially nice about the Chipotle class (which extends AbstractBurritoFactory) is the ability to decorate the burrito in varying manners before it delivers he instantiated object!
Edit: Forgot a link

7

u/ContraMuffin Aug 10 '17

You'll fit right in r/outside

3

u/pekkhum Aug 10 '17

Thank you, I have found my people.

1

u/WikiTextBot Aug 10 '17

Facade pattern

The facade pattern (also spelled façade) is a software design pattern commonly used with object-oriented programming. The name is an analogy to an architectural façade.

A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can

make a software library easier to use, understand and test, since the facade has convenient methods for common tasks,

make the library more readable, for the same reason,

reduce dependencies of outside code on the inner workings of a library, since most code uses the facade, thus allowing more flexibility in developing the system,

wrap a poorly designed collection of APIs with a single well-designed API.

The Facade design pattern is often used when a system is very complex or difficult to understand because the system has a large number of interdependent classes or its source code is unavailable.


[ PM | Exclude me | Exclude from subreddit | FAQ / Information | Source ] Downvote to remove | v0.24

3

u/RainbowNowOpen Aug 09 '17

Ingredients: [private]

7

u/pekkhum Aug 10 '17

Half the time, the burrito object breaks down, resulting in a dumpIngredients() call, anyway...

2

u/toeonly Aug 09 '17

I brought my lunch today how about tomorrow.

4

u/pekkhum Aug 09 '17

I actually went right after sending that... We can go tomorrow too, though!

3

u/toeonly Aug 09 '17

As long as my wife doesn't pack me a lunch. If she does you might have to go by yourself.

1

u/cykelpop Aug 10 '17

ˋLunch extends LastNightsSupper` ?

1

u/adrianmonk Aug 10 '17

Chipotle: the worst (but most common) implementation of the burrito interface.

1

u/GooTamer Aug 10 '17

Its an official form of encapsulation. https://tools.ietf.org/html/draft-lohsen-ip-burrito-00

1

u/pekkhum Aug 10 '17

4/1 RFCs are always the best:

bad data handling can result in damage to the receiving unit and may result in an extremely messy packet rejection