Glenn,
I am hearing alot about how slow OOP is.
Really, where you have heard that?
Are you talking coding, execution or maintenance? As I find OOP faster in
all three cases. Of course when working with people who "just don't get it"
OOP coding tends to be slower. However that is not a problem with OOP!
For example: simply OOP techniques such as replacing conditionals (If ElseIf
or Select Case) with Polymorphism may actually speed up your program...
Is there ways to increase its speed? eg better programming,
techniques?
Better programming techniques apply whether you do OOP or not.
As I'm sure you are aware well written OOP will perform better then poorly
written OOP, just as well written procedural will perform better then poorly
written procedural. Or well written assembly better then poorly written
assembly.
techniques? I know that one cant compete against
well-writen assembly, but I am sure there there are
pit-falls to avoid with OOP.
I don't know being able to quickly write robust programs that are easily
maintained using OOP, while it takes significantly longer to write a
well-written assembly program, seems to be a pit-fall of assembly. Having
maintained a number of assembly programs, I know they are not easy to
maintain.
Any suggestions? eg like avoid doing alot of sub calls?
Most of my OOP tends to be smaller classes with smaller sub routines, so it
actually increases the number of sub calls. I have not seen any performance
problems.
The following articles provide information on writing .NET code that
performs well. (OOP or not).
http://msdn.microsoft.com/architecture/default.aspx?pull=/library/en-us/dnpag/html/scalenet.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/fastmanagedcode.asp
http://msdn.microsoft.com/library/d...y/en-us/dndotnet/html/highperfmanagedapps.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/vbnstrcatn.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchperfopt.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/dotnetperftechs.asp
Hope this helps
Jay