Monday, January 12, 2009

Module, component, object... Whatsit?

In our last post we discussed how to create a module for reusing code that is common between different programs.  You may have noticed that we used the terms module, component, and object interchangeably.  We did this so that we could write this post.  ;-)

The term object oriented has a bad reputation in some programming circles.  People who enjoy structured procedural languages like BASIC, Pascal, C, etc. often find objects challenging to wrap their minds around.  Run BASIC incorporates some very simple object oriented ideas and tries to present them in a non-object way.  For example you can work with files and graphics without noticing that they are objects in Run BASIC.

Creating a module like we did in the last lesson shows a simple way to leverage objects in BASIC.  Nothing fancy really.  Just create a separate program and hold onto it in a variable.  Then you can call its functions to do things.

That's really all an object is.

No comments: