Best ways to teach a beginner to program? [closed] - python

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
Original Question
I am currently engaged in teaching my brother to program. He is a total beginner, but very smart. (And he actually wants to learn). I've noticed that some of our sessions have gotten bogged down in minor details, and I don't feel I've been very organized. (But the answers to this post have helped a lot.)
What can I do better to teach him effectively? Is there a logical order that I can use to run through concept by concept? Are there complexities I should avoid till later?
The language we are working with is Python, but advice in any language is welcome.
How to Help
If you have good ones please add the following in your answer:
Beginner Exercises and Project Ideas
Resources for teaching beginners
Screencasts / blog posts / free e-books
Print books that are good for beginners
Please describe the resource with a link to it so I can take a look. I want everyone to know that I have definitely been using some of these ideas. Your submissions will be aggregated in this post.
Online Resources for teaching beginners:
A Gentle Introduction to Programming Using Python
How to Think Like a Computer Scientist
Alice: a 3d program for beginners
Scratch (A system to develop programming skills)
How To Design Programs
Structure and Interpretation of Computer Programs
Learn To Program
Robert Read's How To Be a Programmer
Microsoft XNA
Spawning the Next Generation of Hackers
COMP1917 Higher Computing lectures by Richard Buckland (requires iTunes)
Dive into Python
Python Wikibook
Project Euler - sample problems (mostly mathematical)
pygame - an easy python library for creating games
Invent Your Own Computer Games With Python
Foundations of Programming for a next step beyond basics.
Squeak by Example
Snake Wrangling For Kids (It's not just for kids!)
Recommended Print Books for teaching beginners
Accelerated C++
Python Programming for the Absolute Beginner
Code by Charles Petzold
Python Programming: An Introduction to Computer Science 2nd Edition

I've had to work with several beginner (never wrote a line of code) programmers, and I'll be doing an after school workshop with high school students this fall. This is the closest thing I've got to documentation. It's still a work in progress, but I hope it helps.
1) FizzBuzz. Start with command line programs. You can write some fun games, or tools, very quickly, and you learn all of the language features very quickly without having to learn the GUI tools first. These early apps should be simple enough that you won't need to use any real debugging tools to make them work.
If nothing else things like FizzBuzz are good projects. Your first few apps should not have to deal with DBs, file system, configuration, ect. These are concepts which just confuse most people, and when you're just learning the syntax and basic framework features you really don't need more complexity.
Some projects:
Hello World!
Take the year of my birth, and calculate my age (just (now - then) no month corrections). (simple math, input, output)
Ask for a direction(Up, down, left, right), then tell the user their fate (fall in a hole, find a cake, ect). (Boolean logic)
FizzBuzz, but count once every second. (Loops, timers, and more logic)
Depending on their age some really like an app which calls the users a random insult at some interval. (Loops, arrays, timers, and random if you make the interval random)
2) Simple Project Once they have a good grasp of language features, you can start a project(simple, fun games work good.). You should try to have the first project be able to be completed within 6-12 hours. Don't spend time to architect it early. Let them design it even if it sucks. If it falls apart, talk about what happened and why it failed, then pick another topic and start again.
This is where you start introducing the debugging capabilities of your tools. Even if you can see the problem by reading the code you should teach them how to use the tools, and then show them how you could see it. That serves the dual purpose of teaching the debugging tools and teaching how to ID errors without tools.
Once, or if, the project gets functional you can use it to introduce refactoring tools. Its good if you can then expand the project with some simple features which you never planned for. This usually means refactoring and significant debugging, since very few people write even half decent code their first time.
Some projects:
Hangman game
Experimenting with robotics(Vex and Mindstorms are options)
3) Real Project Start a real project which may take some time. Use proper source control, and make a point to have a schedule. Run this project like a real project, if nothing else its good experience having to deal with the tools.
Obviously you need to adjust this for each person. The most important thing I've found is to make even the first simple apps apply to what the person is interested in.
Some projects:
Tetris
Text file based blog engine
More advanced robotics work

You could try using Alice. It's a 3D program designed for use in introductory programming classes.
The two biggest obstacles for new programmers are often:
syntax errors
motivation (writing something meaningful and fun rather than contrived)
Alice uses a drag and drop interface for constructing programs, avoiding the possibility of syntax errors. Alice lets you construct 3D worlds and have your code control (simple) 3D characters and animation, which is usually a lot more interesting than implementing linked lists.
Experienced programmers may look down at Alice as a toy and scoff at dragging and dropping lines of code, but research shows that this approach works.
Disclaimer: I worked on Alice.

I recommend Logo (aka the turtle) to get the basic concepts down. It provides a good sandbox with immediate graphical feedback, and you can demostrate loops, variables, functions, conditionals, etc. This page provides an excellent tutorial.
After Logo, move to Python or Ruby. I recommend Python, as it's based on ABC, which was invented for the purpose of teaching programming.
When teaching programming, I must second EHaskins's suggestion of simple projects and then complex projects. The best way to learn is to start with a definite outcome and a measurable milestone. It keeps the lessons focused, allows the student to build skills and then build on those skills, and gives the student something to show off to friends. Don't underestimate the power of having something to show for one's work.
Theoretically, you can stick with Python, as Python can do almost anything. It's a good vehicle to teach object-oriented programming and (most) algorithms. You can run Python in interactive mode like a command line to get a feel for how it works, or run whole scripts at once. You can run your scripts interpreted on the fly, or compile them into binaries. There are thousands of modules to extend the functionality. You can make a graphical calculator like the one bundled with Windows, or you can make an IRC client, or anything else.
XKCD describes Python's power a little better:
You can move to C# or Java after that, though they don't offer much that Python doesn't already have. The benefit of these is that they use C-style syntax, which many (dare I say most?) languages use. You don't need to worry about memory management yet, but you can get used to having a bit more freedom and less handholding from the language interpreter. Python enforces whitespace and indenting, which is nice most of the time but not always. C# and Java let you manage your own whitespace while remaining strongly-typed.
From there, the standard is C or C++. The freedom in these languages is almost existential. You are now in charge of your own memory management. There is no garbage collection to help you. This is where you teach the really advanced algorithms (like mergesort and quicksort). This is where you learn why "segmentation fault" is a curse word. This is where you download the source code of the Linux kernel and gaze into the Abyss. Start by writing a circular buffer and a stack for string manipulation. Then work your way up.

A good python course is MIT's A Gentle Introduction to Programming Using Python. It's all free online, and you don't have to be an MIT uberstudent to understand it.
Edit [Justin Standard]
This course uses this free online book: How To Think Like a Computer Scientist
I'm definitely finding it quite useful.

Python package VPython -- 3D Programming for Ordinary Mortal (video tutorial).
Code example:
from visual import *
floor = box (pos=(0,0,0), length=4, height=0.5, width=4, color=color.blue)
ball = sphere (pos=(0,4,0), radius=1, color=color.red)
ball.velocity = vector(0,-1,0)
dt = 0.01
while 1:
rate (100)
ball.pos = ball.pos + ball.velocity*dt
if ball.y < ball.radius:
ball.velocity.y = -ball.velocity.y
else:
ball.velocity.y = ball.velocity.y - 9.8*dt
VPython bouncing ball http://vpython.org/bounce.gif

Begin with Turtle graphics in Python.
I would use the turtle graphics which comes standard with Python. It is visual, simple and you could use this environment to introduce many programming concepts like iteration and procedure calls before getting too far into syntax. Consider the following interactive session in python:
>>> from turtle import *
>>> setup()
>>> title("turtle test")
>>> clear()
>>>
>>> #DRAW A SQUARE
>>> down() #pen down
>>> forward(50) #move forward 50 units
>>> right(90) #turn right 90 degrees
>>> forward(50)
>>> right(90)
>>> forward(50)
>>> right(90)
>>> forward(50)
>>>
>>> #INTRODUCE ITERATION TO SIMPLIFY SQUARE CODE
>>> clear()
>>> for i in range(4):
forward(50)
right(90)
>>>
>>> #INTRODUCE PROCEDURES
>>> def square(length):
down()
for i in range(4):
forward(length)
right(90)
>>>
>>> #HAVE STUDENTS PREDICT WHAT THIS WILL DRAW
>>> for i in range(50):
up()
left(90)
forward(25)
square(i)
>>>
>>> #NOW HAVE THE STUDENTS WRITE CODE TO DRAW
>>> #A SQUARE 'TUNNEL' (I.E. CONCENTRIC SQUARES
>>> #GETTING SMALLER AND SMALLER).
>>>
>>> #AFTER THAT, MAKE THE TUNNEL ROTATE BY HAVING
>>> #EACH SUCCESSIVE SQUARE TILTED
In trying to accomplish the last two assignments, they will have many failed attempts, but the failures will be visually interesting and they'll learn quickly as they try to figure out why it didn't draw what they expected.

The key thing is that the person in question needs to have some problem that they want solving. If you don't have a program that you want to write (and something sensible and well-defined, not "I want to write the next Quake!") then you can't learn to program, because you have nothing to motivate you. I mean, you could read a book and have a rough understanding of a language's syntax and semantics, but until you have a program that you want written you'll never grasp the nettle.
If that impetus exists then everything else is just minor details.

I don't know if anyone has mentioned this here, yet, but You might want to check out Zed Shaw's Learn Python the Hard Way
Hope this Helps

http://tryruby.hobix.com/">Try Ruby (In Your Browser)

How to Design Programs
Structure and Interpretation of Computer Programs . Videos lectures at http://www.swiss.ai.mit.edu/classes/6.001/abelson-sussman-lectures/

This is a fantastic book which my little brothers used to learn:
http://pine.fm/LearnToProgram/
Of course, the most important thing is to start on a real, useful program of some kind IMMEDIATELY after finishing the book.

If he's interested, aren't the minor details the good parts? Using python, you've already cut the GUI off of it so that confusion is gone. Why not pick a project, a game or something, and implement it. The classic hi-lo number guessing game can be simply implemented from the command line in 20-30 lines of code (depending on language of course) and gives you variables, conditions, loops, and user input.

I'd just let him write tons of code. Let him drive in everything you guys do, and just be available to answer questions.
Believe it or not, after a few months of writings tons of crappy code, he'll start to get the idea and start writing better programs. At that point, you can get bogged down in details (memory, etc), and also talk about general design principles.
I've heard that what separates the great artists from the mediocre ones, is that every time they practice, they improve on something, no matter how small. Let your brother practice, and he'll improve every time he sits down at the keyboard.
Edit: [Justin Standard]
Esteban, this reminds me of a recent coding horror post, and I do think you are right. But I think its still worthwhile to find methods to guide his practice. No question, I want him writing as much code as he knows how to do. Thats one reason I'm asking for sample projects.

First of all, start out like everyone else does: with a Hello World program. It's simple, and it gives them a basic feel for the layout of a program. Try and remember back to when you were first programming, and how difficult some of the concepts were - start simple.
After Hello World, move on to creating some basic variables, arithmetic, then onto boolean logic and if/else statements. If you've got one of your old programming textbooks, check out some of the early examples and have him run through those. Just don't try to introduce too much all at once, or it will be overwhelming and confusing.

Something you should be very mindful of while teaching your brother to program is for him not to rely too heavily on you. Often when I find myself helping others they will begin to think of me as answer book to all of their questions and instead of experimenting to find an answer they simply ask me. Often the best teacher is experimentation and every time your brother has a question like "What will happen if I add 2 to a string?" you should tell him to try it out and see for himself. Also I have noticed that when I cannot get a concept through to someone, it helps to see some sample code where we can look at each segment individually and explain it piece by piece. As a side note people new to programming often have trouble with the idea of object oriented programming, they will say they understand it when you teach it to them but will not get a clear concept of it until actually implementing it.

I used to teach programming and your brother has one main advantage over most of my students he wants to learn :)
If you decide to go with C a friend has a site that has the sort of programs those of use from older generations remember as basic type-ins. The more complex of them use ncurses which sort of negates their use as a teaching aid somewhat but some of them are tiny little things and you can learn loads without being taught to.
Personally I think Python and Ruby would make great first languages.
EDIT:
list of beginner programming assignments appeared overnight might be just what you are looking for.

It really depends on your brother's learning style. Many people learn faster by getting their hands dirty & just getting into it, crystallising the concepts and the big picture as they progress and build their knowledge.
Me, I prefer to start with the big picture and drill down into the nitty-gritty. The first thing I wanted to know was how it all fits together then all that Object-oriented gobbledygook, then about classes & instances and so-on. I like to know the underlying concepts and a bit of theory before I learn the syntax. I had a bit of an advantage because I wrote some games in BASIC 20 years ago but nothing much since.
Perhaps it is useful to shadow a production process by starting with an overall mission statement, then a plan and/or flowchart, then elaborate into some pseudo code (leaning towards the syntax you will ultimately use) before actually writing the code.
The golden rule here is to suss out your student's leaning style.

If your brother has access to iTunes, he can download video lectures of an introductory computer science course given by Richard Buckland at the University of New South Wales. He's an engaging instructor and covers fundamentals of computing and the C language. If nothing else, tell your brother to play the vids in the background and some concepts might sink in through osmosis. :)
COMP1917 Higher Computing - 2008 Session 1
http://deimos3.apple.com/WebObjects/Core.woa/Browse/unsw.edu.au.1504975442.01504975444
If the link doesn't work, here's a path:
Home -> iTunes U --> Engineering --> COMP1917 Higher Computing - 2008 Session 1

there's a wikibook that is pretty good for learning python.
I don't know how the wikibooks are for other languages, but I personally learned python from the wikibook as it was in Feb 2007
ps - if you're unfamiliar with wikibooks, it's basically the wikipedia version of book authoring. it's sort of hard to describe, but if you check out a few of the books on there you'll see how it works

Python Programming for the absolute beginner
Python Programming for the absolute beginner cover http://safari.oreilly.com/images/1592000738/1592000738_xs.jpg

I think Python is a great idea. I would give him a few basic assignments to do on his own and tell him that any dead ends he hits can probably be resolved by a trip to google. For me, at least, solving a problem on my own always made it stick better than someone telling me the solution.
Some possible projects (in no particular order):
Coin flip simulator. Let the user input a desired number of trials for the coin flipping. Execute it and display the results along with the percentage for heads or tails.
Make a temperature converter with a menu that takes user input to choose which kind of conversion the user wants to do. After choosing the conversion and doing it, it should return to the main menu.
Here's an example of an extended converter with the same idea: http://pastebin.org/6541
Make a program that takes a numeric input and displays the letter grade it would translate to. It'll end up evaluating the input against if and elif statements to find where it fits.
Make a simple quiz that goes through several multiple choice or fill in the blank questions. At the end it will display how the user did. He can pick any questions he wants.
Take an input of some (presumably large) number of pennies and convert it into bigger denominations. For example, 149 pennies = 1 dollar, 1 quarter, 2 dimes, and 4 pennies.
Create a simple list manager. Be able to add/delete lists and add/delete entries in those lists. Here's an example of a christmas list manager: http://pastebin.org/6543
Create a program that will build and then test whether entered numbers form a magic square (with a 2D array). Here's some sample code, but it should really print out the square at each step in order to show where the user is in terms of buliding the square: http://pastebin.org/6544
I would also suggest doing some stuff with xTurtle or another graphics module to mix things up and keep him from getting boring. Of course, this is very much practice programming and not the scripting that a lot of people would really be using python for, but the examples I gave are pretty much directly taken from when I was learning via python and it worked out great for me. Good luck!

Just make it fun !
Amazingly Scala might be the easiest if you try Kojo

If your brother likes puzzles, I would recommend Python Challenge. I wouldn't use it as a formal teaching tool in a 1 on 1 tutorial, but it's something he can do when you're not together to challenge himself and have some fun.

Python Challenge

After going through a few free e-books, I found the best book for learning to program was Head First Programming published by O'Reily Press. It uses Python as the language and gives you programs to work on from the very start. They are all more interesting that 'Hello World'.
It's well worth the money I spent on it, and since it's been out for a bit you may be able to find a cheaper used copy on Ebay or Amazon.

If you want to teach the basics of programming, without being language specific, there is an application called Scratch that was created in MIT. It's designed to help people develop programming skills. As users create Scratch projects, they learn to create conditions, loops, etc. There is a also a community of scratch projects, form which projects can be downloaded - that way you can explore other people's programs and see how they were built.

I think that once he has the basics (variables, loops, etc) down you should try to help him find something specific that he is interested in and help him learn the necessities to make it happen. I know that I am much more inclined and motivated to do something if it's of interest to me. Also, make sure to let him struggle though some of the tougher problems, nothing is more satisfying than the moment you figure it out on your own.

I was taught by learning how to solve problems in a language agnostic way using flowcharts and PDL (Program Design Language). After a couple weeks of that, I learned to convert the PDL I had written to a language. I am glad I learned that way because I have spent the majority of my years programming, solving problems without being tied to a language. What language I use has always been an implementation detail and not part of the design.
Having to solve the problem by breaking it down into it's basic steps is a key skill. I think it is one of the things that separates those that can program from those that can't.
As far as how you tackle the order of concepts of a language I believe the easiest way is to decide that is to have a project in mind and tackle the concepts as they are needed. This lets you apply them as they are needed on something that you are interested in doing. When learning a language it is good to have several simple projects in mind and a few with progressive complexity. Deciding on those will help you map out the concepts that are needed and their order.

I would recommend also watching some screencasts - they are generally created in context of a specific technology not a language, though if there's Python code displayed, that'll do :). The point is - they're created by some good programmers and watching how good programmers program is a good thing. You and your brother could do some peer programming as well, that might be an even better idea. Just don't forget to explain WHY you do something this way and not that way.
I think the best way to learn programming is from good examples and try not to even see the bad ones.

Robert Read wrote a useful guide, How to be a Programmer, which covers a wide area of programming issues that a beginner would find helpful.

Related

Best programming aids for a quadriplegic programmer

Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
Before you jump to conclusions, yes, this is programming related. It covers a situation that comes under the heading of, "There, but for the grace of God, go you or I." This is brand new territory for me so I'm asking for some serious help here.
A young man, Honza Ripa, in a nearby town did the classic Dumb Thing two weeks after graduating from High School -- he dove into shallow water in the Russian River and had a C-4/C-5 break, sometimes called a Swimming Pool break. In a matter of seconds he went from an exceptional golfer and wrestler to a quadriplegic. (Read the story ... all of us should have been so lucky as to have a girlfriend like Brianna.) That was 10 months ago and he has regained only tiny amounts of control of his right index finger and a couple of other hand/foot motions, none of them fine-grained.
His total control of his computer (currently running Win7, but we can change that as needed) is via voice command. Honza's not dumb. He had a 3.7 GPA with AP math and physics.
The Problems:
Since all of his input is via voice command, he is concerned that the predominance of special characters in programming will require vast amount of verbose commands. Does anyone know of any well done voice input system specifically designed for programmers? I'm thinking about something that might be modal--e.g. you say "Python input" and it goes into a macro mode for doing class definitions, etc. Given all of the RSI in programmer-land there's got to be something out there. What OS(es) does it run on?
I am planning on teaching him Python, which is my preferred language for programming and teaching. Are there any applications / whatevers that are written in Python and would be a particularly good match for engaging him mentally while supporting his disability? One of his expressed interests is in stock investing, but that not might be a good starting point for a brand-new programmer.
There are a lot of environments (Flash, JavaScript, etc) that are not particularly friendly to people with accessibility challenges. I vaguely remember (but cannot find) a research project that basically created an overlay system on top of a screen environment and then allowed macro command construction on top of the screen image. If we can get/train this system, we may be able to remove many hurdles to using the net.
I am particularly interested in finding open source Python-based robotics and robotic prostheses projects so that he can simultaneously learn advanced programming concepts while learning to solve some of his own immediate problems.
I've done a ton of googling on this, but I know there are things I'm missing. I'm asking the SO community to step up to the plate here. I know this group has the answers, so let me hear them! Overwhelm me with the opportunities that any of us might have/need to still program after such a life-changing event.
Update: I just registered computingforquads.org and I'll be creating pages for all sorts of solutions to all sorts of problems. Thanks for you help so far and keep those answers coming!
I have sports injuries, and I cannot type more than few characters without serious pain.
Instead, I use emacs together with Dragon NaturallySpeaking.
I have written macros and scripts to help it get by. The system is not perfect, but it works.
I program mostly in C++, but I also use python.
If you want to, I will help you with that.
I have to warn you, it takes few months to get used to speech to text software and train it. moreover, I am not native English speaker, am sure that gets in the way
Do not despair, there are solutions.
here a link to emacs and Dragon files (unfortunately have not documented yet)
http://code.google.com/p/asadchev/source/browse/#svn/trunk/home/Dragon
http://code.google.com/p/asadchev/source/browse/#svn/trunk/emacs/elisp
also, if you need more info, my number is 515 230 9363 (United States, Iowa).
I will be glad to help you if I can
It's worth looking at the Dasher Project, which makes it possible to enter text reasonably quickly even for the severly disabled. Dasher is built on a probabilistic model of languages, so that more likely utterances are easier to enter into the system. The demonstration system comes with a fairly impressive collection of natural languages. It should be easy to get a large corpus of programs written in Python, load Dasher with the corpus, and create a special-purpose version for entering Python programs.
This isn't part of any professional software, but when I saw this, I've thought it would be good for text entry using eye movement tracking or minimal mouse movement. See Ken Perlin's Processing page, and look at the applets for "pen input".
I know someone in a village in India who is a paraplegic, who uses Dragon Speech to Text software to write on her computer. I don't know how well suited it is for a programmer (she is not a programmer), but it's a start.
You might also want to look into Natural Point. It's an eye controlled mouse, which might help Honza
Hope this helps
iPython with completion
On the python side, iPython shows parameters, functions, etc, and has command completion. Perhaps it could also be customized to respond to the various input devices as well?
http://ipython.scipy.org/moin/
One thing that may help (i got it from this question) is http://shorttalk-emacs.sourceforge.net/ . It seems to be an interface between emacs and speech recognition. And regarding languages, i would recommend using Lua over Python. It has a more natural English flow to it.
I know this question is quite old now. I wonder how things are going for Honza with respect to programming. It would be nice to hear back.
For what it's worth, I suffer from RSI and now try to minimize use of the keyboard and especially the mouse.
My own experience of voice recognition is that this stuff DOES work. I use Windows's inbuilt speech recognition software for Windows 7 (WSR). I've also used voice finger (http://voicefinger.cozendey.com/) to help move the mouse pointer. Some key points I would mention are:
Learn the shortcuts. You can do almost anything using shortcuts and speaking them works great using Voice Recognition when in "typing mode" (see below).
Use Typing mode. Unless you are dictating text this is great for speaking short cuts to the computer or for spelling weird words. Interestingly it is not a clearly "advertised" function of WSR.
Phonetic Alphabet. To make good use of typing mode learn the phonetic alphabet: http://en.wikipedia.org/wiki/NATO_phonetic_alphabet You can't realistically get by without this when using any form of speech recognition.
VIM. (or emacs I guess - not sure). Vim is a great for editing text without touching the mouse - ever. This makes it great for editing texts using WSR. I am only a VIM beginner myself but find it incredibly helpful.
Web browsing. In my experience web browsing is still an extremely difficult thing to do without a mouse. There are simply too many situations which require you to hover with the mouse in order to get to the underlying commands. This is a great shame. Nevertheless there are some really good Firefox plugins to help browsing without a mouse.
Mouseless browsing: https://addons.mozilla.org/en-us/firefox/addon/mouseless-browsing/ This is a neat little tool with lots of configuration options for putting numbers next to all links. You can then type these numbers to activate the link
Vimperator: http://vimperator.org/ This goes quite a lot further than mouseless browsing. It basically gives you complete vim like control of firefox. I find this works better than mouseless browsing, but can be annoying in instances where it changes default Firefox behavious.
These are just my own personal experiences. It would be great to hear back about how Honza is getting on.

Python progression path - From apprentice to guru

Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I've been learning, working, and playing with Python for a year and a half now. As a biologist slowly making the turn to bio-informatics, this language has been at the very core of all the major contributions I have made in the lab. I more or less fell in love with the way Python permits me to express beautiful solutions and also with the semantics of the language that allows such a natural flow from thoughts to workable code.
What I would like to know is your answer to a kind of question I have seldom seen in this or other forums. This question seems central to me for anyone on the path to Python improvement but who wonders what his next steps should be.
Let me sum up what I do NOT want to ask first ;)
I don't want to know how to QUICKLY learn Python
Nor do I want to find out the best way to get acquainted with the language
Finally, I don't want to know a 'one trick that does it all' approach.
What I do want to know your opinion about, is:
What are the steps YOU would recommend to a Python journeyman, from apprenticeship to guru status (feel free to stop wherever your expertise dictates it), in order that one IMPROVES CONSTANTLY, becoming a better and better Python coder, one step at a time. Some of the people on SO almost seem worthy of worship for their Python prowess, please enlighten us :)
The kind of answers I would enjoy (but feel free to surprise the readership :P ), is formatted more or less like this:
Read this (eg: python tutorial), pay attention to that kind of details
Code for so manytime/problems/lines of code
Then, read this (eg: this or that book), but this time, pay attention to this
Tackle a few real-life problems
Then, proceed to reading Y.
Be sure to grasp these concepts
Code for X time
Come back to such and such basics or move further to...
(you get the point :)
I really care about knowing your opinion on what exactly one should pay attention to, at various stages, in order to progress CONSTANTLY (with due efforts, of course). If you come from a specific field of expertise, discuss the path you see as appropriate in this field.
EDIT: Thanks to your great input, I'm back on the Python improvement track! I really appreciate!
I thought the process of Python mastery went something like:
Discover list comprehensions
Discover generators
Incorporate map, reduce, filter, iter, range, xrange often into your code
Discover Decorators
Write recursive functions, a lot
Discover itertools and functools
Read Real World Haskell (read free online)
Rewrite all your old Python code with tons of higher order functions, recursion, and whatnot.
Annoy your cubicle mates every time they present you with a Python class. Claim it could be "better" implemented as a dictionary plus some functions. Embrace functional programming.
Rediscover the Strategy pattern and then all those things from imperative code you tried so hard to forget after Haskell.
Find a balance.
One good way to further your Python knowledge is to dig into the source code of the libraries, platforms, and frameworks you use already.
For example if you're building a site on Django, many questions that might stump you can be answered by looking at how Django implements the feature in question.
This way you'll continue to pick up new idioms, coding styles, and Python tricks. (Some will be good and some will be bad.)
And when you see something Pythony that you don't understand in the source, hop over to the #python IRC channel and you'll find plenty of "language lawyers" happy to explain.
An accumulation of these little clarifications over years leads to a much deeper understanding of the language and all of its ins and outs.
Understand (more deeply) Python's data types and their roles with regards to memory mgmt
As some of you in the community are aware, I teach Python courses, the most popular ones being the comprehensive Intro+Intermediate course as well as an "advanced" course which introduces a variety of areas of application development.
Quite often, I get asked a question quite similar to, "Should I take your intro or advanced course? I've already been programming Python for 1-2 years, and I think the intro one is too simple for me so I'd like to jump straight to the advanced... which course would you recommend?"
To answer their question, I probe to see how strong they are in this area -- not that it's really the best way to measure whether they're ready for any advanced course, but to see how well their basic knowledge is of Python's objects and memory model, which is a cause of many Python bugs written by those who are not only beginners but those who have gone beyond that.
To do this, I point them at this simple 2-part quiz question:
Many times, they are able to get the output, but the why is more difficult and much more important of an response... I would weigh the output as 20% of the answer while the "why" gets 80% credit. If they can't get the why, regardless how Python experience they have, I will always steer people to the comprehensive intro+intermediate course because I spend one lecture on objects and memory management to the point where you should be able to answer with the output and the why with sufficient confidence. (Just because you know Python's syntax after 1-2 years doesn't make you ready to move beyond a "beginner" label until you have a much better understanding as far as how Python works under the covers.)
A succeeding inquiry requiring a similar answer is even tougher, e.g.,
Example 3
x = ['foo', [1,2,3], 10.4]
y = list(x) # or x[:]
y[0] = 'fooooooo'
y[1][0] = 4
print x
print y
The next topics I recommend are to understanding reference counting well, learning what "interning" means (but not necessarily using it), learning about shallow and deep copies (as in Example 3 above), and finally, the interrelationships between the various types and constructs in the language, i.e. lists vs. tuples, dicts vs. sets, list comprehensions vs. generator expressions, iterators vs. generators, etc.; however all those other suggestions are another post for another time. Hope this helps in the meantime! :-)
ps. I agree with the other responses for getting more intimate with introspection as well as studying other projects' source code and add a strong "+1" to both suggestions!
pps. Great question BTW. I wish I was smart enough in the beginning to have asked something like this, but that was a long time ago, and now I'm trying to help others with my many years of full-time Python programming!!
Check out Peter Norvig's essay on becoming a master programmer in 10 years: http://norvig.com/21-days.html. I'd wager it holds true for any language.
Understand Introspection
write a dir() equivalent
write a type() equivalent
figure out how to "monkey-patch"
use the dis module to see how various language constructs work
Doing these things will
give you some good theoretical knowledge about how python is implemented
give you some good practical experience in lower-level programming
give you a good intuitive feel for python data structures
def apprentice():
read(diveintopython)
experiment(interpreter)
read(python_tutorial)
experiment(interpreter, modules/files)
watch(pycon)
def master():
refer(python-essential-reference)
refer(PEPs/language reference)
experiment()
read(good_python_code) # Eg. twisted, other libraries
write(basic_library) # reinvent wheel and compare to existing wheels
if have_interesting_ideas:
give_talk(pycon)
def guru():
pass # Not qualified to comment. Fix the GIL perhaps?
I'll give you the simplest and most effective piece of advice I think anybody could give you: code.
You can only be better at using a language (which implies understanding it) by coding. You have to actively enjoy coding, be inspired, ask questions, and find answers by yourself.
Got a an hour to spare? Write code that will reverse a string, and find out the most optimum solution. A free evening? Why not try some web-scraping. Read other peoples code. See how they do things. Ask yourself what you would do.
When I'm bored at my computer, I open my IDE and code-storm. I jot down ideas that sound interesting, and challenging. An URL shortener? Sure, I can do that. Oh, I learnt how to convert numbers from one base to another as a side effect!
This is valid whatever your skill level. You never stop learning. By actively coding in your spare time you will, with little additional effort, come to understand the language, and ultimately, become a guru. You will build up knowledge and reusable code and memorise idioms.
If you're in and using python for science (which it seems you are) part of that will be learning and understanding scientific libraries, for me these would be
numpy
scipy
matplotlib
mayavi/mlab
chaco
Cython
knowing how to use the right libraries and vectorize your code is essential for scientific computing.
I wanted to add that, handling large numeric datasets in common pythonic ways(object oriented approaches, lists, iterators) can be extremely inefficient. In scientific computing, it can be necessary to structure your code in ways that differ drastically from how most conventional python coders approach data.
Google just recently released an online Python class ("class" as in "a course of study").
http://code.google.com/edu/languages/google-python-class/
I know this doesn't answer your full question, but I think it's a great place to start!
Download Twisted and look at the source code. They employ some pretty advanced techniques.
Thoroughly Understand All Data Types and Structures
For every type and structure, write a series of demo programs that exercise every aspect of the type or data structure. If you do this, it might be worthwhile to blog notes on each one... it might be useful to lots of people!
I learned python first by myself over a summer just by doing the tutorial on the python site (sadly, I don't seem to be able to find that anymore, so I can't post a link).
Later, python was taught to me in one of my first year courses at university. In the summer that followed, I practiced with PythonChallenge and with problems from Google Code Jam.
Solving these problems help from an algorithmic perspective as well as from the perspective of learning what Python can do as well as how to manipulate it to get the fullest out of python.
For similar reasons, I have heard that code golf works as well, but i have never tried it for myself.
Learning algorithms/maths/file IO/Pythonic optimisation
This won't get you guru-hood but to start out, try working through the Project Euler problems
The first 50 or so shouldn't tax you if you have decent high-school mathematics and know how to Google. When you solve one you get into the forum where you can look through other people's solutions which will teach you even more. Be decent though and don't post up your solutions as the idea is to encourage people to work it out for themselves.
Forcing yourself to work in Python will be unforgiving if you use brute-force algorithms.
This will teach you how to lay out large datasets in memory and access them efficiently with the fast language features such as dictionaries.
From doing this myself I learnt:
File IO
Algorithms and techniques such as Dynamic Programming
Python data layout
Dictionaries/hashmaps
Lists
Tuples
Various combinations thereof, e.g. dictionaries to lists of tuples
Generators
Recursive functions
Developing Python libraries
Filesystem layout
Reloading them during an interpreter session
And also very importantly
When to give up and use C or C++!
All of this should be relevant to Bioinformatics
Admittedly I didn't learn about the OOP features of Python from that experience.
Have you seen the book "Bioinformatics Programming using Python"? Looks like you're an exact member of its focus group.
You already have a lot of reading material, but if you can handle more, I recommend you
learn about the evolution of python by reading the Python Enhancement Proposals, especially the "Finished" PEPs and the "Deferred, Abandoned, Withdrawn, and Rejected" PEPs.
By seeing how the language has changed, the decisions that were made and their rationales, you will absorb the philosophy of Python and understand how "idiomatic Python" comes about.
http://www.python.org/dev/peps/
Attempt http://challenge.greplin.com/ using Python
Teaching to someone else who is starting to learn Python is always a great way to get your ideas clear and sometimes, I usually get a lot of neat questions from students that have me to re-think conceptual things about Python.
Not precisely what you're asking for, but I think it's good advice.
Learn another language, doesn't matter too much which. Each language has it's own ideas and conventions that you can learn from. Learn about the differences in the languages and more importantly why they're different. Try a purely functional language like Haskell and see some of the benefits (and challenges) of functions free of side-effects. See how you can apply some of the things you learn from other languages to Python.
I recommend starting with something that forces you to explore the expressive power of the syntax. Python allows many different ways of writing the same functionality, but there is often a single most elegant and fastest approach. If you're used to the idioms of other languages, you might never otherwise find or accept these better ways. I spent a weekend trudging through the first 20 or so Project Euler problems and made a simple webapp with Django on Google App Engine. This will only take you from apprentice to novice, maybe, but you can then continue to making somewhat more advanced webapps and solve more advanced Project Euler problems. After a few months I went back and solved the first 20 PE problems from scratch in an hour instead of a weekend.

General questions regarding Python language

I'm a newbie to programming and I've decided to start with Python. Just curious though, is it enough/recommended to learn Python from online tutorials or from books? I want to go further than simple "Hello World!" programs. I'm not sure if books will actually teach you how to make more advanced programs.
One example is Exif-py. How do you even start programming a program like this? Do you just sit down and start writing the code, or do you have to search for APIs or anything? I went through the code briefly and it all looked alien to me.
I'm not really sure how to express my questions into words, so do check back because I'll edit my question if the right words come to me.
Well, I learnt all my Python from online sources (not just tutorials, but reference documentation, blog posts and other texts). It's certainly possible, although some people prefer the "guided" way a book teaches you, particularly people new to programming (at that point I had already been programming for years).
To create a program such as Exif.py, you would first have to know what you must do in broad terms BEFORE starting to program. You would study the EXIF format, then figure out how that is put into the image files, then you would have to formulate that in terms of the language you're using (in this case, Python). This usually requires that you're already familiar with it, otherwise it'll be a fairly slow process.
I'd suggest starting with simpler programs to begin with, or maybe follow a book such as Dive Into Python (free online), seeing as you're new to programming, and need to not only learn the language, but to think like a programmer.
The tutorials are there to teach you the language syntax and the standard library, not really on how to solve a particular programming problem. Think of what you learn there as your toolbox.
I think I understand what you are saying. You want to break above and beyond the simple applications and write your own stuff, right? Well, first you need to figure out what it is you want to make. Then comes the hard part; how are you going to make it? I'd suggest starting by trying to break it down into a number of small simple problems instead of tackling it as one large problem.
If you are trying to find examples of larger projects, I'd suggest looking at the Python Cheeseshop (package index) and download a few packages you've heard of to see how they did it. Also, people often post handy pieces of code on their personal blogs and that shows up on PlanetPython.
If stuff like recursion, modules, classes, iteration, exceptions, dictionaries, are indeed new to you, I suggest How to Think Like a Computer Scientist in Python (lovingly abbreviated as ThinkCSPy in the community ;-).
It is a bit outdated - for best results, use Python 2.6 or lower, but then again 3.0 is not that different.
EDIT: If ThinkCSPy has little to teach you, try Dive Into Python. It's advanced and pretty "real-world", but step-by-step.
If by 'newbie to programming' you mean that you just started it last week or something along the lines, then maybe you might want to give the MIT OpenCourseWare Introduction to Computer Science videos (and homework!) a bit of your time.
The opencourse covers the syntax of the Python language, some helpful hints and general do's and don'ts that apply to any programming paradigm.
Though, if by 'newbie to programming', that you already know the basic concepts you need to start writing basic programs (like adding, subtracting, multiplying, logical operations, functions etc).
If so, Project Euler is particularly good for exercising that cranial muscle in problem solving via programming, though most of the problems on the site require you at also have knowledge of mathematics (and if you don't, at least know how to google).
Just remember, if you get stuck on anything don't get put down! It's all part of learning! If you're really stuck, search SO!
There are a few very good online resources:
The Python Tutorial.
Dive Into Python. Python from novice to pro.
Code Like a Pythonista: Idiomatic Python
Another list of resources: Essential Python Reading List.
Most Python books I've seen so far are "not that good" - but that depends
on your background / prior knowledge about Python and programming.
You study the EXIF format, study the GIF/JPEG format, open the binary file, scan it and get the data out.

With Lua and Python embeddable, is there a place for Basic?

I started off programming in Basic on the ZX81, then BASICA, GW-BASIC, and QBasic. I moved on to C (Ah, Turbo C 3.1, I hardly knew ye...)
When I got started in microcontrollers I regressed with the BASIC Stamp from Parallax. However, BASIC is/was awesome because it was so easy to understand and so hard to make a mistake. I moved on to assembly and C eventually because I needed the additional power (speed, capacity, resources, etc.), but I know that if the bar was much higher many people would never get into programming microcontrollers.
I keep getting an itch to make my own on-chip BASIC interpretor, but I wonder if there's need for BASIC now that Lua and Python are easily embeddable, and just as approachable as BASIC.
What, if any, are the advantages BASIC has over other languages?
Why is it still around?
If I decide to make a general purpose microcontroller board with an interpreter, is there any reason to make a version of BASIC?
Plenty of other languages are considered dead, but BASIC just keeps hanging on.
[This may come off sounding more negative than it really is. I'm not saying Basic is the root of all evil, others have said that. I'm saying it's a legacy we can afford to leave behind.]
"because it was so easy to understand and so hard to make a mistake" That's certainly debatable. I've had some bad experiences with utterly opaque basic. Professional stuff -- commercial products -- perfectly awful code. Had to give up and decline the work.
"What, if any, are the advantages Basic has over other languages?" None, really.
"Why is it still around?" Two reasons: (1) Microsoft, (2) all the IT departments that started doing VB and now have millions of lines of VB legacy code.
"Plenty of other languages are considered dead..." Yep. Basic is there along side COBOL, PL/I and RPG as legacies that sometimes have more cost than value. But because of the "if it ain't broke don't fix it" policy of big IT, there they sit, sucking up resources who could easily replace it with something smaller, simpler and cheaper to maintain. Except it hasn't "failed" -- it's just disproportionately expensive.
30-year old COBOL is a horrible situation to rework. Starting in 2016 we'll be looking at 30-year old MS Basic that we just can't figure out, don't want to live without, and can't decide how to replace.
"but basic just keeps hanging on" It appears that some folks love Basic. Others see it as yet another poorly-designed language; it's advantages are being early to market and being backed by huge vendors (IBM, initially). Poorly-design, early-to-market only leaves us with a legacy that we'll be suffering with for decades.
I still have my 1965-edition Dartmouth Basic manual. I don't long for the good old days.
As an architecture, the main claim to fame of BASIC is that you could make BASIC interpreters very small - just a few KB. In the days of a DG Nova this was a win as you could use systems like Business BASIC to build a multiuser application on a machine with 64K of RAM (or even less).
BASIC (VB in particular) is a legacy system and has a large existing code-base. Arguably VB is really a language (some would say a thin wrapper over COM) that has a BASIC-like syntax. These days, I see little reason to keep the language around apart from people's familiarity with it and to maintain the existing code base. I certainly would not advocate new development in it (note that VB.Net is not really BASIC but just has a VB-like syntax. The type system is not broken in the way that VB's was.)
What is missing from the computing world is a relevant language that is easy to learn and tinker with and has mind-share in mainstream application development. I grew up in the days of 8-bit machines, and the entry barrier to programming on those systems was very low. The architecture of the machines was very simple, and you could learn to program and write more-or-less relevant applications on these machines very easily.
Modern architectures are much more complex and have a bigger hump to learn. You can see people pontificating on how kids can't learn to program as easily as they could back in the days of BASIC and 8-bit computers and I think that argument has some merit. There is something of a hole left that makes programming just that bit harder to get into. Toy languages are not much use here - for programming to be attractive it has to be possible to aspire to build something relevant with the language you are learning.
This leads to the problem of a language that is easy for kids to learn but still allows them to write relevant programmes (or even games) that they might actually want. It also has to be widely perceived as relevant.
The closest thing I can think of to this is Python. It's not the only example of a language of that type, but it is the one with the most mind-share - and (IMO) a perception of relevance is necessary to play in this niche. It's also one of the easiest languages to learn that I've experienced (of the 30 or so that I've used over the years).
Why not give Jumentum a try and see how it works for you?
http://jumentum.sourceforge.net/
it's an open source BASIC for micrcontrollers
The elua project is also lua for microcontrollers
http://elua.berlios.de/
BASIC persists, particularly in the STAMP implementation, because it is lower level than most other very-easy-to-learn programming languages. For most embedded BASIC implementations the BASIC instructions map directly to single or groups of machine instructions, with very little overhead. The same programs written in "higher level" languages like Lua or Python would run far slower on those same microcontrollers.
PS: BASIC variants like PBASIC have very little in common with, say, Visual BASIC, despite the naming similarity. They have diverged in very different ways.
Good question...
Basically (sic!), I have no answer. I would say just that Lua is very easy to learn, probably as easy as Basic (which was one of my first languages as well, I used dialects on lot of 8-bit computers...), but is more powerful (allowing OO or functional styles and even mixing them) and somehow stricter (no goto...).
I don't know well Python, but from what I have read, it is as easy, powerful and strict than Lua.
Beside, both are "standardized" de facto, ie. there are no dialects (beside the various versions), unlike Basic which has many variants.
Also both have carefully crafted VM, efficient, (mostly) bugless. Should you make your own interpretor, you should either take an existing VM and generate bytecode for it from Basic source, or make your own. Sure fun stuff, but time consuming and prone to bugs...
So, I would just let Basic have a nice retirement... :-P
PS.: Why it is hanging on? Perhaps Microsoft isn't foreign to that... (VB, VBA, VBScript...)
There are also lot of dialects around (RealBasic, DarkBasic, etc.), with some audience.
At the risk of sounding like two old-timers on rocking chairs, let me grumpily say that "Kids today don't appreciate BASIC" and then paradoxically say "They don't know how good they've got it."
BASICs greatest strength was always its comprehensibility. It was something that people could get. That was long ignored by academics and language developers.
When you talk about wanting to implement BASIC, I assume you're not talking about line-numbered BASIC, but a structured form. The problem with that is that as soon as you start moving into structured programming -- functions, 'why can't I just GOTO that spot?', etc. -- it really becomes unclear what advantages, if any, BASIC would have over, say, Python.
Additionally, one reason BASIC was "so easy to get right" was that in those days libraries weren't nearly as important as they are today. Libraries imply structured if not object-oriented programming, so again you're in a situation where a more modern dynamic scripting language "fits" the reality of what people do today better.
If the real question is "well, I want to implement an interpreter and so it comes down to return on investment," then it becomes a problem of an grammar that's actually easy to implement. I'd suggest that BASIC doesn't really have that many advantages in that regard either (unless you really do return to line numbers and a very limited grammar).
In short, I don't think you should invest your effort in a BASIC interpreter.
Well, these people seem to think that not only basic still has a place in the mobile space but also that they can make money off it:
http://www.nsbasic.com/symbian/
I started out on a ZX81 too. But as Tony Hoare said, programming in BASIC is like trying to do long division using roman numerals.
Plenty of other languages are
considered dead, but basic just keeps
hanging on.
Sadly yes. I blame Bill Gates for this...BASIC was on a stretcher with a priest saying the last rites for it, and then MS brought it back like Smallpox.
I used to program in BASIC in the QBasic days. QBASIC had subroutines, functions, structures (they used to be called types), and I guess that's it. Now, this seems limited compared to all the features that Python has - OO, lambdas, metaclasses, generators, list comprehensions, just to name a few off the top of my head. But that simplicity, I think, is a strength of BASIC. If you're looking at a simple embeddable language, I'd bet that QBasic will be faster and easier to understand. And a procedural langauge is probably more than sufficient for most embedding/scripting type of applications.
I'd say the most important reason BASIC is still around is Visual Basic. For a long time in the 90s, VB was the only way to write GUIs, COM and DB code for Windows without falling into one of the C++ Turing tarpits. [Maybe Delphi was a good option too, but unfortunately it never became as popular as VB]. I do think it is because of all this VB and VBA code that is still being used and maintained that BASIC still isn't dead.
That said, I'd say there's pretty a good rationale to write BASIC interpreter (maybe even compiler using LLVM or something similar) for BASIC today. You'll get a clean, simple easy to use and fast language if you implement something that resembles QBasic. You won't have to solve any language design issues and the best part is people will already know your language.

I need a really good reason to use Python

I have been trying to make a case for using Python at my work. We use C# and ASP.NET for basically all of our development. 80% or more of our projects are web applications. It seems natural that we would look at some of the nice dynamic web languages (Ruby, Python, etc), and with things like IronRuby and IronPython, I started seriously investigating.
I love Python. It's a beautiful, expressive language. It's a joy to code in, for sure. The multitude of python modules and frameworks make it very appealing. Problem is, I cannot think of any specific problems, any specific hurdles that would require a language like Python. ASP.NET gives us RAD, it gives us a full-featured framework and all that good stuff. Also, we all already know C# and have lots of projects in C#, learning a new language just because doesn't quite work.
Can you guys help me think of something to finally convince my boss to really learn Python and start using it on projects?
Edit: I know that no problem requires only one language, I just meant, are there any specific problems in which dynamic languages excel over static languages.
Edit again: Let me also mention that my boss prompted ME to investigate this. He has put aside hours to research these languages, find a good one, learn it, and then figure out how we can use it. I'm at the last step here, I do not need a lecture on why I should consider my motivation for changing something my company does because they do it for a reason.
"Can you guys help me think of something to finally convince my boss to really learn Python and start using it on projects?"
Nope.
Nothing succeeds like success. Use Python. Be successful. Make people jealous.
When asked why you're successful, you can talk about Python. Not before.
Choose projects wisely: things where a dynamic language has significant advantages. Things where the requirements are not nailed down in detail. Things like data transformations, log-file scraping, and super-sophisticated replacements for BAT files.
Use Python to get started doing something useful while everyone else is standing around trying to get enough business and domain information to launch a project to develop a complicated MVC design.
Edit: Some Python to the Rescue stories.
Exploratory Programming
Tooling to build test cases
What's Central Here?
Control-Break Reporting
One More Cool Thing About Python Is...
In Praise of Serialization
And that's just me.
Edit: "boss prompted ME to investigate", "figure out how we can use it" changes everything.
The "finally convince my boss to really learn Python" is misleading. You aren't swimming upstream. See How Do I Make the Business Case for Python for the "convince my boss" problem. The edit says you're past this phase.
Dynamic languages offer flexibility. Exploit that. My two sets of examples above are two areas where flexibility matters.
Requirements aren't totally nailed down. With a dynamic language, you can get started. Rework won't be a deal-breaker. With Java (and C++ and C#) you are reluctant to tackle devastating design changes because it's hard to break everything and get it to compile and work again. In Python, devastating changes aren't as expensive.
Design is in flux because you can't pick components. You can write Wrappers and Facades very easily in Python. It's a scripting language. And, Python modules compose into larger aggregates very simply.
Coding is in flux because requirements and design keep changing. It's scripted -- not compiled. You just make a change to the code and you're off and running. Testing is easier because the work cycle is shorter. It isn't code-compile-build-test it's code-test.
Testing is in flux because the requirements keep changing. Same as above. The work cycle is shorter and faster.
Almost no problem requires a specific programming language, that's just not how things work.
The easiest way to get a new language into an environment like yours is to start a new work project in your own time in the new language. Make it do something you need doing, and write it on your own time. Use it yourself, and other people will probably notice it. They then say "Can you send me that program?" and boom, they're using your new language.
If you really want to something, I would probably write a site in Django, simply because its admin interface blows everyone away.
The main point to remember is that if you start using python, that's one more thing everyone else has to learn, and it's another bullet point that will need to be on every prospective employee's resume. That can get expensive, and management won't like it.
Sneaking a language in is often done by automating tedious manual tasks (especially dynamic/scripting languages like Python/Ruby etc). Set it up so something like deploying builds, or shuffling backups, or whatever is done with Python.
Then casually slip in how easy it was to do, and try to spread some of the enthusiasm around.
Acceptance and awareness should slowly grow from that, and before you know it, management is seriously considering Python for a new project.
Can you guys help me think of
something to finally convince my boss
to really learn Python and start using
it on projects?
Unfortunately, the answer is no. As Harley said, no problem is going to require a specific language. The approach Harley suggested is also a good one. Learn on your time, build an useful app on your time, and maybe, just maybe, someone at your work will want to use it, like it, love it, then want to learn more about it.
Another approach you could take is to get a better understanding of why your company uses .Net (therefore, Windows Server, and probably SQL server) for nearly all development. Once you have a good understanding of why they aren't open to other languages, then you have some fire power to build a business case for the "why not?".
Why pay licensing costs when you have tools that can accomplish the same things? There are free alternatives out there, like Python, that run on free servers.
Why not give your team the chance to grow their professional tool-belt? This is my opinion, but a good developer is a developer that isn't afraid to learn new ways of doing the same thing they've done before.
But, in the end, I wouldn't get your hopes up. Bottom line, it costs money to introduce a new language/environment into an IT shop. Whether it's software, training, or employee rollover, there is a business reason behind utilizing a single language for a company, and sticking to it.
I'm in the exact scenario you're in. I work in a .Net shop, and that's not going to change any time soon. I get by, by working on my own projects in my "free" time. I enjoy it, and it makes for a good balance.
Hope this helps.
Take a step back, and look at your approach. "I know what I want the answer to be, but I can't find any evidence to support it."
Despite the fact that Python is my current first choice language, I am afraid I find myself on the side of your boss! Sorry.
I think you should open your mind and consider all the options from the stance of your organisation's best interest, and see if you don't come to a different conclusion about the best language.
There are many factors in the choice of language, and how pretty it is is a fairly minor one. The availability of staff is a key one. The cost of retraining, availability of the libraries and meta-tools, performance, etc. etc.
Once you have taken into consideration all the different factors (and not just "Oooh! It'd be fun!") and made a balanced assessment (rather than a predetermined answer), you may find that your boss is more willing to listen.
p.s. The suggestion to secretly use Python for work code, and leaving the company with a terrible code debt in a language they are not prepared for seems very unprofessional to me.
The best leverage you're likely going to have is tools and libraries; as others have pointed out, no language is required to solve any particular program. So let's look at Things You Can Leverage Using Python:
Google App Engine
SciPy
pywinauto
django
Those are off the top of my head; finding what's applicable to your team and your company is left as an exercise for the questioner :)
Well, here's a view of why Python programmers make better Java programmers; the concepts are much the same as for your situation.
Essentially, people who learn a language because they want to show that they enjoy programming, like to learn new things, and are more likely to think outside the box.
...if a company chooses to write
its software in a comparatively
esoteric language, they'll be able to
hire better programmers, because
they'll attract only those who cared
enough to learn it. And for
programmers the paradox is even more
pronounced: the language to learn, if
you want to get a good job, is a
language that people don't learn
merely to get a job.
Not only that, but Python enforces "good looking" code and you don't have to do the whole code/compile routine. With IronPython, you can simply code in Python and use it as is; just another .NET tool.
Python got a good start in the Java world as Jython for unit testing. In fact many Java people started using it first that way. Its dynamic scripting nature makes it a great fit for unit tests. Just yesterday I was wishing I could use it or something like it for the unit tests I was writing for a VB.Net project. I'd have to say that it isn't so much about the individual language IronRuby or IronPython as it is about the style of development that they enable. You can write static language like code in either but you don't fully reap the benefits until you can start to think dynamically. Once you grasp those concepts you'll start to slowly change the way you code and your projects will require less classes and less code to implement. Testing, particularly unit tests will become a must since you give up the warm blanket known as a compiler with type safety checks for other efficiencies.
The language is almost never the key to success. Good programmers can be successful in a variety of languages, and you'll find successful projects in almost any language. You won't find the failures that much because those projects just go away never to be heard of again. If you're looking for a new language because you don't have good programmers, even the best language in the world isn't going to help.
And, you haven't said anything about the sort of work you're doing. Python might be a good choice because it has well-supported and widely-used libraries that are critical for you. On the other hand, C# might have better support for the stuff that you want to do. A tool outside of context has no intrinsic merit. You might love screwdrivers, but that doesn't help you row a boat.
If you want to use Python, or any other language, just because you like it, be honest with yourself and those around you. It looks like you've made a decision to switch, don't know why you are switching, and now need to rationalize it with reasons that had nothing to do with your desire to switch. If you had a good reason, you wouldn't be asking here :)
That's not entirely a bad thing, though. Programming is a human enterprise. If the programmers (at whatever level) insanely love a particular language, no matter how stupid the reason, they are probably going to produce more. It's just not a technological solution though.
Good luck, :)
I am pretty sure (100%) that you don't need to use Python for MS Windows at least.
In cases of other platforms you can use any language you like.

Categories

Resources