SiKing

programming

Computer Programming for Complete Beginners

I initially created this course for my 14-year-old son. However, this does not mean that if you are not close to that age (either way), then it is not for you – there is a double negative (with a negative condition 😛 ) there: everyone is welcome. 🙂 After some recent publicity I am encouraged (see comments below) to enhance and expand the information here.

This course is intended to take someone completely new to (preferably with a healthy curiosity in) computers, and show them what a programmer does. The course aims to quickly (several months) move away from tools that have been dumbed down for beginners up to professional level tools, while keeping the subject itself interesting especially for younger audience. By the end of the course the student will have been introduced to tools that are used by professional developers, as well as giving them an idea of what a professional developer is faced with as part of their daily work.

If you would like to know what makes me qualified to speak on this subject feel free to browse my blog and my resume, and decide for yourself.

The student should have a dedicated computer, preferably a laptop with a wireless card and a CD drive, which will be completely reinstalled – all existing data will be lost – as part of the first lesson. It is not necessary that this be a brand new computer; it is acceptable, in fact preferred, that it be an older used computer. If you do not wish to reinstall the machine there are alternatives, but your work might be a little more cumbersome.

All software will be provided, and it will all be FOSS. I have tested everything under Linux Mint 5 (same as Ubuntu 8.04 LTS – Long Term Support), Linux Mint 7 (same as Ubuntu 9.04), and Edubuntu 9.10 (same as latest Ubuntu). Having said that, there is no reason that this course could not be attempted under any operating system that has a Python port.

Lesson 1: installing your computer

As was already mentioned the course can be attempted with any operating system, even Windows or OS X. However, an alternate choice at this point might make it difficult for the instructor to help you if you run into problems.

  • The student will be provided with install media and each should go through a guided install (starts at 47:10) of their machine.
  • Explore the system: taskbar, menus, network manager applet, connect to a network via wired or wireless.
  • Explore basic software: Internet browser (Firefox), word processor (OpenOffice.org), mail client (Thunderbird / Evolution).
  • Administering your system: system updates, finding and installing new software (Synaptic, apt-get).

At the end of this lesson, the student should know:

  • What is the taskbar and what is it showing you.
  • How can you tell if you have network connectivity. How do you fix it if you don’t.
  • How to find applications in the menus.
  • How to install new software and update existing software.

Homework:

Bring a game (or other application) to the next lesson that you installed and present it to others in class.

Lesson 2: programming basics

  • Get familiar with the file browser: Nautilus.
  • First several lessons of this course are based on the LiveWires course. Download the “worksheets” and the “package”. Extract both.
  • Find the README file in the package and read through it. There is a lot of information some of which might not make sense at this point – that is OK. The important stuff is under the “INSTALLATION” section.
    • You should already have Python on your system.
    • You will need to find and install tkinter from Synaptic.
    • You do not need pygame at this point; there is no harm in installing it.
  • Once the test in section “Checking it works”[sic] in the README file passes, start on the LiveWires worksheet 1.

At the end of this lesson, the student should know:

  • Navigating, finding things, organizing things in the filesystem.
  • Extracting “tarballs” (the .zip or .tgz files).
  • Concepts covered in worksheet 1: variables, errors.

Homework:

Complete worksheet 1. Bring questions for next time.

Lesson 3: basic IDE

IDE stands for Integrated Development Environment.

IDEs are designed to maximize programmer productivity by providing tightly-knit components with similar user interfaces. This should mean that the programmer has much less mode switching to do than when using discrete development programs. However, because an IDE is by its very nature a complicated piece of software, this high productivity only occurs after a lengthy learning process.[Wikipedia.org]

  • Install idle. This is a very basic IDE written in python.
  • Go through LiveWires worksheet 2. If you are struggling with IDLE, then here is some documentation.

At the end of this lesson, the student should know:

  • What is an IDE.
  • What help does it provide to a developer. (hints: syntax highlighting, command completion, source navigation)
  • Concepts covered in worksheet 2: basic input and output, branching, looping.

Homework:

Complete worksheet 2. Bring questions for next time.

Lesson 4: more programming basics

  • Go through LiveWires worksheet 3.

At the end of this lesson, the student should know:

  • Concepts covered in worksheet 3: functions.
  • Feel reasonably comfortable with everything that has been covered so far.

Homework:

Complete worksheet 3.

Lesson 5: professional IDE

At this point we are going to start using a professional IDE and in next lessons will continue to pick up additional tools. In the open-source world the IDE of choice is Eclipse.

Eclipse is an open source community, whose projects are focused on building an open development platform comprised of extensible frameworks, tools and runtimes for building, deploying and managing software across the lifecycle.[Eclipse.org]

Lesson 5 alone will probably take you as much as the four previous combined!

  • Install and update Eclipse + pydev. Don’t worry about Subclipse, for now.
  • The difference between development in IDLE and development in Eclipse, is like the difference between riding a bike and driving a car: in the begging give yourself plenty of room to get comfortable with it before taking it out on the road. The Eclipse.org site has several video tutorials on getting started; you can avoid/ignore everything that is Java-specific.
  • After you have gone through a few tutorials, see if you can import your previous programs into Eclipse and run them from within Eclipse.
  • Go through LiveWires worksheet 4.

At the end of this lesson, the student should know:

  • How to switch between views in Eclipse.
  • How to reset a view in Eclipse.
  • How to start a new project in Eclipse.
  • How to run a program in Eclipse.

Homework:

Remove IDLE (not the programs you created) from your computer. Complete worksheet 4. Bring questions.

Lesson 6: software repository

Once developers have a tool to create software with, they need a place to store keep their creation. If you are a single developer working by yourself, this is usually quite easy. However, once you become part of a team and you get clients with different versions of your software, managing the software somewhere on a disk quickly becomes a nightmare. What you need is a source code management tool.

  • Read up on SCM to get a feel for what it does. We will be using Subversion. You do not need to read the whole book (probably ever); quick look through the first two chapters should do. You can definitely skip anything that talks about setting up a server, and only concentrate on the client side.
  • Install subclipse if you have not already done so.
  • Open an account on SourceForge if you do not already have one. We will create a project for the class that you will connect to. Create a module for each student within that project.
  • Go through LiveWires worksheet 5. Expect this one to take a while – take your time.
  • Each time you have a significant piece done, and it compiles with no errors and does what it is suppose to, commit it to the repository.

At the end of this lesson, the student should know:

  • What does software version control system do for developers?
  • Basic concepts of software version control: sandbox, checkin, checkout, update, branch, head.
  • As you develop this program, you will run into issues. You should be trying to solve the issues using your IDE: debugging, watches, breakpoints.
  • Concepts covered in worksheet 5: objects, manipulating lists.

Homework:

Continue to work on Robots! from worksheet 5. You will need this finished for the next lesson.

Lesson 7: porting and tracking

One of the things that developers are faced with, is that the world around them continues to develop. New versions of software they depend on will continue to be released, or software may become completely obsolete and they need to rework their program for the next generation of some software. Also new customers may require that their software run on different configurations. This involves porting.

A second consideration, especially when building software in a team, is the importance of planning. Developers are given tasks that generally come from two sources: fix bugs and add new features. All these tasks are kept in some sort of a tracking system. A good tracking system will have a different interface for a developer, who is looking for items he is suppose to work on; a tester, who inputs new bugs into the system; and a manager, who is interested in seeing how the project is progressing. SourceForge uses Trac.

  • Install screenlets. Read the what and the how of screenlets. Play around with them. Have a look through the source (in /usr/share/screenlets).
  • Install python-doc and have a look at what is in the python documentation. (/usr/share/doc/python2.5-doc/html/index.html).
  • Get familiar with some of the basics of Trac.
  • Create the first Feature Request: “Port your Robots! to screenlets”. Break that down into smaller tasks, again in Trac, and start working on the individual tasks.

At the end of this lesson, the student should know:

  • The importance of modularizing your code.
  • Tracking, prioritizing, and breaking down your work.

Homework:

See if you can improve the Robots! graphics. See if you can add some of the enhancements mentioned at the end of the Robots! worksheet.

Lesson X: under construction

  • APT / deb
  • ant
  • autobuilds at SourceForge
  • Doxygen
  • unit tests
  • upgrades

Where to go next?

Advertisements

11 Comments »

  1. I have reported earlier that there were some problems with the livewires library and python 2.6. I had a closer look at this and I can no longer reproduce the problem – it appears to work just fine.

    Comment by siking — January 3, 2010 @ 5:31 pm | Reply

  2. This looks like the perfect starting course to learn Python.
    I’m glad that you decided to share with us all.
    Thanks

    Comment by chicagonpg — December 25, 2009 @ 2:16 am | Reply

  3. Hey siking,

    Been following the linuxmint podcasts for some time and the last episode you were the guest. Good to hear about some grub stuffs and other things. On this python thing I’ve been self learning myself hoping to somehow be familiar with the language for my own use. I’m mid 40 have 2 kids but i’m away from them. I left them with linux laptops hoping one day they get familiar with it. I bought a book i heard from python 411 podcast and i’m reading/studying it in my free time. But free time is kind of hard to get these days, especially having a full time day job. I dont quite get it about this course in your blog i mean are you teaching it or someone else? Anyway nice to write you. Hi to Charles and Rothgar. Will be following you in your coming shows.

    eri

    Comment by eri mendz — December 15, 2009 @ 8:25 am | Reply

    • This is a course that I am currently teaching to my son, one-on-one. As I (might have) mentioned, my son is homeschooled and I suspect there are others out there, probably even in my town. Over the next week(s) I plan on expanding/enhancing this outline/syllabus. If there is enough interest (locally) I might put together a club of a sorts that kids (or anyone) could attend to learn this.

      Comment by siking — December 15, 2009 @ 8:55 am | Reply

  4. Hi SiKing

    I’ve found this page through the mintCast podcast. I’m really interested in following this course.
    I’m not totally new to programing. I took a two year course about programing, but it was quite theoretical on not much hands on. Many concepts are familiar to me (arrays, functions, types, variables…), database design (with ms access, isn’t it sad!!), SQL… But as I said it was mostly theory, and it was 10 years ago!! After that I went straight into my second degree (in theology – good combination).
    I’ve been thinking about doing something again to refresh what I did back then and this sounds good, even targeted at linux not windows.
    I don’t mind repeating things, so where do I start?

    Cheers,
    Daniel

    PS: By the way, I’m planning on doing the course on a virtual machine with VirtualBox. I don’t have a second computer and I don’t want to mess or wipe out my main system.

    Comment by Daniel — December 15, 2009 @ 5:17 am | Reply

    • Come back mid-next-week, I should have more info here.
      Everything you do in this course should 1) not in any way hurt your machine or the OS (so you do not need to bother with VirtualBox just for the sake of this course), and 2) can be attempted on any OS: Linux, Windows, OSX, Solaris, FreeBSD, whatever; here is a complete list: http://www.python.org/download/other/ :). I am targeting this specifically for Linux, and there will be small parts that will run only on Linux – for example: Lesson 7 uses “screenlets”, which AFIK will not run on Windows and possibly not on OSX. For those parts I will make a mention in the outline, and will suggest alternatives if I can come up with something.

      Comment by siking — December 15, 2009 @ 9:06 am | Reply

      • Will keep an eye of your site. Keep it up 🙂

        Comment by eri mendz — December 15, 2009 @ 9:17 am | Reply

      • Thanks Siking

        I’m waiting anxious for everything to be ready

        Comment by Daniel — December 30, 2009 @ 6:53 am | Reply

        • What I have above up to lesson 7 is it. The stuff under “lesson X” is just some plans that I have for future lessons. I think in the new year I am going to offer the first 5 lessons in a series of 10×2 hour (in person) lessons. Will see how that goes.

          Comment by siking — December 30, 2009 @ 12:44 pm | Reply

  5. I am so happy to find this site. I have been looking for online tutorials to teach myself and my home schooled grandsons programming. I am a 55 year old grandmother who took an early retirement due to my health. I have been trying to learn computer programming in the hope that I may yet have marketable skills and potentially work from home. My grandsons are very interested in writing programs for games. I purchased my first computer in 1996 and it was loaded with Windows 95. That computer quickly became obsolete and I didn’t get another until o6. I bought a used Dell which had Windows XP. This was a real upgrade from my old Packard Bell. As I worked with my Dell I became increasingly frustrated with the way my computer performed when on the internet. I began to browse around and I eventually came across the Linux/Ubuntu website. I felt that a lot of my problems were due to the Windows OS and I was intrigued to learn there was a really nice Operating System that was developed completely by volunteers, was freely shared code and all and would afford me a great learning experience. I carefully read and reread the tutorials and the forum posts and eventually got up the courage to give it a try. I downloaded the iso file, checked the hash and burned the image onto a CD. I knew none of this before and I must say that for me this was very exciting. A real confidence builder and confidence was exactly what I needed to go to the next step. The time had come to insert the disk, partition the hard drive and install Ubuntu. I knew that if I made a mistake I would probably have ruined the only computer I owned and I couldn’t afford to replace it. Still I desperately wanted to install Ubuntu and so when I got to the place in the installation where it said this step cannot be undone, I turned my head and pushed enter and we were off on a new adventure. I know to you this may sound silly but for me it was a triumph! Here I am a gal who quit high school in my junior year, a 55 year old grandmother, and I have successfully dual booted my Dell. Since then my son bought me a Compaq Laptop which did have Vista, but it now has Linux Mint and Ubuntu along KDE and Ubuntu Studio. I guess I got a little carried away with the choices.

    At any rate I digress. What I really wanted to say is I love Linux and the community that works so hard to bring it to us. I can’t imagine learning these things with Windows. I could never have afforded this kind of learning opportunity. Linux is uplifting. It doesn’t dumb down the programs but instead it invites you into the wonderful world of computer technology. I wish they would get a good P.R. Program going. Linux takes the fear out of computers and demystifies them. I realize I have a long way to go, but I figure I can do this step by step. That is what Linux has done for me and if I can learn to program I will have the opportunity to give back.
    So thank you so much for this and I will keep you posted on our progress.

    Respectfully,
    Robin

    Comment by Robin — December 13, 2009 @ 9:18 pm | Reply

    • WOW. Thank you for such a long and honest comment. 🙂
      My son just started lesson 7; it has taken him like a year to get this far. 😮 But we are doing a little more around this than what it says above. I will be taking the time to update/expand this over the next few weeks. Hope you come back, and I hope you enjoy yourself.

      Comment by siking — December 14, 2009 @ 8:54 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: