What is Spartan Programming?
Spartan programming seeks to reduce code complexity through minimum coding practices.
Instead of these 4 lines of code,
import GREETERS:MyClass;we could rewrite in two lines as below:
Local GREETERS:MyClass &greeter = create GREETERS:MyClass();
Local string &message = &greeter.GreetMe();
MessageBox(0, "", 0, 0, &message)
import GREETERS:MyClass;It may be difficult to read this 2nd method but less codes to maintain..
MessageBox(0, "", 0, 0, (create GREETERS:MyClass()).sayHello());
No comments:
Post a Comment