[Tutor] taking Python to next level (original) (raw)

Magnus Lyckå magnus at thinkware.se
Sun Jul 18 03:00:15 CEST 2004


At 12:10 2004-07-17 -0700, Danny Yoo wrote:

On Fri, 16 Jul 2004, orbitz wrote: > Dive into python is good. Python is also distinct from other languages > in that reading other peoples code is actually helpful, usually.

I have to argue with the second sentence, though. (Just slightly. grin) I feel that reading other people's code, in any programming language, is a good thing. There's a book called 'Code Reading': http://www.spinellis.gr/codereading/ that talks about the advantages of reading and understanding code; I'd wouldn't exclude it just because they don't use Python. Good code can be written in any language.

Sure, but I agree with orbitz that it's more common that Python code you stumble over is "a good read" than code written in most other languages. This is probably both a consquence of Python itself and of the kind of programmers that the language attracts.

It works both ways. Python is know for its readability and clarity. People who value readability and clarity in code are more likely to use Python than people who don't value these aspects highly.

(And it's not necessarily a bad thing to read "bad" code, either: we learn more quickly from mistakes than from successes.)

I'm not so sure about that.

First of all, for a beginner who reads someone elses code, it's not so easy to know whether something is bad or good. Secondly, there are an infinite number of ways to write a program. Learning one way not to write doesn't seem very helpful.

It's probably easy to spot problems in code if you know how to do things right, and it might be a pedagogical thing to do to demonstrate problems and failures, but I don't think it should be more than some "seasoning" on the meal of good idioms and techniques...

-- Magnus Lycka (It's really Lyckå), magnus at thinkware.se Thinkware AB, Sweden, www.thinkware.se I code Python ~ The Agile Programming Language



More information about the Tutor mailing list