John Connors wrote:
G'day,

While the list is kind of slow I thought I'd post a few thoughts on a couple 
of things in Python that bug me. They're not really questions but maybe 
someone can help me understand.

The first one is lists... I can't for the life of me understand why a list 
starts at zero. In everything else in life other than programming the 1st 
item in a list is always 1.

The next thing I don't understand is why the last number in a range is not 
used...

For a in range(1,6):
    print a,

1 2 3 4 5

Once again it defies the logic of everything else we are taught in life.

The 3rd whinge is object oriented programming. I think I understand the 
principle behind OOP but in practise, to me, it just makes programs jumbled, 
unreadable and bloated. Just about every summary I have read on Python says 
it is designed to have a simple syntax and is easy to learn. As a beginner I 
can look at Python code and have a very good idea of what is happening and 
why unless it's written in OOP style in which case I have no idea.
Dustin pretty well covered it. I'll add:

OOP is never necessary. Alan Turing proved that with this theoretial "Turing Machine". Anything  that can be computed can be computed on a turing machine. BUT doing so can be very difficult to program. So programming languages with their underlying compilers, assemblers, translators, runtime engines, etc. were invented to make programming "easier".

For me OOP is very helpful to separate data from logic. When I find myself writing if elif else sequences to distinguish between 2 similar but not identical collections of data,  I (almost) always ask "could this be a reason for 1 or more subclasses"? Also if I have multiple instances of the same thing it is a lot easier for me to track the individual data values in class instances rather than in some sequence or mapping (the alternative if one does not use classes).

Welcome to the adventure. You are standing ....

-- 
Bob Gailer
510-978-4454

Broadband Phone Service for local and long distance $19.95/mo plus 1 mo Free
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to