Home > Programming > From Dance Captain to Coding Genius

From Dance Captain to Coding Genius


[ Photo of Jennifer by Kunjan ]

Gen-Y’s are smart people, but unfortunately for them, their parents and teachers thought it was a good idea to shelter them from all of life’s difficulties… including the frustration of solving problems. It doesn’t help that these children were showered with empty praise growing up for mediocre ‘achievements,’ which took no effort, to boost their self-esteem. When everyone gets a trophy, the result is children who’s confidence is only exceeded by their incompetence. In this sense, former president Bush may just be the first of the Gen-Y’s (though he’s way too old). For more detail, read Narcissistic and Entitled to Everything! Does Gen Y Have Too Much Self-Esteem?

This is the story of how I helped Jennifer start to develop problem solving skills at 22 years old, by teaching her a little about programming. If you’re a programmer reading this, you’ll probably be tempted to laugh and call her stupid, but understand this — Jennifer is a smart girl. She graduated high school with a 4.0 GPA. Problem solving, however, is a different kind of skill which takes a lot of time and hard work to develop. Unfortunately, her education failed to teach this. Fortunately, it’s never too late.

Naturally, we started with a simple 1-line Hello World. I opened up the Python console and typed:

>>> print “Hello World!”

Hello World!

I handed it over to her, and she diligently typed the same thing. Success! We’re off to a stellar start. Next, I showed her to write a function which adds two numbers together. (Everything after the # on the line is a comment for non-programmers, explaining what that line does.)

>>> def addNums(a, b):  # define a function addNums which takes arguments a and b

print a+b          # add a and b together and print the result to the console

>>> addNums(3, 5)        # call the addNums function with numbers 3 and 5

8                                    # the result printed by addNums with numbers 3 and 5 as input

She followed by writing one that subtracts two numbers.

>>> def subNums(a, b):

print a-b

>>> subNums(9, 6)

3

So far so good. Now, I showed her this example:

>>> define foo(a, b):           # define a function named foo which takes numbers a and b

print “First number:”, a, “  Second number:”, b, “  Sum:”, a+b

>>> foo(3, 5)    # call the function foo with numbers 3 and 5

First number: 3   Second number: 5   Sum: 8    # the result printed by function foo

Now, I asked her to write a function (named print_name_age) which does this:

>>> print_name_age(“Jennifer”, 22)

Jennifer is 22 years old.

Now this was hard. She protested, “I’m tired, I need to go bed. I have class in the morning.” She wasn’t tired a second ago… “I don’t know what to do. You never showed me how to do this. You’re mean!” I had shown her how to add numbers, print numbers, print text, and write a function. I left the examples open so she could look back at them. She had all the tools she needed. All that remained was to combine them in the right order to solve the problem.

She looked back at me with her puppy-dog eyes and repeatedly asked, “What do I do??” I told her she wasn’t allowed to ask me any questions. She should think out-loud, and I would ask her questions to help her along when she got stuck. She tried for about 20 seconds and got frustrated, angry, and even lashed out at me, to which I responded, “If you want to give up and go to bed, that’s totally fine. I won’t think any less of you. Don’t do this for me. Only stay if you want to.” She thought for a second, and decided to stay.

This was a turning point. She was no longer doing this to please me or to look smart — she now wanted to learn for the sake of learning. That’s  a symptom of a  growth mindset (read How To Be Smart for more detail). Now she had a chance. As she toiled, she still repeatedly asked me “Is this right?” to which I would give the thoroughly unsatisfying response “I don’t know, try it.” I watched her slowly conquer her phobia of the “enter” key to test her code, bravely risking the prospect of a terrifying error message, which killed her spirits instantly. I patiently encouraged, “Code never works the first time. If something I write works the first time, I’m shocked, and I’ve been doing this for 10 years. Keep trying.” She was still very frustrated and struggled with concepts I thought she had already mastered. For example, defining a function and calling it. She would define a function, and then be disappointed that nothing happened, even though she hadn’t called it yet. It was clear, she hadn’t actually understood a thing she wrote earlier. She had just copied my code. In school, this approach works without fail, and that’s exactly the problem.

Still, slowly but surely I began to notice that she wasn’t looking back at me for guidance nearly as often (she can’t read my poker face), and I was starting to see lights come on in her brain as she referred back to the examples and tried to pick them apart. For whatever reason, she asked for paper, which I supplied because at least it meant she was finally problem solving. My patience was strained, but I didn’t let her see that. I watched quietly. About 10-15 minutes later, behold the glorious code that Jennifer wrote with no help from me:

>>> def print_name_age(a, b):

print a, “is”, b, “years old.”

>>> print_name_age(“Tony”, 21)

Tony is 21 years old.

At first she was a little embarrassed that it took her so long to write something that would take me 2 seconds, but I was truly proud of her, and I told her so. We rejoiced in the epic victory. I say that with no sarcasm. There is no greater feeling in the world, than solving a tough problem that caused you massive frustration. Every coder in the world knows this and experiences it on a regular basis. I’m glad I could finally share that with Jennifer. There was no more sour Jennifer. She had a big smile on her face and joy in her heart.

True confidence comes from overcoming challenges, not empty praise.

I would love to hear, your thoughts in the comments. Do you think your education did an adequate job of teaching problem solving skills? How often were you praised as a kid? Was it unconditional or did you have to earn it?

Tony Programming

  1. May 1st, 2009 at 18:22 | #1

    the thing is she got it herself, for someone with NO coding background
    thats amazing… This is how they should teach programming, and thats how I learned it. Unfortunately the first programming course is “Intro to C or C++ or (gasp) Basic” and not “Introduction to Programming”. There is a subtle difference between the two.

  2. Ian
    May 1st, 2009 at 20:08 | #2

    excellent job tony. i think just as hard as it is to finally grasp the skill of problem solving is the skill of learning patience and how to teach, which it seems you did quite effectively. I must say I think you’ve come a long way from high school when you thought you were smarter and better than everyone and thus no one deserved to be graced with your presence, to now, you’ve developed patience with us peons. Thanks for the laugh on top of it for the night.

    Cheers

  3. May 3rd, 2009 at 11:46 | #3

    See, this is why I’ve never coded before. I understand the concepts, and I *know* that I understand the concepts… I cannot imagine sitting through the mind-numbingly boring intro to programing class, while everyone around me gets really good at memorizing the functions. Maybe coding is eventually taught correctly- maybe coding is even eventually taught correctly to girls, but I can tell you I certainly never got that far. I got so sick of every teacher TREATING me like a blond moron, that I never actually made it to the classes that would’ve challenged me and kept my interest. The same thing is true to a degree for every science and math I took except physics (thank you Mr. Holloway).
    Gender stereotyping in my early education is to some degree an issue too, I think. Jennifer figured it out because you trusted her intellect enough to let her figure it out in the same way you had- but when teachers don’t give you the benefit of the doubt on the first day of school and assume you aren’t an inherently logical and math/science-y type (which they don’t, if you’re a blond girl with her heads stuck in the clouds), they will always stunt your growth and assume you need to be taught the dumb-downed version.
    The dumb-downed version of anything will never give anyone a real foundation. I always zoned off in class by accident and then got stressed… by the time I asked for help the teacher always assumed I was a moron and gave me the shortcut version.
    But after all, we have our whole education system setup around the concept of passing a test… can we really be shocked that it’s bad? Life isn’t a test, it’s one giant problem.
    Why in college should there be any penalty for repeating classes? Why do we care how long it takes our students to learn, as long as they learn? I just don’t understand… why is the system setup this way when it clearly doesn’t make any sense?

  4. May 3rd, 2009 at 11:47 | #4

    HEAD stuck in the clouds, not heads.
    I should proof-read comments before hitting submit!

  5. Christine
    May 11th, 2009 at 14:26 | #5

    I feel this lack of true problem solving skills is one of the most frustrating and prevalent problems in our education system. It is especially frustrating to see how with even just one decent time investment so much progress can be made, yet no one had ever even tried before.

    Also, I don’t know if it is simply because of gender prejudices among teachers, as Christie suggests, but for some reason this does seem to be a much larger problem among intelligent females than intelligent males. I wonder if it has anything to do with what parents expect from their children as well. For instance, I think there can be more pressure for females to get good grades than males since boys are often excused by the “boys will be boys” phenomenon, making it perfectly acceptable for them to excel in sports instead of in school. While this might seem to have the opposite effect, I think this can make girls more results-driven and more likely to focus on completing assignments (which most would agree are not problem-solving oriented) instead of learning the material/exploring the world around them. I also think fathers may be less likely to joke around with daughters/use sarcasm when speaking with them; both of which I believe help to develop a more critical mindset, where you not only must listen to authoritative figures but process and analyze what they said and decide for yourself if it makes sense based on your past experiences with them. Whatever the cause of the general problem, and the intensity of it among females, I think nothing is being done to correct the problem by our education standards.

  6. May 11th, 2009 at 15:50 | #6

    @Christie @Christine — Despite the title, I hadn’t even thought about this in terms of gender differences. I agree that the problem is probably more wide-spread in girls, but a large part of guys are also affected. The reason I think girls are more susceptible is that girls are more likely to be praised for things they didn’t earn, like looks. This leads to a tendency to think that merit is innate and out of our control. In other words, a fixed mindset.

  7. May 13th, 2009 at 05:33 | #7

    I have not just started developing problem solving skills at the age of 22 and you know this. This was an opportunity for me to try something new and get out of my box. This was achieved. I do not understand these gender differences expressed as I never have felt that my intelligence or motivationon was in question by teachers growing up.

    I am glad you had the opportunity to teach me some programming, although I believe I am not a textbook example for Gen Ys. I do not believe this experience was written about correctly.

  1. No trackbacks yet.