Skip to main content

Learning to Program, Learning to Think

Visalia Direct: Virtual Valley
August 2, 2010 Deadline
September Issue

Learning to Program, Learning to Think

Several times a month I create or modify computer code, but I use the skills I have gained from programming on a daily basis. The more I learn about computer languages and programming, the more I learn to think creatively to solve problems.

Our schools are asked to prepare students for standardized tests, primarily on English and math skills. We frequently claim we want students to learn creative problem solving, but we test memorized knowledge. State and national tests focus on knowing such things as the meanings of words and how to solve math problems with memorized equations. I don’t question the value of memorizing Latin and Greek roots or the quadratic equation, but teaching how to think is essential to the future.

Computer programming requires analyzing a problem, breaking a possible solution into small parts and then writing the code to perform the steps required by the solution. Rarely is there one solution to a problem. Even the best solution depends on specific situations.

When I teach programming and Web design, I find students are perplexed that there can be more than one “best” solution. This is a business problem as much as a technical problem, which forces students to demonstrate the ability to think beyond memorized algorithms. Sometimes a program must be ready on deadline, so the speed of development is more valuable than the elegance of the solution. In other instances, a program will have to calculate and display results as quickly as possible, so development time and cost is secondary to final execution speed.

Programming, then, is about situational analysis. Life is also about situational analysis, however much we might crave “right vs. wrong” and single best solutions to problems.

Teaching programming does not have to mean teaching an advanced computer language such as Microsoft’s C#, Apple’s Objective-C or Sun’s Java. These are great final destinations for aspiring programmers, but far beyond what is needed to solve common problems.

Most of the coding I do falls under the categories of “scripts” and “macros,” not full-fledged applications. I enhance my personal efficiency with brief bits of code.

During the 1980s, what made Lotus 1-2-3 the most popular spreadsheet and WordPerfect the leading word processor was not their ease of use. These were complex, often annoying, applications that required cheat sheets and keyboard templates to fully exploit their features. What made these applications special was their ability to execute “macros,” allowing the automation of complex tasks.

The term “macro” in computer science describes a collection of functions expressed as a single “user-defined” function.

The success of Microsoft Office has been linked to the existence of Visual Basic for Applications (VBA) macro language in Word, Excel, Access, and almost every other Microsoft business application. Office 2007 and 2010 for Windows include extensive VBA support. Arguably, one of the dumbest choices Microsoft made recently was shipping Office 2008 for Mac without VBA macros — a decision Microsoft promises to reverse later this year.

I use a Word VBA macro I coded named “Problem Words.” This macro searches student papers for words and phrases to avoid in academic papers. The macro also creates a report for students on the readability and grade level of a submitted assignment.

The macros I create are listed on a menu and on a toolbar as icons. The “Problem Words” macro appears as a single function, while executing dozens of functions. Best of all, I don’t need to recall the exact steps when I grade a paper: the macro ensures I search for the same problems in every student paper. Like most teachers, I would rather focus on the quality of ideas in a paper than the basic mechanics, but students should be reminded of English rules and academic style. My macro frees me to grade ideas, not grammar.

I teach my students how to create and modify macros in Excel and Word. For many of my students, this is their first experience with computer programming. By the end of each semester, most students have customized Office applications with a dozen or so macros.

In some ways, Apple has taken the macro concept much further than Microsoft. The AppleScript language is available throughout the OS X operating system. AppleScript programming is supported by Apple applications and by thousands of other applications, including Microsoft Office and Adobe Creative Suite. I have AppleScript versions of my favorite Word and Excel VBA macros.

If writing computer code is daunting, Apple also provides Automator, an application that allows you to create scripts without having to master AppleScript. I use Automator to convert and resize graphic images for Web pages. This allows me to process a “batch” of hundreds of pictures without having to edit them individually.

Any time I am going to be dealing with the same problem several times, I ask myself if creating a macro is reasonable. I save hours of time each month with macros and scripts. Each one began as the solution to a problem. Over time, my macros have been improved and expanded to perform their tasks more effectively.

Once students learn to code macros, many ask me about “serious” programming. Usually the students want to learn how games and phone “apps” are created. I’m pleased to report that several of my students have pursued their interest in coding, realizing anyone with an interest can program.

We need to encourage all students to view computer programming as a useful skill, not as a field limited to math wizards and technology fanatics. You don’t need to be a computer scientist to make computers do what you want.

Microsoft Office and Visual Basic for Applications

There are many good books on VBA for Excel. Users with complex spreadsheets tend to benefit more from macros than other computer users. I suggest the following books, listed from beginning skills to advanced:

1. Excel VBA Programming for Dummies by John Walkenbach
2. Excel 2010 Power Programming with VBA by John Walkenbach, part of the series “Mr. Spreadsheet’s Bookshelf”
3. Mastering VBA for Office 2010 by Richard Mansfield

For Word users, I suggest Word 2007 Macros & VBA Made Easy by Guy Hart-Davis. The macros explained work in Word 2010 without any problems.

Advanced Programming

If you want to learn applications programming, both Apple and Microsoft distribute tools for free. Both companies require registering to download the free programming languages and tools from their sites.

Apple Developer Central:

Microsoft Express Programming:


Popular posts from this blog

What I Studied in Graduate School

Lower case ‘a’ from Adobe Caslon Pro, superposed onto some guides. (Photo credit: Wikipedia) Asked to summarize my research projects...

Curiously, beyond the theses and dissertation, all my work is in economics of media and narrative. I ask what works and why when offering stories to audiences. What connects with an audience and can we model what audiences want from narratives? (Yes, you can model data on narratives and what "sells" and what wins awards and what nobody wants.)

Yet, my degree research projects all relate to design of writing spaces, as knowing what works is also key to knowing what could be "sold" to users.

MA: How poor LMS UI/UX design creates online spaces that hinder the writing process and teacher mentoring of students.

Also: The cost of LMS design and compliance with legal mandates for usability.

Ph.D: The experiences of special needs students in online settings, from commercial spaces to games to learning spaces and which spaces are best desig…

Comic Sans Is (Generally) Lousy: Letters and Reading Challenges

Specimen of the typeface Comic Sans. (Photo credit: Wikipedia) Personally, I support everyone being able to type and read in whatever typefaces individuals prefer. If you like Comic Sans, then change the font while you type or read online content. If you like Helvetica, use that.

The digital world is not print. You can change typefaces. You can change their sizes. You can change colors. There is no reason to argue over what you use to type or to read as long as I can use typefaces that I like.

Now, as a design researcher? I'll tell you that type matters a lot to both the biological act of reading and the psychological act of constructing meaning. Statistically, there are "better" and "worse" type for conveying messages. There are also typefaces that are more legible and more readable. Sometimes, legibility does not help readability, either, as a type with overly distinct letters (legibility) can hinder word shapes and decoding (readability).

One of the co…

MarsEdit and Blogging

MarsEdit (Photo credit: Wikipedia) Mailing posts to blogs, a practice I adopted in 2005, allows a blogger like me to store copies of draft posts within email. If Blogger, WordPress, or the blogging platform of the moment crashes or for some other reason eats my posts, at least I have the original drafts of most entries. I find having such a nicely organized archive convenient — much easier than remembering to archive posts from Blogger or WordPress to my computer.

With this post, I am testing MarsEdit from Red Sweater Software based on recent reviews, including an overview on 9to5Mac.

Composing posts an email offers a fast way to prepare draft blogs, but the email does not always work well if you want to include basic formatting, images, and links to online resources. Submitting to Blogger via Apple Mail often produced complex HTML with unnecessary font and paragraph formatting styles. Problems with rich text led me to convert blog entries to plaintext in Apple Mail and then format th…