Well, the way I see it is thus: I would rather have my handy dandy class
files and bas files which I know work (and yes, I will give you that .NET
can do it in one lines, once all the new syntax has been learned, understood
and remembered)...BUT, when I compile my project and create my setup
files
which include the VB runtimes...the download for the end user is still much
smaller than shipping out some .NET nightmare. The problem is this, and has
been mentioned: The .NET runtime is massive. In my 10+ years of dealing
with end users and their fickle systems, it was always to my advantage to
include the VB runtimes in my setup files, because when VB six was first
introduced, DLL Hell plauged my life with "OLE files out of date" messages.
I could not depend on my end users to have the current VB runtimes on their
computer...and I certianly could not depend on them always haveing the
latest SP's or Windows updates installed. And when I say I've dealt with
tens of thousands of people over the last ten years, I am not exaggerating.
I managed to curb the problem by always shipping the VB runtimes in my
setups with the versions instlled with VS6 and some competent version
checking in my setups. Problems mostly solved.
Now, taking all that into consideration with .NET, I would have to
include
the .NET runtimes in my setup packages, which would create 20+ MB files for
the end user to download. Otherwise if I assumed the end users already had
the .NET runtimes installed, I would be spending ever waking hour with
support tickets over an installation process that should manage itself.
So, between having to learn a new lanaguage for all intents and purposes,
and then ensuring the end users have all the proper runtimes by including
those massive .NET runtime files...and not even mentioning how sluggish and
slow .NET compiled programs run in general...it just not worth it. M$
did
me a great disservice by throwing away VB classic along with everything I've
worked so hard for over the last ten years including code and protocols and
giving me .NET in return. And for what reason? Because they think it's
better? Again, I would rather have my BAS files with code I know works than
the so called convenience of only needing to type one line in .NET. It's
not a trade off I am willing to make, citing everything I've just explained.
If you want another analogy, consider the programs I've developed with my
marriage to VB 6 my "children". Now M$ has suggested I divorce from VB6 to
enter into another marriage with .NET. Good marriages take time and work
and don't always work out for the better. I don't want a new marriage, I am
happy with the one I am in...and I certainly don't appreciate being told my
"children" are obsolete, along with my "wife" because they think the new
marriage would be better for me. What made my marriage to VB 6 won't
work
for .NET. Plain and simple.
So, there it is. ;-)
- Kev
Abubakar said:
and place it in a BAS Module along with all my other file
manipulation Functions and Subs, then all I have to do is add that
Module to any projects needing file input and reduce the call to
this...
Content = ReadAllText("c:\temp\test.txt")
That really isn't such a burdensome thing to do.
but how much of the functionality are you going to surround with function
calls and classes? And its you who is doing that, how are you going to
make
this utility code available to all the vb6 devs? .Net that makes it
available for everyone.
Ab.
"Rick Rothstein [MVP - Visual Basic]"
<
[email protected]>
wrote in message Well if you seriously prefer wading through this:
Dim FileNum As Long
Dim Contents As String
FileNum = FreeFile
Open "c:\mytextfile.txt" For Binary As #FileNum
Contents = Space(LOF(FileNum))
Get #FileNum, , Contents
Close #FileNum
as opposed to this:
Dim contents as string =
My.Computer.FileSystem.ReadAllText("c:\mytextfile.txt")
then we're never going to agree.
But if I bundle the code I posted up into a Function like this
Public Function ReadAllText(FileName As String) As String
Dim FileNum As Long
Dim Contents As String
FileNum = FreeFile
Open FileName For Binary As #FileNum
ReadAllText = Space(LOF(FileNum))
Get #FileNum, , ReadAllText
Close #FileNum
End Function
and place it in a BAS Module along with all my other file
manipulation Functions and Subs, then all I have to do is add that
Module to any projects needing file input and reduce the call to
this...
Content = ReadAllText("c:\temp\test.txt")
That really isn't such a burdensome thing to do.
Rick