Learning To Program Abstractions

Monday, July 22, 2013

Last week Pluralsight published the 2nd course in my Learning to Program series. It is “Learning To Program - Part 2: Abstractions”, and the course focuses on some of the topics I had to unlearn to learn.

Unlearn to Learn?

unlearnWhen I started learning to program Basic and assembly languages on a TI-99 4/A, I  had no idea what computer programming was about and very few people who I could ask for help. Most of my time was spent trying to understand the syntax of the languages and putting together the right sequence of characters to make something work. I never gave a thought to algorithms, design, or code aesthetics, as the primary motivator was to color pixels on the screen and play musical notes.

I do remember being stumped trying to generate a random number using assembly language instructions. How do you get a giant calculator to produce an accidental value? This question led to hours of metaphysical thinking by a teenage boy. The whole idea of randomness with electronics never did click for me till Douglas Adams wrote about putting an atomic vector plotter inside a Brownian Motion producer.

University mostly reinforced the idea that computer programming was all about technical knowledge. So did every job interview I ever had.

It’s easy to be a software developer and not see the forest for the trees. It took me a long time to change my focus.

How This Course Is Different

In this course I wanted to give students a different perspective on programming than the one I started with by deemphasizing low level technical details and language syntax as much as possible. Instead I wanted to emphasize how to think about software decomposition and composition from the start, so a student would have some idea about the forest they live in. That’s one reason I chose Python as the programming language for this course.

python

Python is a beautiful, clutter free language that runs nearly everywhere. You can focus on design after learning just a few keywords and symbols. Python is also easy to work with. The REPL can provide instant feedback on both the syntax and the behavior of code.

In the course I cover everything from how to use the REPL to the different data structures available with Python. I also show how to break a program into functions and how to use a class definitions to create objects.

I talk about object oriented programming but I never talk about inheritance and polymorphism. Instead, I talk about building abstractions. Functions are abstractions, and objects are abstractions, too. When I was a student I would think that a hash table would be a perfectly reasonable abstraction for a shopping cart. I want today’s students to know the hash table can be an implementation detail and something you can encapsulate into a better abstraction for a shopping cart.

This course is about the single responsibility principle and the mantra of “design for use, not reuse”, although those words are never spoken verbatim. Knowing Big-O notation and how to work with pointers is incredibly important to build software correctly. But, I think those concepts receive too much of the spotlight in programming introductions, leaving many to believe, like I did, that you should solve every problem using lists of strings and numbers.

I hope everyone who watches enjoys the course and starts off with a better perspective on how to build software.


Comments
gravatar Sachin Monday, July 22, 2013
Very nice. How many courses have you planned in this series?
gravatar Scott Tuesday, July 23, 2013
@Sachin: About 4 more for right now.
gravatar Sirwan Afifi Wednesday, July 24, 2013
very nice, thanks a lot.
gravatar Christian Scott Tuesday, July 30, 2013
One of my personal favorites at bash.org (http://bash.org/?400459): Sonium: someone speak python here? lucky: HHHHHSSSSSHSSS lucky: SSSSS Sonium: the programming language ;)
Comments are now closed.
by K. Scott Allen K.Scott Allen
My Pluralsight Courses
The Podcast!