New to .NET

  • Thread starter Thread starter Jack Leach
  • Start date Start date
Here we go....
More opinion: What makes VB easier than C# is that it automatically
?casts everything for you. But that is also dangerous.

Not with Option Strict turned on, which any experienced VB .NET developer
will tell you to do immediately, making VB .NET strongly-typed, just like C#
is and no casts are automatically done.

-Scott

..
 
Uggg...I hate that too. And the lambda expression syntax in VB.NET
sucks compared to C# as well.

I tend to agree on the syntax thing. Though, I expect VB to be more verbose,
there is something that strikes me as elegant with the c# syntax:

myList.ForEach (item => Console.WriteLine(item));
 
I think your start is exactly correct. It is quite possible to ignore the
enormous scope of .NET by trying out a simple app where you already know
what needs to be done, and only have to figure out how to do it.

But you can't ignore the change in mindset that is needed between VBA and
..Net, as you have discovered. The examples that are available are perhaps
the best way to get on top of that - you should have no problem finding an
example to match your current project, to find out how these problems have
been solved. Finding your way around the example (that is, finding out
where in the code that the task is accomplished, which was always the tricky
bit for people migrating from QB or similar) should be no trouble with your
VBA background. So it boils down to the details of individual tasks.

Whether you do that in VB or C# is a personal choice. Some people perform a
learning task best if they are not being distracted by too many connections
to existing knowledge, especially when there is such a large change in
mindset to come to grips with. If you go with VB then there is a risk that
you waste effort in trying to do things the VBA way, and it may be difficult
to break old habits in an environment that seems to be familiar. Others
learn best by leveraging as much as possible of existing knowledge, even if
that means unlearning things, and by taking on the minimum number of changes
in any one step, so changing your language and your environment at the same
time may prove extremely difficult. You should probably look at tasks you
have tackled in the past to gauge which category you fall into.
 
Calculators are great for a first time project in a new language. The "guts"
are simple (assuming you know the formulas), and it lets you play around with
a basically non-critical interface, yet still get functionable results. One
brick at a time :-)

During training for a pilot's license, I switched airplanes a few times. In
this there was no option to start from scratch again... one *must* unlearn
and relearn things (but not too much!) in order to be safe and proficient.

Based on some statements made in the preceding conversation regarding the
usage of VB vs C, it seems as though VB would be a better choice for me.

Thanks for the input... it's better than "you say you're an experienced
programmer, so you should be able to figure this out on your own."

As an active contributer to the Access VBA coding newsgroup (for better or
worse), I understand the annoyance of people asking questions without doing
any homework beforehand. The core of my original question was "how about a
few pointers on places to get help". There's so many options for that,
finding the best ones is difficult when I don't know enough to filter the
good from bad.

In any case, I've gotten my answers. I'll be in the bookstore this weekend...


Thanks again,



--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
finding the best ones is difficult

For example:

code from the following page:
http://www.startvbdotnet.com/forms/default.aspx

'===================
Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub
'===================

The above note clearly states that this is *required* (amongst a few other
required portions of code according to this article), and yet, my primitive
code...

'=================
Public Class frmQuoteCalcs

Private Sub btnCalcLabor_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCalcLabor.Click
Dim blDispMessage As Boolean
Dim stMessage As String

blDispMessage = False
stMessage = "Please provide all required data"

If Me.txtQty.Text = "" Or _
Me.txtLaborRate.Text = "" Or _
Me.txtMinEach.Text = "" Or _
Me.txtSetupHours.Text = "" Or _
Me.txtSetups.Text = "" Then

blDispMessage = True
End If


If blDispMessage Then
MsgBox(stMessage)
Else
Me.txtCostEach.Text = FormatCurrency(pfGetLaborRate(), 2)
End If
End Sub


Private Function pfGetLaborRate() As Double

pfGetLaborRate = _
((Me.txtSetupHours.Text * Me.txtLaborRate.Text / (Me.txtQty.Text /
Me.txtSetups.Text)) + (Me.txtMinEach.Text * Me.txtLaborRate.Text / 60))

End Function
End Class
'=================

.... has none of these *required* items, and works fine.

On the website, I cannot tell what IDE is being used for this, but surely
there cannot be that much difference between VBExpress 08 and <some other
IDE>?

So I now have to assume that this website of full of you know what, because
apparently none of this so called *required* code seems to be *required*.
Maybe very highly recommended, but quite apparently not required. Unless my
VBE stores this required boilerplate code somewhere else out of my view?


--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
Much of that code is created for you and is, in fact, hidden in a "designer"
file. If you were to unhide the project files in the solution explorer,
you'd see additional files that are related to you main .vb file. The
"designer.vb" file is where the IDE places all code that is generated on
your behalf and it is required.

-Scott
 
Tom said:
Those features make some tasks easier in on language over the other - further,
there is no comparison between the IDE's. C#'s IDE experience is vastly
superior. I can give you numerous day-to-day examples that make any of my
uses of VB.NET a frustrating experience.

Could you provide some examples of why you think the C# IDE is better,
please? (Not trolling, genuinely interested).

I've recently found myself starting a project which needs to use unsafe
code for pointer manipulation in order to work with an external library,
and so I've had no choice but to leave my normal language (VB.NET) and
dive into C# instead. (Which is probably a good thing, I've been meaning
to do it for years, and already after about a week I feel relatively
comfortable).

But I still think the VB.NET IDE is better. What am I missing?
 
I don't think you're missing much, except for C#'s superior native
refactoring capabilities.

I really don't think the IDE is better in C#.
 
Could you provide some examples of why you think the C# IDE is better,
please? (Not trolling, genuinely interested).

Sure here are my two biggest ones:

1) Type in the name of a class that is in a reference assembly, but for which
there is no using statement. As you type the IDE will place a little red line
under the name of the class when it matches something - and with a ctrl-. you
can add the using. I know - VB does the same thing, BUT, only after you've
completed the line and moved to the next. What a waste of keystrokes.

2) Intelisense... It's better in the C# IDE, in that it doesn't seem to be
popping up and getting in the way all the time as it is VB. Seems like when I
work in VB, I constantly have to hit the escape key to get rid of unwanted
intellisense.

Futher, refactoring support seems to be better. And the IDE seems to react
faster.
I've recently found myself starting a project which needs to use unsafe
code for pointer manipulation in order to work with an external library,
and so I've had no choice but to leave my normal language (VB.NET) and
dive into C# instead. (Which is probably a good thing, I've been meaning
to do it for years, and already after about a week I feel relatively
comfortable).

But I still think the VB.NET IDE is better. What am I missing?

It's probably a case of what your used to :) I pretty much work almost all of
the time in the C# IDE - so it annoys the crap out of me when the IDE works
differently in VB.NET - though, the bit ones seem to be pretty silly.

What do you think is better about the VB IDE?
 
I don't think you're missing much, except for C#'s superior native
refactoring capabilities.

I really don't think the IDE is better in C#.

Oh, it is :) And by the way, that wasn't true of the early versions. Up
until VS2003, VB's IDE was better - except for the lack of the little
lightning bolt for events on the properties tab :)
 
I don't think you've mentioned anything here that qualifies as C# having a
better IDE experience. You've mentioned one item that is also in VB and
then mentioned that VB gives you "too much" intelliSense, so you hit ESC to
get rid of it? I'd rather have too much than too little.

Hey, you're entitle to you opinion Tom. But, your argument that C# has a
vastly superior IDE is pretty weak. You said it yourself, your used C# and
don't we all like what we're used to?

-Scott
 
I don't think you've mentioned anything here that qualifies as C# having a
better IDE experience. You've mentioned one item that is also in VB and
then mentioned that VB gives you "too much" intelliSense, so you hit ESC to
get rid of it? I'd rather have too much than too little.

LOL... VB has the feature - but it is screwed up. As are most of the
semi-equivalent features. In VB for some reason, they don't activate until
you hit enter and leave the line - making them very painful and almost
useless.

Besides, Scott - I was exagerating a bit when I said vastly. But, all I
know is that I find the VB experience almost painfull if I have to do
anything significant. Of course not nearly as painful as the old vb classic
ide :)
Hey, you're entitle to you opinion Tom. But, your argument that C# has a
vastly superior IDE is pretty weak. You said it yourself, your used C# and
don't we all like what we're used to?

I think I said exactly the same thing.
 
Besides, Scott - I was exagerating a bit when I said vastly.
But, all I know is that I find the VB experience almost
painfull if I have to do anything significant. Of course not
nearly as painful as the old vb classic ide :)

Yeah, it must be a bugger not having everything done for you. Might as well
get a job as a programmer!

Mike
 
Back
Top