Re: Classes vs. Modules

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Rich

did you bother counting the lines of code?

your vb dotnet way to do it is MORE VERBOSE

On Feb 13, 12:53 pm, Rich <R...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
With inheritance you can do stuff like this:

Dim arrtxt() As TextBox
arrtxt = New TextBox(){Text0, Text1, Text2,...)
For Each txt As TextBox In arrtx t: AddHandler txt.Leave, AddressOf someProc
: Next

In VB6 it would be this:

Private Sub Text0_LostFocus()
dosomething
End Sub

Private Sub Text1_LostFocus()
DoSomething
End Sub
...

My code has shrunk nearly 30% by switching to VB2005 from VB6, plus the
VS2005 IDE catches more errors than anything I have ever seen. It is almost
impossible to write buggy code (at the compiler level) in VS2005 (VB, C#...)

As far as running slow goes, if your clients are using antiquated hardware,
then yes -- you are resigned to using antiquated technology. But if they
are using current hardware, then VS2005 will run just as fast as the old
stuff. One line of code in VB2005 packs way more punch than a line of code
in VB6, so yes, you will need a bigger engine to run it.



"aaron.ke...@xxxxxxxxx" wrote:

sorry I meant multiple inheritence

ala C++

OOP without multiple inheritence is no better off than VB6

and OOP without design tools ala class designer is a joke
it shouldn't cost 3 grand if 'everyone should be using classes for
everything'

I just do not see any new functionality that classes give me; and I've
got a dozen books that state that they give slower execution time.
so only a *** would subject their clients to slower execution
time.

seriously-- performance is king; oop does not help performance; it
hurts it; so i'll continue with my procedural / spaghetti code thank
you very much

On Feb 12, 10:44 am, "Michael D. Ober" <obermd.@.alum.mit.edu.nospam>
wrote:
That's news to me. I use polymorphism in both VB 2005 and C# 2005. Maybe
what you really mean is that both languages require (optional in VB 2005)
strongly typed parameter passing and VB 6 and earlier let you write sloppy
code that you had to runtime check every single parameter.

Mike Ober.

<aaron.ke...@xxxxxxxxx> wrote in message

news:1171302098.611440.30110@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

fully agree spam catcher

I mean-- it's really obvious to me that modules should be used
whenever possible so you don't need 12 different copies of the same
method

(since vb 2005 and c# don't support polymorphism)

On Feb 11, 12:43 am, Spam Catcher <spamhoney...@xxxxxxxxxx> wrote:
"Zytan" <zytanlith...@xxxxxxxxx> wrote in news:1171055866.052844.204220
@h3g2000cwc.googlegroups.com:

I try to avoid global vars like the plague, as do most, so I cannot
see why anyone would still want to use this.

For redundant functions it doesn't make sent to need to instaniate
everytime just to use em :-)- Hide quoted text -

- Show quoted text -


.


Quantcast