r/learnprogramming • • May 23 '19

Why study programming when you can just play an RPG?

Had a noteworthy event a while back I thought many people in here would get a kick out of. This was originally posted in the python reddit, but it was suggested I repost it here, so here it is. I work as the IT tutor at my school and has part of that I handle any Intro to Programming appointments that we get. The class isn't really intended to teach you how to program in a given language, though it does use python, but rather to introduce you to the basic programming concepts of variables, data types, loops, functions, classes, etc.

So I had a student come in, basically at her wit's end, border-line in tears. Short of the long: 5 weeks into class and she was not understanding the concepts and it was really frustrating her. Okay, so I hunker down and start working with her. In this case, focusing on loops (as that's chapter 6 in the book). He seems to kind of, sort of be getting it, if I hold her hand and lead her through it.

30 minutes in and we haven't really made any progress. I took a step back and started working with her on comparison operations. But she wasn't really getting that either. she is getting more frustrated. So I try to get her mind off the material for a moment. Her phone flashes a reminder about "D&D party" tonight. So I ask if she plays D&D. She does, and we chat briefly about the campaign she's in (she plays a rogue, go figure). Then I hit on an idea.

"You know a lot of early programmers were RPG players and because of that a lot of what developed into modern programming was influenced and based on RPG mechanics?"

She looked at me like I'm making a really bad setup for an even worse joke.

"I'm serious. How do you determine if you pass or fail a stat-test?" I ask.

"Well, you determine what you need to roll over to pass, roll a dice, add any modifiers you have and compare that to the first number." She explains, more energetically.

"So you perform a comparison operation?" I asked leadingly.

"Well... no. I mean... kind of... wait..." She stammers out, her response was interspersed as she thought and talked at the same time.

I go to write on the White board:

if Dice_roll+modifiers >= needed-roll:  
    you pass  
 else:  
     you fail

She looked at it for a long moment, you could see the gears turning in her head.

"So the variable, Dice_Roll is added to the variable modifiers.. and that's compared to the needed roll. If the needed_roll is higher... you fail... otherwise... you pass." She parses out, once more thinking and speaking at the same time.

"Yeah... and what about this one?" I ask as I write on the board:

 while enemy_attack == True:            
      player.cast(shield)

She looks at it for a minute.

"So long as the enemy is attacking, cast the shield spell." she says.

"Nice, how about this one?"

 for each enemy in hoard:  
      If player.hp > enemy.defense:  
           Target_enemy = True   
           while Target_enemy == True:  
                player.attack(sword,enemy)

"For each enemy in the hoard... check to see if the player Hit Points are greater then the that enemy's defense. If it is, target that enemy. As long as that enemy is targeted, attack them."

"And you just worked through a while loop nested inside an if control statement that was inside a while loop." I explain.

"What?" She says aghast. She quickly turns back to the board and starts studying the examples intently. I can see her eyes traveling across what I wrote.

"So this on is just a comparison operator?" She asks pointing to the dice roll I wrote out before.

"Yup." I respond.

"And this is just a while loop that would tell the player character to cast the shield spell." She asks sounding more confident.

"Yup." I respond.

Her entire face lights up in that unmistakable look of 'the light bulb turning on'. We start hammering through more examples of loops and control statements, fluctuating between the requirements of her assignments and using RPG examples. It's a fun day when you get to talk about Dragons and knights and actually have it be work related.

So I guess it all depends on what material you use to explain it, right?

3.2k Upvotes

191 comments sorted by

123

u/KDLGates May 23 '19

Your real life karma score grew greatly that day.

while (TorroesPrime.karma < TorroesPrime.deservedKarma) {
    TorroesPrime.karma++;
}

45

u/TorroesPrime May 23 '19

Don't ask me why, but I feel surprised you didn't use a Fallout "You've gained karma" here.

8

u/[deleted] May 24 '19

Karmawhore, karmawhore never changes.

5

u/Badatscrabble May 24 '19

Should probably be in all-caps if its a constant.

36

u/nutrecht May 23 '19
TorroesPrime.karma = TorroesPrime.deservedKarma

(Sorry, could not resist)

7

u/RunasSudo May 24 '19

This will result in a different outcome if the deserved karma is less than the current karma. We wouldn't want TorroesPrime to lose karma, now, would we!

2

u/[deleted] May 25 '19
TorroesPrime.karma = max(TorroesPrime.karma,TorroesPrime.deservedKarma)

2

u/[deleted] May 24 '19

You forgot a ;

6

u/nutrecht May 24 '19

No it's Kotlin :P

1

u/KDLGates May 23 '19

But is the worth of karma cheapened if it's earned by a single instruction?

80

u/farmerje May 23 '19 edited May 23 '19

Nice!

People can only understand new things in terms of something they already understand. You have no choice but to encode a new concept in a language they already know, ideally in a way that's faithful to the underlying concept.

It seems obvious when you spell it out, but it forces you to model learning as more than just a raw fact-transmission problem. If you just try to explain a foreign concept in terms of other foreign concepts, the student will try to make sense of it in terms of something they understand, but the chances of that being a faithful representation of the concept are pretty low.

I'm sure we've had someone go "Oh, that makes perfect sense!" only to realize later — sometimes much later — that they were absolutely confused. To quote Alan Perlis, "If a listener nods their head when you're explaining your program, wake them up."

The very first thing I do with any student is take stock of the ways-of-thinking they already have access to. What did they study? Do they have any hobbies or games they like to play? What have they done professionally? What programs do they use on a day-to-day basis?

A student who studied some basic philosophy probably knows about the problem of universals and Plato's solution with the theory of forms. These concepts are great for explaining object-oriented programming, where classes act like Forms and instances like Particulars.

Likewise, if someone knows OOP really well, you could explain the problem of universals in the language of OOP!

Board games are great because they're so procedural by nature, have a level of universal familiarity, and are easy to explore without using any code.

It always has to start with understanding the ways a student might be able to make sense of what you're trying to teach, though.

23

u/TorroesPrime May 23 '19

One of the... 'hurdles' I guess is the best word to use to describe this, that I've encountered with some students is they have this notion of what that programming is in their head and typically that notion includes some mention of "Programming is really hard" so they wind up partly burying themselves in their own fears of how hard programming is. So they never really get how good they've become, or simple programming actually is. one trick I've found to help with this is I will pull up a second of code form the final project I did when I took the class, give the student no context as to what the program as a whole does, or what this code itself does and ask them to puzzle through the code for a few minutes and then they think they know what the code does, explain it to me. Typically I'll use this segment for this:

with open(fname) as file_src:
    for line in file_src.readlines():
        clean_line = line.rstrip('\\n:,.')
        file_cs = clean_line
        counter += 1
        word = file_scs.split()

Generally the students will get most of it, sometimes not getting what fname is, which isn't unreasonable since it isn't declared within that code snippet. But it helps get them over that "programming is hard" hurdle somewhat and gives them a little confidence booster.

3

u/Moldy_pirate May 23 '19

So I’m extremely new to programming, and don’t know Python at all yet. Does this make a number on a new line, incrementing on the previous line’s number by one? Or adding a word to the next line? Or am I totally off base?

6

u/TorroesPrime May 23 '19

So I’m extremely new to programming, and don’t know Python at all yet. Does this make a number on a new line, incrementing on the previous line’s number by one? Or adding a word to the next line? Or am I totally off base?

one of the big selling points of Python is that it's syntax is designed to be easily read, so just take it one line at a time:

with open(fname) as file_src:

literally it's just saying "Open this object, and refer to it as 'file_src' " so if I call 'file_src' I'm referring to whatever the object 'fname' is.

With that in mind, what do you think the next line is doing:

for line in file_src.readlines():

3

u/Moldy_pirate May 23 '19

I have a feeling I way overthought this haha.

Does it read a line or lines in file_src?

7

u/TorroesPrime May 23 '19

you're about 99.92% right on the mark.

It is reading each line in file_src.

I know that sounds incredibly pedantic, but it's a critical difference to understand. Reading a line, or a range of lines only reads that selection. Reading each line, means it will read each line in the file.

2

u/Moldy_pirate May 23 '19

That makes sense! Knowing whether it’s looking at each, one, or a range is important.

So then the next line takes the line, removes the “.” and “,” symbols and puts it in a new object called clean_line?

Then the next line defines the clean line as a new object called file.cs, ave the next line of code numbers it?

6

u/TorroesPrime May 23 '19

That's it. The code does that for each line in the file as referenced in 'fname.

And how much did I have to explain to you? The first line, and point out the difference between reading a line, or reading each line. Everything else you got.

20

u/farmerje May 23 '19 edited May 23 '19

There's a ton going on in that code and I wouldn't expect a beginner to get 90% of it, not really.

My principle is something like:

  • If you want to learn a new concept, practice it in a familiar environment

  • If you want to learn a new environment, practice in it with a familiar concept

Imagine a beginner even just wondering, "Ok, what variables do I have access to in the inner-most block?" Already that question is way more precise than a beginner is likely to ask, but let's say they're that good.

There are five ways variables are being defined in that snippet:

  1. fname, which is coming from some other place (a beginner has to have some idea of things "coming into" and "going out of" a piece of code for that to even occur to them!)

  2. file_src from the with ... as ... clause

  3. line from the for ... in ... clause

  4. The direct assignments via =

  5. counter, which is presumably initialized to 0 elsewhere and re-assigned via +=

Part of being an expert is having powerful mental models that filter signal from noise without us even realizing it. A beginner has who-knows-what mental model. Typically, they'll assume that two pieces of code that look different must be different.

Imagine a beginner that's even just a little unclear on what variables are. Something like this might be happening internally: "Well, I know variables are defined using variable = <stuff>, and I only see that on three lines. Those other lines look completely different and therefore must not have anything to do with defining a variable."

I think the odds of them forming an accurate mental model of what that snippet does is very low and their self-reported understanding will be all over the place.

What I do with absolute beginners is to focus on the problem of reflecting on their own thoughts and making them precise enough to translate into code. I intentionally get them to slow down and forget about the code. If I want them to learn loops, I need a loop-shaped hole in their understanding before I give them the syntax.

So, I like doing a lot of exercises with index cards or games where they write "programs" in a non-code langugage that can be executed by other humans (e.g., grid paper + instructions for drawing shapes in terms of pen movement).

For example, take a stack of 50+ index cards with random numbers written on one side. Give a student a pencil and some post-it notes.

Tell them:

We're going to do an exercise that at first might seem silly, but it will take less than 5 minutes. At the end, I'm going to show you some actual, runnable Python code involving syntax you've never seen, but you'll be able to understand exactly what's going on."

Here are some post-it notes and a pencil. In a moment, I'm going to hand you a pile of index cards with numbers written on one side. Your job is to find the largest number in the pile, write it down on a post-it note, and then hand me the post-it note. You can use as many post-it notes as you want to do the work you need.

There are two rules: you can only look at one index card at a time and you can only write down one number on a given post-it. So, you can't use a single post-it note and write a bunch of really tiny numbers. You can, however, erase the number on a post-it note and replace it with another number.

Everyone can do this exercise with a little prompting. If you ask them at the end what they were doing, they'll say something very much like pseudocode to you in English. "For every index card, I looked at the number. If that number was bigger than...etc. etc."

You then show them:

def max(numbers):
  maxSoFar = None

  for num in numbers:
    if maxSoFar is None or num > maxSoFar
      maxSoFar = num

  return maxSoFar

and they'll be able to map that Python code directly to the index card game they just did.

So, one "trick", I guess, is that if a student doesn't have immediate access to a language that will make explaining the concept easy, show them that they can create their own language for understanding and use that.

Often I do 5-10 index-card-to-code exercises that cover the core concepts (variables, loops, lists, functions, return values, conditionals, etc.). I show them the same code written in multiple languages, just to drive home the point that the code itself is almost incidental — once you have a clear-enough picture in your head, the code is recognizable regardless1 of language.

1

u/Knoggelvi May 23 '19

I haven't used python in a while, but would a > comparison against None result in true?

1

u/farmerje May 23 '19

No such comparison happens because or short-circuits.

1

u/Knoggelvi May 23 '19

Maybe I should've phrased differently but I'm curious if the first comparison against None could be removed.

1

u/Tarinu May 23 '19
>>> 3 > None
Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    TypeError: '>' not supported between instances of 'int' and 'NoneType'

1

u/Knoggelvi May 23 '19

Python 2 or 3? Either way, thanks for testing that

1

u/Tarinu May 23 '19

Python 3. Didn't even think about testing on 2, but I expect the same result.

1

u/Knoggelvi May 23 '19

Same or worse. Thanks for clarifying

1

u/mxzf May 24 '19
>>> 3 > None
True

Apparently Python 2.7 it handles it fine.

1

u/farmerje May 23 '19

Yes, you could and I would if I were writing a max function for real. However, the goal is to have it mirror the procedure that the student describes as close as possible.

For example, you could initialize maxSoFar to list[0] if we were assuming the list was never empty.

But it's more likely the student will say something like...

Pick up a blank post-it note

For each number in the pile of index cards...
  if my post-it-note is blank, then...
    write the index card number on the post-it note
  otherwise, if the number on the index card is greater than the number on the post-it note
    replace the number on the post-it note with the number on the index card

hand you the post-it note

The goal isn't to get them to write optimal code, but to get them to recognize their own thoughts in the code they see. You can take it in different directions from there, e.g., what do we do with an empty list? how can we get rid of the if/else in every iteration?

18

u/Luder714 May 23 '19

You are my hero.

I had the opposite experience. I knew the logic but had trouble finding a way to use it.

When should I use java/C#/C++/etc. Then I learned of libraries and how it all can function together.

I still don't code but could if forced to. Lynda.com is awesome, at least for me. Free with many local libraries.

15

u/TorroesPrime May 23 '19

honestly, I feel like introduction to programming is a course that everyone should take regardless of what they want to be or what degree they are working on. it really forces you to work through the material of a problem and break it down into needed information and operation. it's a skill that a lot of people simply do not learn these days.

3

u/natriusaut May 23 '19

It sounds so much like what we would need at our evening-school. We should program things in C and we end up basically learning it all for ourself because our teacher is, to be nice, not the best teacher. He might know what he is doing, but he is not a good teacher in my opinion, at least while class. Maybe better when explaining something directly.

9

u/TorroesPrime May 23 '19

because our teacher is, to be nice, not the best teacher.

There was an article I read awhile back, and I wish I had saved it cause I would love to go back and re-read it now. I initially read the article and discarded it because it sounded too pretentious and high on itself to be taken seriously. It started with a statement to effect of "No one can teach programming, it has to be learned." At the time I was like "Well... yeah. No shit Sherlock. In order for a teacher to teach, the student has to learn. Would you like to wow us with a declaration about water being wet too?"

But after being a tutor for a year, I'm starting to wonder if I dismissed the article too quickly. More and more I'm seeing how 'teaching' and 'learning' are two separate actions, and while most other subjects can be 'taught' programming is much student based. it's not about imparting information, it's about processing information which forces you to think about how you think. Something I don't think most other areas of study start out with.

9

u/NDaveT May 23 '19

I think it also introduces people to the way that computers follow instructions. It's easier to figure out what a computer is doing if you can sort of think like a computer.

3

u/Vorthas May 24 '19

That's what happens to when I program. I think like a computer.

The issue is when I try to think in an Object-oriented way, but still like a computer (which typically does things procedurally under the hood). Probably because I learned programming with PIC assembly and C before I even encountered an OO language.

1

u/mayayahi May 24 '19

Learning the basics can influence ones thinking greatly, I would go as far as saying that it can change a persons life. Not everyone needs to do it at a professional level but I think we should, at least on a toy example, understand the products we use on a daily basis.

1

u/MaTrIx4057 May 24 '19

It also improves logical thinking which helps a lot IRL.

901

u/charmerDark May 23 '19

Teaching a subject in an interesting manner is a true skill. you've got it!

241

u/[deleted] May 23 '19

It's not just an interesting manner, it's putting yourself into what that person is knowledgeable with. Not many people can do that as it takes quite a lot of general knowledge unless you're lucky enough to be interested in what they are already.

Imagine you're trying to teach a motor mechanic to program. You could do exactly what OP did if you know a little about engines. But could you do the same if you didn't?

OP handled that brilliantly, really kick arse teaching style.

43

u/googleismygod May 24 '19

When I was a bootcamp instructor I used food/kitchen metaphors a lot for this reason. Cooking is something everyone has exposure to no matter what background they come from, so there's always some way to make a connection there. Whether or not cooking is your thing, we all know something about trying to get something done in a kitchen.

For example, when trying to explain the difference between an object instance and a class, I'd start by asking them to write down a few basic instructions on how to make their favorite dish, along with a description of it. Then I'd ask, okay so can I eat this? And they'd usually chuckle. And I'd use that to explain the difference between defining a class and instantiating an object. Recipe != dish. Or, I'd talk about writing a function for actions that your program does repeatedly as sort of being like making a big batch of sauce all at once, so that you don't have to make the sauce from scratch every time you want to use it. You just package it up in an easy-to-use form for next time rather than re-writing the same lines of code over and over.

18

u/[deleted] May 24 '19

Good idea, that's something I do too, but for a slightly different reason.

My partner is a chef, and she always asks me about my work. She's a sweetheart and even wants to know a bit of detail. But it can be technical obviously, and she quickly gets lost.

while the egg whites aren't aerated, keep whisking.

I use what little I know about cooking and baking to explain what I do in terms she can easily understand.

but what was meant to be eggs wasn't, they thought they were spoons, meaning they wouldn't aerate because they didn't know how to. Can you imagine throwing spoons into a bowl and trying to whisk them?

Which lead us onto questions from her like "why did the eggs think they were spoons?"

I know it's a silly example, but it happened 😃

21

u/vinny8boberano May 24 '19

Used this same technique in tech support, and had pretty good results overall. Mostly with people who were scared, but willing to learn.

5

u/Caricifus May 24 '19

You got downvoted for that? Take an upvote.

5

u/vinny8boberano May 24 '19

I guess I should have clarified that not everyone it worked with was scared. Plus, being scared of the unknown is pretty natural. But, thank you for the upvote.

8

u/Ikarostv May 23 '19

Honestly, it's what I do with a lot of people myself!

My friend has a weird sense of humor. So when we were in school 10 years ago, I was explaining how Computers operate to him.

To be brief, the subject manner I used was midgets working in a factory.

For others I've told the story too in depth, they've left confused on how he understood it.

Now he's right alongside me in the field of interest, and has dived into tons of tech related things.

1

u/Majache May 24 '19
while (currentMiles >= 3000)
   oilChange();
   currentMiles = 0;

2

u/[deleted] May 24 '19

Not sure you should be winding back your odometer with every oil change, you'll get in trouble for that ;)

while ((myCar.getCurrentMileage() % 3000) == 0) {
    myCar.doOilChange();
}

Modulus makes it all easier.

1

u/Majache May 24 '19

Lol that'd be odometer variable. Naming things is hard :p

But yea a car class is best. Didn't even think about using modulus like that. Pretty neat! I suppose if I actually changed my oil every 3k miles exactly it'd be pretty simple to calculate lol.

Would that still work if you went over 3k, let's say, on the way to a shop, or wouldn't you end up over shooting and bypassing the check for future conditions?

1

u/[deleted] May 24 '19

To be honest, it'd be a pain in the arse to code when the reality is, human stops at the traffic lights, looks at the windscreen sticker, looks at the odometer reading, oh shoot I'm 1,000 miles out, I'll do it next week, I promise...

17

u/nineteenhighfives May 23 '19

This!! I just recently finished an Introduction to Unix/Linux at my university and I can attest to the story 100%. I literally was lost (granted it was an expedited 8week course) the entire course but managed to pass with a B mainly based off of remembering terms and whatnot. Reading your example made things click off-bat and in a different manner. I almost feel like your post is what I needed to read to fully sum up the course I just finished. Oddly, thank you lol.

3

u/algerrr23 May 24 '19

Reminds me of an episode of Hey Arnold on Nickelodeon.

Arnold is assigned to be a tutor for the kids not passing the math class. He gets assigned to this bully who likes to beat up other kids for lunch money and whatnot. The bully thought math was "business". So when Arnold starting teaching him that taking 50% of someone's lunch money everyday is just a story problem. Or if he knocked out 3 of this other kids 12 teeth that's just a fraction. The bully got it.

-8

u/ready-ignite May 23 '19 edited May 23 '19

I think I read the same post near word for word a month or two ago.

Re-post?

Edit: The mysteries of the universe have been explained! Now on to the pub for a pint.

27

u/TorroesPrime May 23 '19

well... I did say I originally posted a while back in the python reddit, in the second line of the post. So... reading?

4

u/ready-ignite May 23 '19

That would explain familiarity. Skimmed through recognizing content, missing that key comment. :)

9

u/[deleted] May 23 '19
 for each enemy in hoard:
     If player.hp > enemy.defense:              
         Target_enemy = True               
         while Target_enemy == True:                   
           player.attack(sword,enemy) 

But where is the 'enemy' located? Is it in the 'hoard' or pointed by 'hoard'?

- a C programmer...

7

u/TorroesPrime May 23 '19

Since the class is presented using python, I didn't want to get into pointers.

6

u/Kayyam May 23 '19 edited May 23 '19

I don't know why the second while is nested in the if condition. I feel very strongly that it shouldn't be.

If X Then B

While B Do Y

3

u/TorroesPrime May 23 '19

the point was to get her to see that she did understand the concept of nested loops and control statements. Not necessarily to teach her good programming schema.

4

u/Kayyam May 23 '19

It's not a programming convention or good practice, it's a logic issue and I would say that someone trying to grasp the basic of nested loops should do the sort of exercice where they point ou faulty loop implementation like this one!

2

u/TorroesPrime May 25 '19

it's also not real code, so it wouldn't work anyway.

6

u/Knoggelvi May 23 '19

You're correct. The second while has no exit condition, so it would cause a stack overflow. In games terms, the player would attack the enemy a million times then freeze in place until someone kills him.

2

u/[deleted] May 24 '19

I was just kidding around :)

4

u/[deleted] May 24 '19

the_rock_standing_clapping.gif

1

u/TorroesPrime May 24 '19

I'm legitimately curious if there is a specific gif you are referencing with that post.

24

u/mrmivo May 23 '19

That is certainly more engaging than todo lists and note-taking apps!

10

u/mogadichu May 23 '19

This reads like an /r/thatHappened story

You had a student who didn't understand comparison operation? Loops? Surely she has some intellectual basis if she's into D&D? What grade is this? And how did you know what her notifications are about, did you pull up her phone and check? Why did you wait for 30 minutes before using an example?

15

u/TorroesPrime May 23 '19

about the phone: it was on the table when the notification flashed.

about the examples: I used several examples long before the 30 minutes mark, they just weren't based in D&D terms. if you would like I can pull up my appointment notes and reference some of the examples I made.

You're not going to find a lot of mentions of 'loops' or 'comparison operators' outside of programming and particularly not in a gaming book. So while people use loops and operators virtually every day of their lives, having to break them down into logical steps is a bit of a different exercise then what most people are used to doing. Just because my great grand-father understood "here is a list of groceries I need to buy" that doesn't mean he would understand it spelled out as:

it = listOfNumbers.begin(Groceries);
while(it != listOfNumbers.end())
{
    std::cout<<(*it)<<"  ";
    it++;
    buy(it)
}
std::cout<<std::endl;

4

u/verascity May 23 '19

As a teacher, I believe it. I mostly work with littles now but I sometimes teach adults and you'd be amazed how things just. don't. click. sometimes, until suddenly they do. Hell, I had Bayes explained to me about a dozen times before it made any sense. And ironically, the thing that finally connected was the original "test for a rare disease" example, which every other teacher seemed to feel they could improve upon.

FWIW, OP, my go-to, which was how I first learned Python, is making a sandwich. "While sandwich.open, sandwich += PB," and so on.

2

u/TorroesPrime May 23 '19

have you see the Peanut Butter sandwich challenge?

1

u/verascity May 23 '19

I have not, what is that?

2

u/TorroesPrime May 23 '19

it's an exercise, they used to do it in grade school. But the point is "Write the instructions for making a peanut butter sandwich, and I will follow them exactly as written."

There is a video of it. Gimme a second and see if I can find it.

9

u/NDaveT May 23 '19

You had a student who didn't understand comparison operation? Loops? Surely she has some intellectual basis if she's into D&D?

A lot of people shut down when they hear jargon terms. OP's story is about helping a student realize that they already understand part of the concept behind a term they didn't understand.

6

u/[deleted] May 23 '19

OP was probably using examples strictly in context of code (like using foo as variables and such). A lot of teachers don't go straight into abstraction of another field. If the phone is on the table in front of the student, not that difficult to catch a word or two on the notification if it flashes in your peripheral. Student was not understanding loops, so OP retraced back to comparison operators to see if D&D analogy would work. It works, so OP moves back into original topic of discussion but through D&D analogies.

17

u/foreveracunt May 23 '19

Man, it’s a good personality trait to be smart and sceptical.. but knowing how and when to shut that shit off is something that has brought me a lot of peace in my life. Just a thought my friend :)

-12

u/nutrecht May 23 '19 edited May 24 '19

Man, it’s a good personality trait to be smart and sceptical.. but knowing how and when to shut that shit off is something that has brought me a lot of peace in my life.

It's Reddit. People constantly make up stuff for karma. He could've easily conveyed the same message ("I have a nice idea to teach") without the dramatic story.

Edit: Not saying it didn't happen or that it's bad advice at all. Just that I understand why people might think it's not true. Who cares if it's true or not if it inspires people.

8

u/DiamondHyena May 23 '19

It definitely reads like this guy was stroking himself about his teaching prowess as he wrote this

4

u/TrontRaznik May 23 '19

Yeah I don't buy this either, and I'm usually the type to accept stories on Reddit at face value.

Comparisons are fairly basic operations. I'm guessing I first learned it in elementary or middle school math. Like what's not to get about if x > y then do something? If a student isn't grasping such a basic concept of not even programming, but logic, by 6 weeks into a course then that student is definitely not destined for browsing the web, much less programming.

3

u/[deleted] May 23 '19

If this sub was the office you would be Toby

2

u/bartacc May 23 '19

Yup, exactly what I thought while reading it. That really sounds like some made up fanfic story tbh. This stuff is pretty basic, I find it hard to believe that someone had troubles with understanding that for a month and then suddenly understood it because the variables got changed to "dice_roll" and "enemy.defense".

-3

u/Spikke May 23 '19

This is a repost.

6

u/TorroesPrime May 23 '19

This was originally posted in the python reddit

and this is an example of someone who didn't read the 2nd line of the post.

3

u/[deleted] May 23 '19

Why did you wait 3 months to repost it lol

4

u/TorroesPrime May 23 '19

because for the last 2 and a half months I've been dealing with getting a better job, transferring schools, discovering how much Amazon jerks it's interns around, and helping to rebuild basically 4/5 of the Tutoring department at the school I currently attend (turns out 41 of the 52 tutors in the department are not coming back this semester or for the fall semester, while 2 of the department managers are leaving), so I haven't really been on Reddit much. I logged on today and had like 6 messages from people saying I should post the story in here. I had the time today, so I did. By the dark gods, things feel boring when you're suddenly waiting for something to happen.

0

u/[deleted] May 23 '19

[deleted]

0

u/TorroesPrime May 23 '19

a dozen posts over the course of a month that would take about 15 minutes in total to make is active?

0

u/[deleted] May 23 '19

[deleted]

1

u/TorroesPrime May 23 '19

eh more like I didn't want to re-read the messages I had gotten suggesting I should re-post it here, so to be frank the idea didn't occur to me until this morning when I was sitting in the office almost literally twiddling my thumbs because I don't have any appointments. So yeah, I could have spent the 2 seconds it would take to C+P it, but to be blunt: between dealing with the department changes, the transfer paperwork (also the fact that my high school apparently thinks it's still 1985 and doesn't process electronic forms...) and dealing with amazon... yeah, haven't had the time, or inclination to sit on Reddit for 45 minutes and re-read old threads before today.

3

u/LucidTA May 24 '19

Who cares dude, jesus... Why does it matter if it took him 3 months to repost, why does it matter if he was busy?

-3

u/exploding_cat_wizard May 24 '19

I guess the really baffling part isn't that somewhere on reddit there lurks a use ready to nitpick the most inconsequential decisions for hours, it's that such an unintersting post actually gets upvoted?!

0

u/[deleted] May 24 '19

And what’s the purpose of your comment? Just to feel a little superior? Cause it certainly adds nothing otherwise. So good for you, you got to play superhero great job Johnny

0

u/exploding_cat_wizard May 24 '19

Yeah, just a little support in a sea of whinging comments too unimaginative to accept that sometimes, people actually have trouble getting the easy concepts.

0

u/[deleted] May 24 '19

Completely unrelated to my comment but ok go off Superman

0

u/Spikke May 23 '19

Tbh yea I missed that line but obviously I read the post if I recognized it from literal months ago lol

Regardless I wasn’t agreeing this story was fake, I just figured I’d point out the guy might be responding to someone who this story didn’t belong too.

1

u/Instacratz May 23 '19

I think it’s weird that some people like to repost things like this.

0

u/[deleted] May 24 '19

I was thinking the same thing kind of.

11

u/throwawayacc201711 May 23 '19 edited May 23 '19

It’s great hearing this, and it alludes to a subject many people starting out in programming forget to do.

Translating tasks into logic then translating logic into code. A lot of people try to jump from tasks straight into code.

I can’t make the diagram in this post, but creating a task based diagram of the logic simplifies a lot of coding when starting out

So:

Roll dice

<check greater than number>

Path 1: pass > give reward

Path 2: fail > roll dice again (connects back to roll dice)

Now you can “convert” your logic into a programming language

As you get into more complex scenarios, sketching out the logic in English is a great way to see if it makes sense and to spot any logic errors prior to coding

How we describe things in language can translate really well into code. It’s a big reason why I recommend people starting out to look into taking logic courses (if they’re in school) or just researching the topic.

Roll dice is a function that returns a result

Checking a value is an if statement

Path 2 points back to roll dice and we can see we do this until it passes, so it would be part of a loop.

Exit condition is a value being true

Give reward is a function because it is “doing” something same as roll dice

6

u/Andy101493 May 23 '19

We all needed a little push of sorts at one point or another before it really clicks; thank you for giving that back to somebody else

2

u/[deleted] May 23 '19

And this is the exact problem with traditional learning systems. They only cater for a specific learning style, leaving all others in the dust. What would have happened to her had you not taken the time to do this? She'd no doubt have failed dismally, given up and be on her way to a less than satisfactory job somewhere.

Your attention and persistence has likely saved her a lot of heartache, and allowed her to push on in a field she'd have likely been left out of had you not bothered.

Kudos to you sir.

8

u/TorroesPrime May 23 '19

this is one of those situations where a Tutor or a coach can do something with one or two students that a teacher simply can't with a whole class. I mean the intro class I took had... I think 40 students in it. I know a couple dropped, so we'll say 30 by the end of the semester. 2, 2-hour classes per week, times 16 weeks, minus 1 class for finals, and another for the starting week stuff, so you're looking at 60 hours of class time to convey the materials to 30 students.

In general, I spend 10-15 minutes in each of my appointments getting a feel for what the student is having trouble with, another 10 to come up with an approach to help them overcome their particular problem with the material. I try to avoid the 'quick route' of giving them an answer because it doesn't help them learn anything. Sometimes the same approach works with more then one student. And then the rest of the hour for the appointment working through the material itself. So say for every 2 students I had to come up with a unique approach, that's about 5 hours of time there. To do that in class, for each chapter... that's 40 hours... out of a 60 hour class. I mean... that's just not fiesable for teachers to do.

But when a student comes to a tutor they've already taken the first step and put the energy and effort in to say "I want to learn this" and I can spend that time with that one or two students.

4

u/[deleted] May 23 '19 edited May 23 '19

My earliest attempt at programming happened when I was a teen playing starwars galaxies. Their in game macros had very few limitations, and I'd found a way to program them to play for me while I was away from the keyboard. After a while I found that I didn't want to play because my macro'd character was earning experience more efficiently than I was.

Most recently I picked up Final Fantasy 12 and I'm playing through that for the first time. they have something called a "Gambit system" to assign commands to additional party members to take automatic actions under conditions. It's the same if/or statements you posted above. placed in a Priority stack.

If Ally health < 50%; Cast cure.
If Enemy health = 100%; Steal.
Target enemy with lowest health; Attack.

I was going through all the options and combinations yesterday thinking to myself this would be an interesting way to introduce conditionals to people.

I noticed a few peers in compsci really seemed to struggle with the concept of a stack. I took to it immediately because "first in, last out" is a basic mechanic in "Magic: the gathering." Friends and I have been repeating it to new players like it's dogma for as long as I can remember.

1

u/TrontRaznik May 24 '19

Can't tell you how many hundreds of hours I had my jedi grinding Dathomir witches for that god damn rare holocron. Never ended up getting it, and eventually I just paid something like 120m credits for it.

Just FYI in case you don't know, there are now private servers for both pre-CU and NGE, and a CU server is in the works. Swing over to /r/swgemu.

1

u/iheartrms May 24 '19

Now she gets to write a MUD.

2

u/TorroesPrime May 25 '19

a MUD... jeeze there's a system I havn't heard about in a loooooong time.

1

u/Odog4ever May 24 '19

This was originally posted in the python reddit, but it was suggested I repost it here, so here it is.

Go ahead and cross post this in r/RPG while you are at it! :)

1

u/TorroesPrime May 25 '19

If you want to cross post it, feel free to. I'm gonna start cutting back on the subreds I'm subscribed to and I've never been big into RPGs to begin with so joining another sub-red and one dedicated to RPGs is a bit of a waste for me. If anyone gives you a hard time about the cross post, feel free to quote this message.

3

u/theantidrug May 23 '19

This is a great and heartwarming story. I'm learning programming right now myself, and I know how exhilarating those lightbulb moments can be, so it's awesome hearing about other similar breakthroughs.

18

u/METEOS_IS_BACK May 23 '19

12

u/chemsed May 23 '19

It's the same OP, but not the same sub, so it's a cross-post.

3

u/METEOS_IS_BACK May 23 '19

Yeah I noticed after I looked up the title haha /r/LearnPython represent!!

12

u/[deleted] May 23 '19

[removed] — view removed comment

7

u/Fywq May 23 '19

Yeah same here; knew I had read it before. But fair point this is another sub and OP is the same as the other one.

1

u/j0holo May 24 '19

This has been posted before. Like months ago, but maybe on a different sub?

1

u/TorroesPrime May 26 '19

maybe in the sub I specifically mention in the 2nd sentence where I said I posted it previously? I donno, shot in the dark.

2

u/vcz00 May 23 '19

Awesome post ! Great teaching for sure

2

u/seven_leaves May 23 '19

I'm beginning to learn and this just made me react the same way your student did. Being able to connect something you have a passion for to the learning process is an incredible thing. Thank you for being awesome!

2

u/S4L4MANDER May 23 '19

You sir is an awesome teacher. You should be really proud of what you did

2

u/lukavwolf May 23 '19

This just helped me so much.

2

u/eIImcxc May 23 '19

"So the variable, Dice_Roll is added to the variable modifiers.. and that's compared to the needed roll. If the needed_roll is higher... you fail... otherwise... you pass." She parses out, once more thinking and speaking at the same time.

Is it not the opposite? ''If the needed_roll is higher... you pass... otherwise... you fail''.

Nice story though!

3

u/Knoggelvi May 23 '19

Nope. Dice_roll is her roll. Needed_roll is the target so dice_roll+mods must be equal or better. For example, you need to roll a 12 to hit. You roll a 11 but have a +2 sword. So dice_roll+mods is equal to 13. So you would pass.

On another note, some game systems do use the "lower is better" method. I think original AD&D did that with AC

1

u/mxzf May 24 '19

I think that AD&D used "lower is better" for everything, while 2e changed to "higher is better" for skill checks and kept "lower is better" for AC (as THAC0).

By 3e they just went with straight "higher is better" for all the player rolls.

2

u/LXMNSYC May 23 '19

https://warrior.js.org/

Here is a very similar concept

2

u/first_byte May 24 '19

This is much more elaborate version of what we did in elementary school arithmetic. “So let’s say you have 8 cookies and I eat 5 of them. How many cookies do you have left?”.

I give you kudos for recognizing the opportunity and running with it.

2

u/georggee14 May 24 '19

Man, that's an awesome story!

By the way, it happends to me, I think the programming is hard; Because when I tried to learn it, I just study concepts, concepts and more concepts. Without a real life (or something that is familiar to me) example.

5

u/codeSm0ke May 23 '19

Funny. You got my attention with this.

But, if you need gamification to teach an "if", maybe you are not targeting the proper audience.

A+ for the creative approach.

0

u/[deleted] May 23 '19

Isnt this a repost?

4

u/TorroesPrime May 23 '19

as stated in the second line of the post.

2

u/[deleted] May 23 '19

Yeah im an idiot my bad

4

u/sternone_2 May 24 '19

Very sad that simple logical steps that a 4-year-old should be able to grasp are apparently impossible for juniors.

This is going to be fun when these guys are going to have to compete in the real world.

4

u/SilkTouchm May 23 '19
== True

1

u/[deleted] May 23 '19

My man.

3

u/Zapsy May 24 '19

This is fake as shit.

0

u/JeamBim May 24 '19

Has this become a meme? I am 100% positive that this is not the first time I've seen this post. I started to read it ,and then just kind of skimmed because I remembered the exact beats, and was right. This is not the first time this was posted, but last time I saw it was several months ago.

0

u/TorroesPrime May 24 '19

well, I did kind of note that it was re-post in the 2nd sentence of this post. I guess that was something that wasn't in the start of it. If you'd like I can provide links to the original posting.

2

u/JeamBim May 24 '19

You made it seem like someone JUST asked you to repost it.

I get the feeling this is your magic ticket to sweet sweet imaginary internet points for years to come.

2

u/TorroesPrime May 24 '19

I'd be lying if you said you were wrong on that second point. It has garnered about 2k in karma for me.

but the particular message that prompted me to post in this particular reddit came in this past teusday. I don't know if you can see when I joined this particular reddit, but it was earlier today. About 1pm est.

1

u/bringbackradarto4077 May 23 '19

I need someone to do this for me I love DnD and am majoring in cybersecurity and I have no idea what I'm doing

1

u/CafeRoaster May 23 '19
  1. I hope you continue to be in teaching / leadership roles. You're great at it!

  2. I need to learn to play D&D.

1

u/Hobodaklown May 23 '19

I wish you were my tutor in school. I cannot give you what you gave your student, so instead please enjoy this silver.

1

u/anxieusefilledoree May 23 '19

I think this is the third time I see this post, but I still smile every time I read it.

1

u/ajharwood127 May 23 '19

Holy hell! That's awesome. I wish there was some sort of resource (like a course book) like this. Going to school and started into Software Engineering, and stuff like this would definitely help.

1

u/[deleted] May 23 '19

Not everyone learns the same. Stop expecting people to always be able to follow the groups method for learning.

1

u/Kaa_The_Snake May 24 '19

I love teaching and mentoring for just this reason. For example, teaching total computer newbies that File Explorer was just filing cabinets in the computer. I love that 'aHA!' feeling, both when it happens to me and when I can help someone else get it :)

1

u/Techmesomecoolstuff May 24 '19

This is so great!

1

u/ReasonablyBadass May 24 '19

My school introduction course began with explainng hexadecimals.

Like, without context.

Obviously people quickly lost interest.

Your students are lucky.

1

u/justahalfling May 24 '19

good for her! my uni also used a gamified platform to teach us programming but i still couldnt understand anything ... TT

1

u/[deleted] May 24 '19

Incredible!

I’m still VERY green to programming, but your example just made while loops that much more easier to understand!

Honestly, I’m gonna start seeing how I can play with many programming concepts like this. This is really fun.

1

u/edassabella May 24 '19

Sounds similar to what I've been using with my son:

https://codecombat.com/

1

u/DennisTheDogTrainer May 24 '19

I’m going to start school in the fall for IT programming and am saving this, I play DnD weekly and this was so simple to understand. Thank you!

1

u/Zahhibb May 24 '19

I actually teared up a bit, thank you OP for taking the time and energy to help teaching those who have it slightly harder to learn. I know I appreciated those teachers that did that for me.

1

u/MardiosOz May 24 '19

There needs to be more people like you in this world

1

u/Brakendz May 24 '19

Man this was really cool and it actually help me understand it alot better, you should make videos teaching programming base on RPG examples

1

u/phantaso0s May 24 '19

That's awesome. It can be applied to a lot of teaching actually. What I get from that is: relate to what the student like and understand, if you can.

Thanks for this post.

1

u/arotek May 24 '19

I do the same thing when showing people how to program, I try and gauge their interests and base the logic in the code around it!

They are familiar with how it SHOULD work, so it’s easier for them to work it out

1

u/NikolaiiBlade May 24 '19

Excellent job. I commend you for showing dedication to your students. She will not forget, and will look back fondly on that moment.

1

u/DrinkTeaAsap May 24 '19

Thank you for being a good teacher! Many gives up on the student when they really just need another explanation to make it click : )

1

u/[deleted] May 24 '19

I got unreasonably emotional reading that. More power to you.

1

u/[deleted] May 24 '19

Real programmers would have used THAC0.

1

u/kirmaster May 24 '19

Not just RPG's, but thanks to Richard Garfield a lot of programming knowledge is achievable if you've played Magic the Gathering before. The stack works well, like a stack, there's an inheritance hierarchy, the verbiage is extremely specific so that in most cases rules questions can be answered by reading the rules carefully.

1

u/[deleted] May 24 '19

I saw your post back then. Glad that you are still around.

1

u/addk May 24 '19

I wish I have started my journey with a tutor like you.. Here, have my like Sir!

1

u/maheeky May 24 '19

O CAPTAIN! MY CAPTAIN!

1

u/puppy_girl May 24 '19

i just started java 3 weeks ago and just yestersay i was looking into random things and i found a guide about java and a video game i like.

i didnt start reading it yet and was saving it for tomorrow

http://forum.ragezone.com/f428/tut-basic-java-maplestory-based-772428/

1

u/Moonpile May 24 '19 edited May 24 '19

I'm a little late to the party on this, but I've said this before and I will say it again another time I'm sure. I owe my entire career as a software developer to role playing games. From Atari basic in the 80s to what I'm doing now, every technology I've tried to learn I eventually tried to make some sort of character generator or other role playing game tool. I always have something in mind that I want to do with the new technology that helps me learn it.

1

u/[deleted] Jun 19 '19

Well fuck, you just changed someones life, you probably dont even realize it but if she keeps up programming then holy shit.

0

u/catelemnis May 23 '19

you repost this a lot huh?

2

u/JeamBim May 24 '19

Yeah why does he continue to repost this? He says in his post that someone asked him to repost it as if it happened like 20 minutes ago, but I last saw this last year.

2

u/catelemnis May 24 '19

I went through his history and it’s in there twice in a row at one point lol. Probably just karma farming with it because it was a popular post before. Got him gold and silver again this time too

1

u/JeamBim May 24 '19

I know, and it's not even that good of a post. Fairly obvious it didn't even happen, the writing is a little to YA novel

1

u/exploding_cat_wizard May 24 '19

You mean you never actually taught anything before, and thus find this unbelievable?

-3

u/TorroesPrime May 24 '19

YA novel?

1

u/lannisterstark May 24 '19

I swear to god I've read this post somewhere, can't seem to figure out where.

1

u/JeamBim May 24 '19

Try on Reddit. This guy has posted this several times now

0

u/arm1997 May 24 '19

Torres.prime ♥

-4

u/TragDaddy May 23 '19

Weird how someone else posted this before and you have a word for word exact experience

4

u/TorroesPrime May 23 '19

even odder since I said it is a repost... in the second sentence of the post.

0

u/[deleted] May 24 '19

[deleted]

3

u/TorroesPrime May 24 '19

I mean if you would prefer I can go back to my appointment notes and go item by item so I can spell out the first 30 minutes of the appointment. The appointments do get recorded.The identifying details would have to be redacted of course. Can't provide personally identifying information on the student or school and I can't provide date or time stamps.

0

u/[deleted] May 24 '19

[deleted]

2

u/TorroesPrime May 24 '19

the appointments get recorded and saved for 36 months. I can just go back and review the recording.

0

u/[deleted] May 24 '19

[deleted]

1

u/TorroesPrime May 25 '19

to be honest, I didn't 'teach' it, so much as present it. The already knew the concepts, she just didn't know them as what was presented in the book.

0

u/[deleted] May 24 '19

[deleted]

2

u/mxzf May 24 '19

To be fair, dropping a character ('s') isn't particular hard to accidentally screw up. That by itself isn't particularly damning.

-1

u/[deleted] May 23 '19 edited May 23 '19

[removed] — view removed comment

2

u/TorroesPrime May 23 '19

read the second sentence of the post.

-5

u/[deleted] May 23 '19 edited Sep 27 '26

[removed] — view removed comment

4

u/TorroesPrime May 23 '19

as stated in the second line of the post.