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: http://developer.apple.com/

Microsoft Express Programming: http://www.microsoft.com/express/


Comments

Popular posts from this blog

Practical Technology Skills

This blog is a revision to a column I wrote for Direct Media publications. Normally, I wouldn't repost something I wrote for hire, and I certainly don't wish to anger one of my publishers. However, since this blog is primarily accessed by one of my graduate seminars, I think the publisher will appreciate that I am extending my thoughts for educational purposes. I'm also more than willing to encourage businesses to visit the Direct Media home page . Page numbers seemed to be a half-inch lower on each successive page. I stared at the mid-term paper, handed in to me by a junior at the university, and thought back to my fights with dot-matrix printers. When I was an undergrad, my Epson FX/80 printer jammed often and would sometimes rip pages after the sprockets slipped out of alignment with the punched holes of the perforated paper. Surely the undergraduate author of this paper suffered the curse of a similarly possessed printer, I told myself. “I guess when I changed the ma...

Pursuing a University Degree Online

Visalia Direct: Virtual Valley February 2008 Issue January 7, 2008 Pursuing a University Degree Online When a star high school student graduates in Tulare County, the difficult reality is that he or she most likely will leave to attend a four-year university. For an eighteen-year-old student, leaving the Central Valley, or at least Tulare County, is part of the educational experience. But, after returning to Visalia some of us find out that our undergraduate educations are not quite enough. For those in education, Fresno State, Fresno Pacific University, Chapman University, and others have offered courses in Visalia for a number of years. This makes it possible to work and still complete a teaching credential or an advanced education-related degree. I have been thankful for the options we have in the Central Valley. But, as others have learned, if you are interested in some fields you must commute to Fresno — or even further. With the drive to Fresno taking just under an hour...

Robots for Home: Not Yet the Jetsons

NXT Robot (Photo credit: Wikipedia ) Visalia Direct: Virtual Valley November  3, 2014 Deadline December 2014 Issue Robots for Home: Not Yet the Jetsons Rosie the robot maintained the Jetson household more than 50 years ago. To the disappoint of many of us who still enjoy the classic 1960s cartoon, Rosie remains science fiction. The only robots in our houses are round bumper cars that vacuum floors. The iRobot Roomba offers no witty banter and no sighs of exasperation. Growing up, I expected Twiki, the android that followed Buck Rogers about for no apparent reason, to become a reality. After all, Twiki didn’t do anything except carry a much smarter talking computer about his neck. Sadly, Rogers was stuck in the twenty-fifth century. All the good androids and robots seem to be way off in the future or in other galaxies. Although we have no Rosie, robots are on the rise. They build our cars, deliver medications, defuse bombs, explore planets and even perform surgeries. M...