Friday, July 31, 2009

Why do programmers use submodules in computer programming to solve problems?

compuer programming

Why do programmers use submodules in computer programming to solve problems?
Programmers use sub and functions because they allow the same code to be run but with different parameters, so the parameters may change but the code doesn't, this makes for less coding because you can reuse your subs and functions.


As below which is a very useless example but shows that I can write to the console anything I want by invoking the sub WriteSomething





Call WriteSomething("Hello World!")





public function WriteSomething(pText as string)


console.out.writeline (pText)


end function


No comments:

Post a Comment