View Single Post
Old 07-13-2008, 04:06 AM   #2 (permalink)
jamiemac2005
Design Team Member
 
jamiemac2005's Avatar
 
Join Date: Jul 2007
Location: Northampton, UK
Posts: 1,091
OS: Win Vista Home Premium & Ubuntu Hardy(8.04)


Re: pseudo-code (modular program)

Hey, i don't see anything here which needs to be modular... I believe the meaning for module is a block of code which may be re-used... e.g. how we use functions/procedures rather than re-writing code millions of times... Or the same for Iteration statements, we use them to re-run a block of code(module) a number of times...

A good example would be an output routine like outputting the state of a few variables at any one time, usually i'd expect to see something like :
(I don't know the notation you use for modules/procedures etc)

Code:
...
procedure outputStateOfVars;
begin
  println sum
  println count
end

(here you would mess with the variables)
sum := 1 
count := 1
(then output them)
outputStateOfvars;
(then mess with them some more)
sum := count+5;
(then output them again)
outputStateOfVars;
Anyway theres a definition here: http://en.wikipedia.org/wiki/Modularity_(programming)
(Wiki is a good resource no-matter what the news says)

which kind of sums it up, we use modules to make code more easily maintainable and to allow code re-use.

If you need more help then post back with your queries, to be honest it's hard for me to explain modularity because it's just something that's a constant in my mind.
jamiemac2005 is offline   Reply With Quote