[Tutor] hitting a wall (not a collision detection question :P)

Alan Gauld alan.gauld at btinternet.com
Mon Jul 20 00:36:03 CEST 2009


"Michael" <punkbohemian at yahoo.com> wrote
> ...everything up to functions vs. methods and the basics of classes
> and OOP. This is where I'm hitting a wall. It's at this point the all the
> books go off in different directions

OK, First thing is don;t worry about it, you are far from alone.
Many, Many programmers (even long term pros) find the transition
from functions to objects really hard to adjust to. Not surprising,
since it doers require a new way of thinking about program
structure. Eventually the OOP way will become second nature,
in fact you might even find it hard to think about ordinary functions
after a while! But it can take a while.

> and I'm not sure a) what I'm learning, b) why I'm learning it,
> and c) how this is going to help me get to my goals.

It might be good to throw us some specific questions and we can
try to answer them. General questions tend to produce vague
answers!

You can try my tutorial on OOP to see if that helps. Follow it
up with the case study to see OOP in action.

> I'm not really even understanding much of what these books
> are talking about at this point anyway.

Again, anything you are unsure about tell us and we can try to
explain. That isd what this klist is really good at because there
are many different perspectives who have all gone through
the same learning curve. Someone likely has the same way if
thinking about it as you do!

> It's like a few chapters after "Classes and OOP" were torn out of all of 
> them.

:-)

> So, I'm just wondering what I should be doing at this point.

Start writing code. Don't worry about OOP too much but look out
for when you use objects in normal python code - like strings and
files for example - and see how the library writers did things. Look
for things in your code that sound like they might be objects, try writing
a class to bring together the data and the functions that work on
that data.

The more you use objects and classes the more familiar they
become and what works and doesn't work becomes obvious.
Until you use them it all remains somewhat academic.

> this is about as specific as I can be.

Go back to those tutorials and find the bits you aren't sure about
and just ask - what does this mean? How should I use this? And why?
Is this a sensible way to program this? etc etc... We will try to help.

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/ 




More information about the Tutor mailing list