Tagged: programming

Put Code Snippets in a WordPress Blog

I’ve installed WP-Syntax, a great plugin for WordPress that lets you add code snippets to your blog posts without losing all the formatting.

You can use all manner of languages and even include line numbers if you want. Here’s a snippet from one of my math worksheet makers written in Perl:

use List::Util shuffle;    # Use the Shuffle module
# define and populate the arrays
my @girlsnames = ('Erin','Anna','Joanne','Sally', 'Mary');    
my @boysnames = ('Adam','Ken','Tom','Paul','David', 'Sam'); 
@girlsnames = shuffle @girlsnames;    # shuffle the girls' array
@boysnames = shuffle @boysnames;    # shuffle the boys' array
$name1 = pop(@boysnames);    # assign last name in array to $name1;
$name2 = pop(@girlsnames);    # assign last name in array to $name2;

Programming and English teaching

When I was about nine, my parents bought me a Commodore 16 home computer, the little brother to the hugely successful Commodore 64. This was to be a turning point in my life as I started computer programming, which eventually led to me a degree in Computer Science.

While I was never really mathematical, I loved problem solving, particularly when I could create the problems I would have to solve. I find figuring out how to fix a bug or get something working in my programs extremely satisfying.

Computer languages offer endless possibilities for creation, but are limited in rules and ‘vocabulary’ which in my opinion makes them relatively easy to learn. Spoken languages are of course, much harder. Japanese for example, despite its strict and simple grammar, is a terribly daunting language with its thousands of Chinese characters. English on the other hand, is riddled with exceptions to the plethora of grammar rules, which makes it hard to learn even with its comparatively small alphabet.

So how do you go about teaching Japanese children a language as complex as English, when they really don’t have any desire or need to learn it. Like a video game, they’d rather play it than program it, right? Well, not if you make the ‘programming’ fun and rewarding.

When in the classroom, don’t just play games to test the kids’ memories; play games that involve problem solving. For example, if you’re doing a spelling race, let them race to search through their books to find the right spelling. If you’re teaching a function such as “How do I get to the toy store?”, write it on the board as “How do I ____ to the toy _____?” and let the kids find the missing words in their books. Alternatively, with something simple like “I want a (hamburger)”, they can experiment with substituting ‘hamburger’ for other words they can find in their books or on posters. My young kids love to use silly Japanese words like unchi (“poop”) in their sentences, but I’m not too bothered if they run around screaming “I want an unchi” because the are using and understanding the function I’m teaching.

Like computer programming, with problem-solving activities your students can have fun finding out for themselves the knowledge they need to win the ‘game’.