[Tutor] programming definitions for a newbie.

Thomas CLive Richards thomi@thomi.imail.net.nz
Wed Jun 18 06:55:03 2003


here goes:

> *module- 
A module is like a library. It is a collection of useful code which
someone else has written, so you don't have to. typing "import module"
takes that code and includes it in your program, so you can then use the
features of that module.
> 
> *object orientated programming
> 

A style of programming, using objects instead of...not... I've never
really done a lot of procedural programming, so i can't really define
this one very well...

> *arrays
> 
An array is a variable which holds a list of other variables (that
didn't make sense, did it?). For example, variable 'names' might hold a
list of names of other people, so it holds a list of strings. You can
think of arrays as occupying more than one memory "box". I.e.- you can
assign one value per memory "box". You can also have arrays within
arrays, so they are in effect "2d arrays".
> *function
> 
Once uses a function when one has a collection of code which you may
want to use more than one. you can write it in a function, and then call
that function over and over again. If (for example) your function has 50
lines of code in it, and you call it 10 times, you are saving yourself
from having to write those 50 lines 10 times. instead, you simply call
that function.

> *local variable
> 
A variable which can only be "seen" by the code block it was declared
in. For example, if you declare a variable in a function, it may only be
read from within that function. this is a local variable. a 
> *global variable
> 
OTOH, is readably from everywhere in the program. These are generally a
bad thing to use, as they tend to lead to sloppy code, and make programs
much harder to debug. One good use i find for global variables though is
a "debug flag", which i can set to 1 whenever i want my program to print
debugging messages.
> 
there is a "programming for non-programmers" tut somewhere or other..
maybe you should take a look at that..
> 
> 
> No offence to the tutorial writers.  i have attempted
> almost all of the beginners ones that python.org lists
> and they are great up until after "while loops".  Then
> things get more intense and programming lingo steps up
> a notch also.

Thomi,

-- 

Thomi Richards,
thomi@thomi.imail.net.nz