|
-
Apr 30th, 2000, 07:00 PM
#6
transcendental analytic
Wait, I haven't said anything yet ;)
I'm really censorious about using subroutines and function, i'm a game developer and performance is the keyword for me, so while subroutine calls may only take from 1,2 to 4 µs, it's extreemly important not to overuse them where i have the codes like loops, classcalls and other frequent and timecritical code. I'm now working on performance test on a runtime script for a game and a shell replacement so even small things like select case have to be split up for best performance. Otherwise I use subs and functions very often to get my code as handy as possible. I had a thought about removing as much subs and functions as possible before the final compile so that it would only have events and methods with static vars, to gain highest possible performance but never tried. As a tip, u could use property get/let/set if u didnt already know.
Additinally to what was said about modules, they are absolutely needed if u work with the addresof operator, you have to put the procedure in a module. Modules can contain public enumerations, UDT's and declarations. They can be accessed without using Modulename.method or Modulename.variable (of course if you have many modules u will have easier to find them)
I never use Option explicit when i start with something new. When i have got into some hundred lines and make my first compilation, i will put option explicit and declare everything to check everything, Option explicit slows down programming, much like using prefixes to variables. That's later work for me.
Sam, i think Classmodules are more like UDT's with code rather than modules. Looking from this side it's much more interesting to introduce classmodules than to think they are modules in instances.
Private is good for hiding tons of things from the oo interface we work with, ie classmodules can pretty much loose its handyness if you have tons of public members that u never use from outside. Yeah, put them private as much as possible.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|