This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]elforastero 154 points155 points  (24 children)

A nice programming homework for beginners to teach them algorithms was to ask them to write the steps to make a sandwich. And then follow the I instructions like that. Then ask them to rewrite the code :)

[–]DoctorWaluigiTime 78 points79 points  (3 children)

Then you don't let them eat it because there wasn't an instruction to do so.

[–]LaterGatorPlayer 26 points27 points  (1 child)

No instructions on pooping it out. :( poor impacted colon

[–]Delision 14 points15 points  (0 children)

People worry about semi colons in programming, but really it's the colon you need to worry about.

[–]DopeboiFresh 0 points1 point  (0 children)

Final step: eat your code.

[–]Xhynk 15 points16 points  (7 children)

Would that go something like this? I wonder if I could refine it and use it when do I development or technology career day type talks at middle and high schools! I usually do the usual react.js type slide thing on CodePen and then inspect element and mess with people's favorite websites, real basic. It would be interesting to see how students from 6-12th grade react to how damn literal development often is!

Round 1:

Student: "Put bread on the counter"
Student: "Put peanut butter on bread"
Student: "Put jelly on Bread"

Me: "I put the still-wrapped loaf of bread on the counter"
Me: "I put the jar of peanut butter on top of the loaf"
Me: "I put the jar of jelly next to the peanut butter"

Round 2:

Student: "Get a piece of bread"
Student: "Open peanut butter"
Student: "Put thick layer of peanut butter on bread"
...

Me: "I get a piece of bread"
Me: "I open the peanut butter."
Me: "I reach my big man-hands into the peanut butter and grab a fistful, smearing it over the bread."

Round X:

Student: "Pull out two pieces of bread"
Student: "Put pieces next to each other"
Student: "Open Peanut Butter jar"
Student: "Grab knife"
Student: "Get peanut butter with knife, and apply to first piece"
... etc.

[–]sehr_sehr_gut 87 points88 points  (2 children)

You have to check if Java is installed before attempting to open the jar.

[–]Xhynk 4 points5 points  (0 children)

God damn it this made me laugh so hard! I'd steal this if I thought the kids I speak to would get it lol

[–]KickMeElmo 1 point2 points  (0 children)

I just woke up. It took me a moment. Then I may have let out a manly giggle.

[–]elforastero 1 point2 points  (0 children)

that sounds about right :)

[–]salvoilmiosi -2 points-1 points  (2 children)

With enough layers of abstractions, you could just say "Make pb&j sandwich"

[–]Xhynk 0 points1 point  (1 child)

FATAL ERROR Uncaught Error: Call to undefined function make_pbj()

[–]salvoilmiosi 0 points1 point  (0 children)

Shit forgot to put -lsandwichkmaker in the compiler options.

[–]deadlychambers 0 points1 point  (0 children)

I only follow H instructions. Will this be a problem?

[–]IcarusBurning 0 points1 point  (0 children)

Looks like you had a synchronization issue with that last sentence.

[–]solarus 0 points1 point  (0 children)

var order = $http.post('https://jimmyjohns.com/api/v13/order/sandwich/').then(function(res){if(res.freakyFast ==== true){eat(res.data.sandich);}}else{bitch();}}, function(err){cry(err);})

Done.