views:

327

answers:

9

As a follow-up to my previous question, what sort of information should I make sure to include in a tutorial book and what should I avoid? In other words, what would you have liked to have known when first starting with Python or wxPython?

Right now I am just planning on restructing the tutorials I have already created and other editing tasks. But I want to make sure that I cover topics that are important for a beginning programmer while eliminating fluff and "too advanced" topics. Space is not an issue since it will be an ebook.

+3  A: 

I have always wanted sections and notes on how not to do something or how not to use a feature. These will go a long way in my opinion in producing better programmers. Often we think we are being clever when the truth is in fact the opposite :)

edit I should add that to me, becoming an expert is about finding out all the possible pitfalls. This is why I find sections on what not to do (pitfalls) valuable.

freespace
A: 
alexmac
A: 

I don't know python so maybe I'm your perfect test subject..

What I would like to know first is

  • how to use variables and show me the different basic types that are available (if any)
  • (all the kinds of) loops
  • (all the kinds of) decision statements
  • and how to do a simple output to the screen

with those basic things that are found in every language, you then can relate it to other programming languages you already know, so you have something to compare against. That's the best way, for me, to get a quick grasp of how things are done in a new language.

After that you can start with the language specific things like static/dynamic typed, libraries, lazy evaulation, whatever it has to offer ...

Those 'more advanced' parts can then be easily tested by the reader as they already knew the basics of the language from the first part.

Sven
+1  A: 

The book should include small programs that the reader will build while learning the basic concepts, like conditional, loops, etc. of Python (and any other programming language). For an example, to create a simple temperature-conversion console application, one will use simple input output code to get user input and show the computation, and an 'if' statement to select which computation based on user's input. In that way, they will see how the concepts are applied to create the simple program.

Include in your tutorial instructions to create practical applications, like music database, etc. You may create something like Practical Common Lisp.

Update: Hmm, you can test how good your tutorial is by letting those who has no experience in programming to try it and ask for their feedback, then improve your tutorial based from their feedback.

OnesimusUnbound
+1  A: 

For Python, you could have a section about interpreted vs compiled languages, and how to create a Windows .exe from the Python code. If I can't create a Windows .exe, I'm probably not going to bother learning the language (unless it's for the web).

How typing works in Python is probably a good topic. If the tutorial is for complete newbies, you don't have to go too deep, but you could include a section on how it differs from other languages like PHP or Java (for programmers of those languages).

Functions, objects and classes is a must, of course. Explain what self means, and why it has to be included in method signatures (and not function signatures or method calls).

I wish someone would have taught me about the map, reduce and filter built-in functions combined with lambda functions, to avoid a lot of for loops. Maybe this is advanced, I don't know.

Christian Davén
A: 

The biggest thing may be to provide the mindset of the language, rather than just how to use an api or language feature. In my VIM tutorial, I spent the first part of it explaining how the thing works in general, like how the command pattern works and how it's intended for editing, not just inserting (like notepad). Things like this make the tutorial more valuable. If I was starting in Python, I would want to know how to understand python's core abstractions and how to access help, and make help accessible from my code. I'd want to understand how a python programmer approaches a programming problem, not just how to make something work.

Given the mindset, you can then talk about pythonic v. nonpythonic answers for various problems. It might be best to show the wrong (BASIC-like or java-esque) way first, then the pythonic way. This can help to highlight the natural beauty of the language.

Don't be too afraid to launch into the really useful bits (iterators, generators, cool libraries) in the first half of the book. I think it's good to learn the stuff people actually learn first. I could see picking up a program, categorizing the features used, and then teaching them in a rational order. That would be a good guide. I might just do that as a writing exercise.

But that's basically it. Help them learn the mindset, and enough of the language and library to be able to start reading code and using the help and interactive prompt to explore new territory.

This would be useful, indeed.

And let me know if you want a little help.

Tim Ottinger
A: 

I would add a section specifically on Fermi Questions and order-of-magnitude guesstimation in general. Nothing, nothing, is more useful than learning how to take a seemingly large problem and divide it into workable sub-problems.

imho, every course on programming ought to include Lawrence Weinstein's Guesstimation.

pookleblinky
A: 

Basic examples, and a lot of them.

Present a small problem, outline a short (but good) logical solution in text, and then give a code sample for implementing the solution. After the code sample, break the code down line by line and explain in detail what's happening. This gives the reader a good idea of what the code is trying to do, a convenient code sample to copy and try on their own, and an in-depth explanation for any lines they are unsure of.

theprise
A: 

Spot the mistake/s.

Slightly vague answer here but I'm a beginner. I've noticed that the things I remember most occur when I need to check where I did something wrong. Meaning the example code I've copied from the book doesn't work.

I then have to use the debugger (or not), and carry out simple steps that I didn't realise I had assimilated: such as looking at correct syntax, brackets, commas, name spaces (ASP only I think), etc.

Some things I would like to see more of if possible:

  • Simple/complex examples
  • Explain WHY the program needs this bit of code: to return customer details, save details, tell the application that everything's okay and it can move on to the next step.
  • Explain WHAT the outcome will be by coding like this/that.
  • Explain WHAT would happen if you didn't do this part of the coding: no information would be kept/passed on,
  • And FINALLY "here's the Example text and can you see the simple/hard mistakes included that you should be able to correct by looking back over the last chapter/page/etc".
Mike