Ivan Drucker’s BASIC to Python

January 18th, 2016 9:41 AM
by
Filed under Musings;
Comments Off on Ivan Drucker’s BASIC to Python

Ivan Drucker is an unsung hero of the Apple II community. His line of programming utilities, networking tools, and Raspberry Pi applications might pigeonhole him as a software savant, but his contributions to the Apple II community extend across multiple media, including KansasFest presentations and Juiced.GS cover stories.

It’s no surprise, then, that someone so prolific would be comfortable in many programming languages. His latest contribution to the community is a Python translation of an Applesoft BASIC program:

This is a line-for-line conversion of an edited version of CLOCK.PATCH from the System Tools 2 disk in GS/OS 6.0.1. It’s not good Python, but I thought it would be an interesting exercise. In general I have tried replicate each line as closely to BASIC as possible.

For those of us who never learned a programming language that doesn’t have line numbers, this Rosetta stone of classic and modern languages is fascinating. Since each translation performs the same function, seeing how similar concepts are expressed in different environments makes it easy for someone unversed in one language to follow the other.

Applesoft & Python

I don’t know the practical value of this exercise, but that’s what makes Ivan so great: he pursues goals he’s passionate about because he finds them cool and fun. That’s the epitome of the retrocomputing enthusiast.

A world without BASIC

June 27th, 2011 10:16 AM
by
Filed under Musings, Software showcase;
6 comments.

The computers that Apple II users grew up with were nowhere near as user-friendly as today’s machines. They had unintuitive interfaces, inscrutable error messages, and limited capabilities.

But those same limitations also made them an excellent tool for learning such important concepts as problem-solving, game design, and especially programming.

The Apple II was especially practical for that last function, as it came with BASIC in ROM. Without any other software, a user could turn on her machine and start building a virtual world of her own design. The lack of advanced features meant that the user was playing in a sandbox of conceivable limits yet infinite possibilities.

Yet by 1997, when I started college as a computer science major, I was getting laughed out of the classroom by using BASIC where other students were relying on Java and C++, as I related in Juiced.GS. Today, BASIC is almost nowhere to be found, as detailed in the leading item on Computerworld.com last Thursday "How are students learning programming in a post-Basic world?"

The story is an interesting look at the variety of languages with which to introduce modern students to programming. For some parents and teachers, the old methods work best; "My son’s math textbooks contained exercises in Basic, but we could not do the problems until we bought an old Commodore 64 online,” said David Brin, author of "Why Johnny Can’t Code". Others prefer more popular scripting languages, such as Python; still others use a language designed more for educational than practical use, such as MIT’s Scratch, the language of choice of the computer science teacher where I used to teach. She’s offering a camp this summer to introduce 13- and 14-year-olds to programming, using a different format from last year’s camp: "I changed the language from Alice to Scratch. Alice was too glitchy for me. Scratch is easy to pick up, and hopefully will be fun for middle schoolers."

But none of these languages will offer the same experience as learning BASIC. Author Lamont Wood had once dabbled in BASIC programming but had fallen out of practice until his recent experiment with Python:

The thrill was not the same as in 1979; it hadn’t taken months to get the hardware to work, and it sure ran quieter … with Basic, I felt like I was rummaging through a small box containing a few crude tools. With Python, I felt I had pushed open the door to a massive but unlit tool warehouse and was darting in to grab the few that I could see.

I learned BASIC by doing: I was running a Warp Six BBS and needed to make modifications. Eventually, I was inspired to write my own door game, though since it was a port, I had to concern myself only with the coding, not the design. In either case, I always had either the code or design to work with; I never had to conceive and build entirely from scratch (no pun intended).

My challenge in adapting those BASIC programming skills to a modern environment is not so much choosing a language as it is choosing an instruction method. Just as I learned BASIC to run a BBS, I’ve set a goal of learning PHP to help me run WordPress, a modern equivalent of an online community. But elementary concepts such as functions and arrays seem more confusing than they did twenty years ago.

What’s the best computer and language to teach programming — and where does one go from there?