"In the world ye shall have tribulation: but be of good cheer; I have overcome the world." –John 16:33

San Pedro Garza Garcia

How to teach computer programming to kids (Part 6) C++, Python, and browsing the web with a dumb phone

Day 612 of 1000

This is the sixth in a series of posts on how we taught our children to program, what we did wrong and how we think we could have done better.  You can see the introductory post and index to the series by clicking here.

[Previous post]
[Next post]

C++ Primer PlusPart four of this series describes how Christian studied C# during the first half of the homeschool year when he was 11. Part five describes several computer software projects he performed during the second half of that same year.  At that point, he had gotten to know quite a lot about the build process (compiling and linking).  He could do some procedural programming in C# with a fairly top level understanding of object oriented programming.  He could program pretty well in PHP and use Drupal to build a good website.  He had modified a pretty sophisticated C program to run on a new platform.

All that he accomplished was great, but he had such a strong interest in the topic, it was pretty shameful I had let him do virtually all of this on his own with almost no tutoring from me.  So the next year, when he was 12, I decided I would help him learn C++ so that he could learn more about pointers and garbage collection as well as get a deeper understanding of object oriented programming.  We did something similar with C++ as what we did with C#.  Christian began to work his way through the book for about fifteen or twenty minutes per day.

We set up Christian’s computer with the Unbuntu Linux, the Qt libraries, and Qt Creator as an IDE.  I should him how to work in that environment and he got started.  I sat down with him more than previously, but more of my time explaining concepts and performing code reviews would have helped the process a great deal.  After two or three months, we decided he needed a project.  He decided he wanted to be able to be able to send commands from his SMS phone.  It was not a smart phone, just a phone that could make calls and send and receive SMS and MMS messages.

He created a gmail account just to pass messages between his cell phone and his Linux computer running as a server at home.  When he wanted to do something on his computer from his phone, he would send an SMS message to the gmail account.  The Linux computer continually looked for message on the gmail account.  When it received a message, it interpreted it, ran the command on the Linux computer and sent the message back to the phone via SMS message.  He got his program up and running fairly well about half way through the school year.  About then, he was getting a little bored because he had finished this project and moved further up the curve with respect to object oriented programming and the lower level aspects of C++ programming.  He was not great at it, but was no longer a beginner.

I knew we needed to do something to maintain his interest because we had started to bog down.  He had the idea that he would like to figure out a way to use his SMS/MMS phone (not a smart phone) to browse the internet.  He found some Python libraries that would make this task easier, so he asked if he could switch to Python for awhile.  I thought that was a great idea.  Again, the thing that keeps him engaged is a project he really wants to make work.  Python is an object oriented language that would serve to continue solidification of his object oreinted programming skills.  At this point, for reasons mostly having to do with work and the kids other homeschool subject matter, I disengaged from my teaching efforts with respect to program.

Over the rest of the year, Christian was able to get a fairly amazing program up and running on his Linux server.  It did the following:

  • An SMS/MMS phone sends an SMS message that holds a URL for a specific web page to a specific gmail account.
  • Christian’s Python program running on a Linux server (at home) continually checks for emails arriving at the specific gmail account.
  • If an arriving message holds the URL of a web page, the following sequence is performed by the Python program:
    •  A web browser is opened to the web page specified by the URL.
    • A screenshot of the web page is captured and saved as a jpeg image.
    • Numbers for the links are added to the image.
    • The image is transmitted back to the calling phone as an MMS message.
  • When the phone receives the image of the web page back, the user can send back the number of a link on the page and the Linux program will transmit that web page back to the phone as an image.
  • If the user selects an input field by selecting its number from the web page image and adds some text after the number, the phone will enter the input text into the input field.  That is how he could enter the username and password to check his email accounts and/or enter restricted web sites.

Again, the first part of the year was a little bit tedious for Christian until he got to the point where he could do a project that interested him.  He came way up the programming curve specifically because of that.  He was not a great programmer by the end of the year, but he was pretty good for a 12 year old and had two great little programs and some cool stuff to show his friends to show for it.

Previous

Why not skip high school? (Addendum 1) Starting college by age 12 (not us)

Next

Weight a minute

3 Comments

  1. Gene Conrad

    Great project! Have either of you played with the Raspberry PI computers?

  2. Dad

    Thanks, Gene. Yes. Also with BeagleBoards and Arduinos. They are all awesome!

  3. John williams

    Found your blog. Its really nice on C++ programming. Its a great tutorial for the beginners. Really liked it. Thank you for all the information.

Leave a Reply

Your email address will not be published. Required fields are marked *

Powered by WordPress & Theme by Anders Norén