Which to use VB.NET or C#?

  • Thread starter Jon S via DotNetMonster.com
  • Start date
J

Juan T. Llibre

re:
This situation has not changed from 2003.

But it has...

The App_Code directory didn't exist in 2003.

You couldn't upload source code in 2003, and have it compiled,
unless you used "src" in the Page directive, which is bonkers, anyway.

re:
you should be precompiling the site.

That depends on what "should" means.

If you pre-compile the site, every time you update the smallest
portion of the site, the whole site has to be re-compiled.

Sometimes that's not the desired behavior.

re:
As with most such issues, the developer has a choice.

We've agreed on this before... ;-)

re:
If you choose to deploy your source code, that's your option.

If you need to have the most effective option, if your site needs
to be updated frequently, pre-compiling is not the best option, imho.

Re-compiling only the parts which have changed seems more effective.

But, YMMV... ;-)
 
J

JIMCO Software

Juan said:
re:

But it has...

The App_Code directory didn't exist in 2003.

You couldn't upload source code in 2003, and have it compiled,
unless you used "src" in the Page directive, which is bonkers, anyway.


Or if you used inline code. Either one of these options is a bad idea
because you lose the benefit of batch compilation.

By "this situation", I was referring to the fact that you have the option to
copy source to the server or not copy source. That's your choice.

If you need to have the most effective option, if your site needs
to be updated frequently, pre-compiling is not the best option, imho.

Re-compiling only the parts which have changed seems more effective.


I agree. Once again, this hasn't changed from 2003. You just have more
options now. You can simply create your class libraries in a separate
project and reference them. You can then just recompile them if you wish.
As long as you don't break the binding, you'll be fine.

The point I'm making is that it is entirely inaccurate to say that the
App_Code folder is a security risk.
 
J

Jesse Liberty

Yes, there are special cases where you need C#, and I suppose one could
argue that the "my" object in VB is a more natural fit than calling it from
C#, but in fact, the differences between the two languages (unless you are
working with unsafe code) are negligible.
 
J

Juan T. Llibre

re:
You can simply create your class libraries in a separate project and reference them.
You can then just recompile them if you wish.

Are you saying that the App_Code directory is superfluous ?

;-)

re:
The point I'm making is that it is entirely inaccurate to say that the App_Code folder
is a security risk.

I don't know about "entirely".

In the scenarrio I describe, which is the currently recommended
scenario in the VS.NET docs, it's not "entirely inaccurate" at all.

Also, precompiling a Web site compiles only that site, not any child sites.

If a Web site contains a child folder that is marked as an application in IIS,
the child application is not compiled when you precompile the parent folder.

Just a few things to keep in mid... :eek:)
 
I

intrader

Hi all,

I'm planning on developing an ASP.NET web site. I know both VB.NET and C#
but am unsure on which would be more useful to develop an ASP.NET site with?
Also I maybe looking to become a web developer in the future so it would help
if I use the langauge that most companies use to develop their ASP.NET site?

Many thanks,
Jon.
None of the answers have suggested that there are differences in that the
languages support. For example, say you need to attach a non-serializable
attribut to a field. You can't do this in VB.NET (that I know off). This
is needed when your field hold an event delegate.
 
R

riscy

If you're new on OOP, try OOP for c# book by Apress, you can get this
book from Amazon. It one of the best book to learn concept of OOP. It
cover UML as well but primary focussed in teaching OOP and C# code.

Good luck
 
M

Manny G

I am using both the languages (vb.net and c#)

I use to hate vb, as I always like c, c++ and java style of languages.
Before starting with .net. I had experiance in java so c# was the
natural language for me in .net.

I had to code in vb.net for some projects and then i realised the power
of features provided by vb.net compiler. The backgroung compiling
feature is cool. vb.net is not case sensitive (which eases the
implementation of background compiler, i guess). I became a lazy
programmer after few days of coding in vb.net ;) and to my surprise, i
dint like c#, when i had to revert back to c# (though the feeling was
temp.).

C# wins hands down when it comes to redability of code. and ofcourse
some power features.

Well i wont go into tech details of both the languages.

Bottomline, choosing a language doesnt play a major role in .net. If u
have a choice then it realy depends upon personal taste. (In my case
mood).

Regards,
MannY
 
J

JIMCO Software

WJ said:
it ! I know many MS/Programmers today will flunk simple because they
donot need to think, IDE does the most work for them! It trains you
to be a very good thinker without an IDE. I have no problem with

I've heard this argument before and I just don't buy it. An IDE does not
write code for you. It does not think for you. IntelliSense, color-coding,
auto-formatting, a nice debugger... these are all productivity tools, not
substitutes for thought.

In fact, your argument strikes me as being a bit ironic! :)
 
W

WJ

JIMCO Software said:
Why would anyone want compile at the command line? In VS.NET, I can build
a class in 2 seconds. In command line, it would take many times longer.

In academic environment, I did not learn Microsoft products. I took Unix and
Java. So, in front of a Unix workstation, all we got was a simple vi editor
and most of us are very very good at it. On exam time, there were two items:
a piece of blank paper and a pencil. Code it ! I know many MS/Programmers
today will flunk simple because they donot need to think, IDE does the most
work for them! It trains you to be a very good thinker without an IDE. I
have no problem with today IDE, yes, to produce a quick and elegant
prototype program to win a contract, one must need an IDE such as VS.Net.
But I bet you, students like us can write a class lib. using any text
editors 100 times faster than you guys can with your vs.net. Futher more, in
vi or notepad, we do not need intellisense feature. And very fast, no
waitting time at all !

John
 
W

WJ

the .Net Framework is free, and comes with command-line compilers for
hobbyists, the less financially "fortunate," and the misguided "purists."

Yours is a very bad assumption here. I never denied the usefulness of an IDE
such as VS.Net. I was anwering to the OP that text editiors can be used to
write very good codes in any languages.
However, as a professional, and the programming biz being highly
competitive as well as high-pressure, I don't see how anyone could compete
in the marketplace without tools like Visual Studio. It's all about
productivity.

I know this. And my company knows this !
In my opinion, IDE gets you into a habit of too dependent on its automation
features.
Remember mother used to point at the TV set and said: "This is a very stupid
box !" . Remember that ?
When I was a carpenter, back in Skokie Indiana, I learned a valuable
lesson from my boss. He told me that, to succeed in the carpentry biz, I
should pick up new tools as often as possible. Now that I build software
instead of houses for a living, I have found that advice even more
appropriate.

This reminds me that our ancestors had a very simple set of chisels and
hammer and some of their arts are still very tough to be duplicated by today
modern tools !

John
 
K

Kevin Spencer

I know this. And my company knows this !
In my opinion, IDE gets you into a habit of too dependent on its
automation features.
Remember mother used to point at the TV set and said: "This is a very
stupid box !" . Remember that ?

There is a big diffference between the concept of "can" and the concept of
"will." An IDE CAN get you into a habit of being too dependent upon it, if
you're a lazy-assed couch potato. Personally, my mother taught me to work
hard. When you combine hard work with productivity tools, you get
Competition++. Conversely, hard work with lousy tools doesn't produce at the
same capacity. Laziness, with or without tools, adds up to "don't quit your
day job."

Therefore, logic dictates that in order to be as competitive as possible,
one employ ALL means at hand to achieve one's goals. I can certainly
remember my dirt-poor early days, sitting at a command-line freeware K&R
compiler, and I benefitted from the handicap. It taught me how to make
chicken salad out of chicken s**t. But now that I have great chicken and a
fine kitchen, I can make some awesome chicken salad! And it smells better in
my kitchen these days.

Of course, it helps if you love to "cook."

--
;-),

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
J

JIMCO Software

Kevin said:
There is a big diffference between the concept of "can" and the
concept of "will." An IDE CAN get you into a habit of being too
dependent upon it, if you're a lazy-assed couch potato. Personally,
my mother taught me to work hard. When you combine hard work with
productivity tools, you get Competition++. Conversely, hard work with
lousy tools doesn't produce at the same capacity. Laziness, with or
without tools, adds up to "don't quit your day job."

Says you! I have a great response to this all typed up. As soon as I can
get it posted to usenet via command line, you'll be blown away by my
incredible thought process. Just you wait!
 
G

Guest

Anyone who says it's just syntax, has not done enough development in both
languages to give a fair view.

The IDE behaves much better in VB than in C#.

Some of the new features for C# in VS2005, VB has had since the first
version of VS.NET. (Backgroud compiler)

I use VS at work all day. I use VB.NET on my spare time.

What's up with the ";"
How often do you continue a line, do a line count....

C# is helps the compiler more than the user in my opinion.

Some things I do like better in C# (comp warnings), but overall give me
VB.NET!
 
J

JIMCO Software

Schneider said:
Some things I do like better in C# (comp warnings), but overall give
me VB.NET!

I find that when I'm reading through other people's source, C# is much
easier to read.
 
J

Jesse Liberty

I really have to disagree with some of this:
In my opinion, IDE gets you into a habit of too dependent on its
automation features.

Yes, so do fuel injection, thermostats, word processors, watches,
telephones.... The only interesting question is whether programmers who use
the IDE write code that is less efficient or less maintainable or otherwise
"worse" than those who write from scratch. In my experience, the opposite is
true: using the IDE not only increases productivity,it increases the quality
of the code. As the IDE gets better and adds less bloat this only increases
in validity.
...our ancestors had a very simple set of chisels and hammer and some of
their arts are still very tough to be duplicated by today modern tools !

Yes, but let's see them build a jet airplane with those tools. There are a
few things you can do with a hammer and chisel that are truly beautiful, but
that does not mean that any commercial artist is about to give up his CAD
system!

The reason this discussion is interesting is that there really is a powerful
resistance to innovation in our community. I saw it with the move from ASM
to C, from C to C++, from C++ to C#, from DOS to Windows... I see it all the
time. I can only come up with three theories that make any sense:

1. Latent Luddism-- that is, the fear that the technology will displace us
2. Cognitive dissonance - one fears inability to master the change and so
denigrates the innovation
3. Sunk costs - one has mastered an older tool and doesn't want to give up
that investment

Certainly, now that I'm 50, I do find it harder to keep up with the pace of
change (and Microsoft is trying to kill us with its pace of innovation, I'm
quite sure of it), but he who hesitates is surely lost. In any case, the
IDE is an easy call: low cost and very high gain.
 
J

Jesse Liberty

Anyone who says it's just syntax, has not done enough development in both
Maybe, but I've been writing code and books on both for about 5 years, and I
see very little difference in my own productivity or in the quality of the
code produced. But perhaps it will take another 5 years to really see it.
The IDE behaves much better in VB than in C#.

Not my IDE. It behaves about as I'd expect in both
Some of the new features for C# in VS2005, VB has had since the first
version of VS.NET. (Backgroud compiler)

Yes, and vice versa.

Really, this becomes a matter of taste (or religion if you get really
excited about it). Everytime I write a program in one and translate it into
the other (which I do all the time because of my books) I find that the
change is 99.9999% mechanical.
 
K

Kevin Spencer

time. I can only come up with three theories that make any sense:
1. Latent Luddism-- that is, the fear that the technology will displace us
2. Cognitive dissonance - one fears inability to master the change and so
denigrates the innovation
3. Sunk costs - one has mastered an older tool and doesn't want to give up
that investment

I can add one to the list: Future Shock. As you are my age, I'm sure you
remember Alvin Toffler!
Certainly, now that I'm 50, I do find it harder to keep up with the pace
of change (and Microsoft is trying to kill us with its pace of innovation,
I'm quite sure of it

Hey, it isn't Microsoft's fault! It's endemic. It exists everywhere, and is
a by-product of good old-fashioned competition, combined with the
exponentially-increasing technological capability that characterizes the
information age, brought about chiefly by the invention of the microchip.
Microsoft is just one of many major players in this field who are
contributing to the blinding pace of technological advancement we are
"enjoying." ;-)

--

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
K

Kevin Spencer

Hear hear!
Everytime I write a program in one and translate it into the other (which
I do all the time because of my books) I find that the change is 99.9999%
mechanical.

Yes, and it's a pain in the butt switching back and forth. I keep adding
semicolons when I shouldn't, or forgetting to add an "End whatever" line to
VB code, or when going back to C#, I find myself playing fast and loose with
case, etc.

--

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
W

WJ

Jesse Liberty said:
I really have to disagree with some of this:
Certainly, now that I'm 50,

Uh Oh! Mr. Jesse Liberty, sorry to run into you. I always thought this is
one of many typical sites for twenty somethings, a nerdy type only, not for
daddy types. Why are you still messing around here at your age ? I projected
myself to pickup newspaper to read when I get to your age, every day... walk
to McDonald have a coffee and reading morning paper. Possibly go fishing....

yay...

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top