Perhaps I am just dumb

Joshua Macy l0819m0v0smfm001 at sneakemail.com
Sat Feb 9 09:13:04 EST 2002


wooks wrote:

> New to the language, new to OO but I do understand the basic concepts,
> not at all new to programming, trying to do the right thing by
> searching archives before asking questions.



   Have you tried following the Python for Beginners link on 
www.python.org?  http://www.python.org/doc/Newbies.html has links to all 
sorts of material for beginners, including help at python.org (a volunteer 
help desk) and tutor at python.org (a low volume mailing list).
   As for being new to OO, there's no requirement that a Python program 
be organized as an OO program; just like VB, you can write purely 
procedural code (although, again just like VB, you'll have to create and 
perform calls on external OO objects to do most interesting work).

   I don't think searching the discussion archives is all that helpful 
unless you have a specific question that you want answered and if you 
do, you haven't mentioned it.

> Yet I feel I need to be
> doing a university degree course in philosophy or mathematics to
> follow almost any discussion. If that's the way it is fair enough but
> Python is supposedly simple to learn (thus far I've had an easier time
> of it learning Perl).



   comp.lang.python is not a forum specifically for beginners; it's 
better than almost any other general language newsgroups that I've 
encountered at answering questions from beginners, even if the questions 
are covered in the FAQ or easily found in the archives, but most of the 
posters here are here to get their own practical questions answered, or 
to discuss extensions and enhancements that they're working on--which 
can be some very hairy stuff indeed.  If you dip into a random 
discussion and it sounds like it's between two PhDs in computer science, 
it's probably because it is, and they're using Python in their work.

> If someone comes and says I've had the following
> understanding of concept X since I was in grade 2 why is it not so in
> Python, the answers seem to be heavy on the philosophical
> justifications fo the Python way and light on the practical benefits.
> The answers also tend to be in a totally different intellectual
> context.
> 



   Posters on comp.lang.python tend to assume that if you ask the 
questions "Why is it thus-and-so in Python?" that you actually care 
about the answer, and that if you actually meant "How do I do 
thus-and-so in Python (I tried X, like in some other language, but it 
didn't work)" that you'd say that instead.  They're often wrong about 
that, but so it goes.
   As for concepts "understood since grade 2", that usually means "it 
worked like X in this other language Y that I know, why doesn't Python 
follow this 'natural' approach?"  If you hang around a while, though, 
you'll start to notice what the veterans of the newsgroup realized a 
long time ago, which is that the 'naturalness' of X depends entirely on 
which language Y the person is thinking of.  People will frequently 
complain something like "Python is the only language that does this 
stupid thing Z! All other languages do A!"; they are just as frequently 
shot down by posters pointing out that languages B, C, D, and F do 
things just the way Python does, E, G, and L do it the way the 
complainer is thinking about, and H, I, J do something else entirely.
   Python does very few things that no other language does, and those 
few are usually (e.g. colons at the end of statements introducing 
blocks) because there was as study that showed it was easier to learn 
that way.


> True I haven't been around here that long but it's a 1st impression
> and it counts. Perhaps it's because so many come to Python with
> baggage from another language so that issues they raise are addressed
> in that context rather than conceptually.
> 


   I think that's exactly it.  If you really want to know why something 
in Python is the way it is conceptually, you often have to be prepared 
for a somewhat complicated answer, philosophically or mathematically. 
Sometimes, though, the answer is because Guido wanted it that way.

One of the basic philosophies of Python design is that it is wrong for 
the language to guess when presented with something that's ambiguous. 
That something is "automagical" is usually a swear word in Python.  This 
can make Python seem hairier than other languages which cheerfully take 
a stab at what the designers think you may have wanted, but the Python 
belief is that those languages are leading you down the garden path, and 
sooner rather than later you'll be bitten by the subtlety that the other 
language tried to gloss over.

A good example of this is floating point math and its representation. A 
frequent question is something like:

 >>> 1 - .1
0.90000000000000002

What's up with that?  1 - .1 = .9, right?  Right, but that isn't the way 
that any computer you're likely to use represents it internally, and if 
you don't know that you're eventually going to come to grief if you try 
to use mathematics at all seriously in your programs.  I won't go into 
why this is so (there's a whole FAQ page on it), but this is the sort of 
thing that is a problem with computers in general (or at least binary 
floating point math) and one of the places where Python's approach can 
be surprising to a newbie.


> Bought Python for Win32 book and already been caught out (Part 1 was a
> breeze part 2 and I shuddered to a grinding halt). For perspective I
> am a tester who wants to learn Python because of it's excellent unit
> test framework and it's scripting glue like abilities (not interested
> in building applications).



Did you actually try any of the examples of manipulating Word or Excel 
from Python?   Python for Win32 is an excellent book, IMO, but way 
overkill unless you have some specific need to interact with COM or the 
Win32 OS APIs. It is not a book about learning Python.


> 
> The benefits of using of Python as a scripting glue like language are
> widely touted but don't seem (I am probably wrong but it's a 1st
> impression) to be well catered for. As I said I am not interested in
> building applications. Is there a forum for the dumber less demanding
> Python user?
> 


   You need to ask a more specific question, or be more specific about 
what exactly you're trying to accomplish and finding difficult.  General 
complaints that it seems difficult to understand aren't likely to 
generate much helpful advice.

   And, don't take this the wrong way, but it *is* dumb to go to a 
language newsgroup and say "Maybe I'm dumb but [vague complaints about 
the language not being easy]" if you have any expectation that posters 
will rush in saying "No, no, you're not dumb, it's obviously the 
language's fault" the way your friends and relatives might.  Usenet is 
not the place to cruise to have your ego soothed.

   Joshua






More information about the Python-list mailing list