Developer tutorials/0

From OLPC
Jump to: navigation, search


Pencil.png NOTE: The contents of this page are not set in stone, and are subject to change!

This page is a draft in active flux ...
Please leave suggestions on the talk page.

Pencil.png

Before starting these tutorials, I'd suggest going through and making sure you have a basic background in these things, since it'll make all our lives much easier. I'm trying to make these tutorials so that someone who's never seen a computer before (but has access to one now) could go through them, even without access to an XO.

Computer/internet experience

You should be able to...

  • Turn on a computer
  • Use a mouse or touchpad
  • Type (it doesn't have to be fast)
  • Log into the computer
  • Find files on your computer
  • Copy, move, and rename files
  • Start and shut down a program (any program)
  • Connect to the internet
  • Open a web browser and go to a web page if the address is given to you - for instance, http://wiki.laptop.org - and to click on a link to go to a new page
  • Put a CD, SD card, and/or USB thumbdrive into a computer and access the files on it
  • Log out of the computer
  • Shut down the computer

How to learn

You'll need to have access to a physical computer to do these things; the best way to learn these skills is probably to have somebody show you, and then try to work through the list yourself. It will probably take 1-3 hours to get comfortable with this.

Programming experience

We don't assume a lot of programming experience - if you've ever coded anything before, you'll probably be okay.

You should be able to...

  • Describe, in your own words,
    • what a computer program is.
    • what debugging is, and some strategies you might use while you're debugging.
    • what a function and a function argument (or argument) are, and what we usually mean by a function returning a value, in terms of computer programming. (Bonus: What do we usually mean by an object in computer programming? A class?)
    • what the words if, else, for, not, and while usually mean in a computer program.
    • what integers, strings, and lists are in computer-programming talk.
  • Write a program that prints the words "Hello world!" on the screen. (Alternatively, any program that produces visible/audible output.)
  • Write a program that asks you to type your name, then greets you with "Hello!" and the name that you typed. (Alternatively, any program that accepts and responds to user input.)
  • Guess what this code does (the comments should help) - you don't have to understand how it works completely, but you should be at the point where you can ask specific questions about how it works beyond "I don't get it."

How to learn

Since the primary language for OLPC development is Python, I would recommend learning that if you have never programmed before. It's a good first language. See http://python.org and the Python Beginner's Guide for resources on how to learn Python.

Depending on your typing speed and background, it will probably take you between 10-40 hours to learn the things in the list above. You can find nearly all the answers to the questions (and the puzzles) above in this book, which is available for free online.

Linux experience

You should be able to...

  • do all the things in the "use computers" section above, but on a computer running Linux
  • open up a terminal and type commands into it - for instance, try typing "echo hello" (without the quotes) in a terminal, then pressing Enter.
  • describe what your home directory is, what root is in the context of a Linux machine, and

How to learn

If you don't already have access to a computer running Linux, one of the easiest ways to get it is to install Ubuntu. Follow the link there for more resources. The CD you use to install Ubuntu can also be used as a standalone LiveCD for those who have access to a computer but can't install Linux on it (the computer will run Linux as a program within your current operating system, or boot from it and "pretend" to be a Linux computer - it will not change anything on the computer's hard drive). Ubuntu has great help documentation that can teach you the things listed above.

Introduction to Linux is a longer but more detailed guide on how Linux works in general, if you're curious about the inner workings of your macine. Learning the shell is also a more advanced resource for people who want to learn a lot about the terminal. Neither of these are necessary, though - they're just cool and potentially helpful.

A willingness to try the hacker ethos

Asking questions

Sharing knowledge

Trying things you don't know

Things I don't assume

Any other prerequisites will be stated at the beginning of the tutorial that uses them.

  • Any specific programming language (though you will probably be using Python at some point)
  • Any hardware knowledge - beyond the screen, the keyboard, the mouse/touchpad, and the power button, we won't assume you know the names of any of the parts of your computer, what they do, or how they do it. We'll talk about these as they come up.