learning .net after VB6

  • Thread starter Thread starter dman
  • Start date Start date
D

dman

Hi.

Can you recommend any books or courses to learn .net if one
has been using VB6 for many years?

Thanks.
 
Here is a freebie:
http://msdn.microsoft.com/en-us/vbrun/ms788236.aspx

My OPINION (note the word of opinion, as in, everybody has one) would be to
try csharp. This will allow you to leave your (bad) vb6 habits behind you
for the most part.

...

You can stick with vb.net as well.

My vb.net suggestions:

Exception Handling? (ErrorHandling)

Take the vb6 mentality of exception handling and do the 4 following things:

1. Put it in a brown paper bag.
2. Take it to someone's house you don't like.
3. Set it on fire.
4. Run away from it as fast as you can.

...

Check here:
http://blogs.msdn.com/kcwalina/archive/2005/03/16/396787.aspx


If you're using "resume next" in your VB code, then do NOT bring it forward
to .Net. Just
because you ~can~ doesn't mean you ~should~.


Another one:
ADO is NOT ADO.NET. Learn about the IDataReader and the strong DataSet.

Another one:
ASP.NET is NOT ASP.

Another one:
Put
Option Explicit On
Option Strict On

at the top of your classes, until you figure out how you can do it on a
project setting level. This will help you avoid the old vb6 stuff like
dim x
or
dim x as variant

Throw that mindset out the window.


...


This is just one area where your mentality will need to change some.
But try the free book above.





I may be a few blasts from some other posters. That's fine. These are
OPINIONS.
Keep in mind I coded VB4, VB5, and VB6 for over 6 years. It was my bread
and butter for a long time.
And gosh I wish someone had given me some better guidance than I got when I
went from VB6 to VB.Net.

I ended up going to csharp so I could avoid all the vb.net stuff that you're
allowed to do, but you shouldn't do.



Good luck.
 
Sloan,
My OPINION (note the word of opinion, as in, everybody has one) would be
to try csharp. This will allow you to leave your (bad) vb6 habits behind
you for the most part.
You had some arguments with your wife, or is this opinion based on something
more?

:-)

Cor
 
I see too many VB6'ers who retain bad habits going to VB.NET.

They want to use the upgrade wizard instead of actually learning the DotNet
framework.
I know some of it is just not knowing any better. But some of it is just
laziness.

...

If one or both of these (below) options existed, I wouldn't hestitate to
recommend vb.net (aka, equal grounding with c#).

Option JustLikeCSharp ON
OR
Option OldLegacyVB6CrapStillHangingAround OFF

...

But alas those aren't available, thus my opinion.


I mean seriously... "Resume Next" ? What year is it?


I also assuming the user means VB.Net with Framework 2.0 or above. I had a
few issues with VB.Net with Framework 1.1, but most of them have been
addressed.
 
Sloan,

I think you are right in a kind of way.

However, as I use both, I wished there was in C# something as VB.Net
behaviour ON.

By instance to replace that odd legacy method in C# to connect a system
message to an EventHandler.

:-)

Cor
 
dman,

If you already have a strong VB6 background then I would recommend any of
Francesco Balena's books.

Kerry Moorman
 
I just found Programming VB.Net (Core Reference) by Balena - from 2002

Is that one ok, or is it too outdated?
 
I remember the day I made a new developer add Option Strict On at the
project setting level.

250+ errors.

I was like "good luck dude, you should be outta here by midnight correcting
all your lazy variant coding".

I guess "as integer" or "as Employee" was just too much for the guy to put
in the first time.
 
Refractor+ automatically converts between C# and VB.Net, if you need to see
one way or another.

Also, InnerWorkings has self-based learning avaiable, in many subjects.

--
David Glienna
MVP - Visual Developer (Visual Basic)
2006 thru 2008
I just found Programming VB.Net (Core Reference) by Balena - from 2002

Is that one ok, or is it too outdated?









- Show quoted text -

I can also suggest to take a look at "Programming Visual Basic 2005:
The Language" whose author is Francesco Balena and that book focuses
on .NET 2.0 and VB 2005:
http://www.amazon.com/Programming-Microsoft-Visual-Basic-2005/dp/0735621837
http://www.dotnet2themax.com/ProgrammingVB2005.aspx

Good luck...

Onur Güzel
 
Tom,
I like the C# way better - so, don't give them any ideas about something
like
that nastyness known as WithEvents and Handles... Yuck!

I am sure that as there was Algol# you would like that even better.

:-)

Cor
 
sloan said:
I remember the day I made a new developer add Option Strict On at the
project setting level.

250+ errors.

How long did it take you to explain that the compiler option didn't
create the errors, that they had been there all the time, and that
turning the option back off wouldn't fix the problems?

;)
 
Still working on it ! (ha ha)

But I was firm about not setting it back off. And from now on, every
project better have it ON while you're coding.


Its been about a year, I think the person is doing better.
 
An answer could have been:

More then a tenth of the time I needed to correct all those 250 errors while
using C#, because I had to build the program 2500 times to see them all.

Cor
 
Cor said:
An answer could have been:

More then a tenth of the time I needed to correct all those 250 errors
while using C#, because I had to build the program 2500 times to see
them all.

Cor

Sometimes I just don't understand what you are writing. What do you mean?

Are you trying to say that VB is better than C# in some way? If so, I
don't understand how, as there is no way of turning off strict type
checking in C#, so if you would write the code in C# it would not
contain all those errors in the first place...
 
Goran,

You are right, after rereading after some hours, I had the same idea as you,
but correcting it then would be made it in my idea worse.

I got maybe to the wrong idea that Options Strict Off was seen as a bad
thing related to C# which was in this thread.

I agree completely that Option Strict Off is a bad thing (it is a little bit
passed becouse now there is option Infer which is strongly typed), but as
you are not able to make a program without Option Strict Off and get 250
errors while you set it to On and set it back to Off to get rid of those,
then you probably would need 2500 times to rebuild in C# to overcome the
same errors.

It does in fact say not much about the used language, more about the
developper.

Cor

Göran Andersson said:
Cor said:
An answer could have been:

More then a tenth of the time I needed to correct all those 250 errors
while using C#, because I had to build the program 2500 times to see them
all.

Cor

Sometimes I just don't understand what you are writing. What do you mean?

Are you trying to say that VB is better than C# in some way? If so, I
don't understand how, as there is no way of turning off strict type
checking in C#, so if you would write the code in C# it would not contain
all those errors in the first place...
 
Take the vb6 mentality of exception handling and do the 4 following things:
1. Put it in a brown paper bag.
2. Take it to someone's house you don't like.
3. Set it on fire.
4. Run away from it as fast as you can.

LOL!

I think I might print this off an hang it up on my cube wall.

Just to throw my opinion into the mix, I agree (and try to enforce)
that if someone is going to program in VB.NET they do so with Option
Strict On. In my opinion VB.NET can help write code faster than C#,
but it is too easy for new comers or "lazy variant coders" (I'm
quoting you more and more) to abuse the language features and write
poor code that "seems" ok until runtime.

Thanks,

Seth Rowe [MVP]
 
Thanks dude.

That one (brown paper bag metaphor) hit me one day while driving to work.


I still have one guy here who does variant programming without remorse.
I'm like "C'mon guy, what year do you think this is?".
We're working on implementing some code review-ish type sessions with
developers. The sooner the better.

I don't know when some people will see the light. I guess when 99% of our
country's jobs are off shored.

.........................
 
Back
Top