Saturday, July 05, 2003 10:51 AM Jan Tielens

What's missing in VB.NET and C#?

Roy has made a very nice list what is missing in his opinion in VB.NET and C#. I listed Roy's points below which I totally support, and I added my own wishes too:

VB.NET

  • No more underscores ('_') to break lines!
  • Multiple lined comments!
  • XML comments (this would be in the next version I read).
  • Edit and continue.
  • C# property style: no more Readonly statements, if there is no Set, than the property is Readonly!
  • C# casting style "(type)".

C#

  • Background compilation, underlining errors!!!!
  • Case insensitive, since there are case insensitive languages that can use C# assemblies.
  • VB.NET-like Intellisense for enums and namespace writing.
  • Automatic creation of "()" on method calls.
  • With statement!
  • Edit and continue.

Comments

# re: What's missing in VB.NET and C#?

Friday, July 04, 2003 11:24 PM by Stephane Rodriguez


I have always thought VB.NET was missing a programming syntax, on top of a few thousands other things. Glurp!

# re: What's missing in VB.NET and C#?

Saturday, July 05, 2003 12:58 AM by Jan Tielens

Wow, what a nice comment Stephane! It's really adding something to the discussion. Thx!

# re: What's missing in VB.NET and C#?

Saturday, July 05, 2003 1:20 AM by Roy Osherove

Huh. Forgot about edit and continue, how that for forgetful?? Its my single most important gripe that its not there....

# ISerializable

Saturday, July 05, 2003 4:51 AM by TrackBack

ISerializable

# re: What's missing in VB.NET and C#?

Saturday, July 05, 2003 5:55 AM by Sam Gentile

Let me the first of hopefully many to correct you both in that C# has Edit and Continue in VS.NET 2003 (which has been out for some months).

# re: What's missing in VB.NET and C#?

Saturday, July 05, 2003 5:56 AM by Sam Gentile

And Visual Assist.NET (http://www.wholetomato.com) adds #1, #3, #4 among many other things. I find it a must have.

# re: What's missing in VB.NET and C#?

Saturday, July 05, 2003 8:19 AM by yeah right

Hey, I have an idea...why the fuck don't you just turn C# into VB.NET...that seems to be what you are trying for...

# re: What's missing in VB.NET and C#?

Sunday, July 06, 2003 10:40 AM by Thomas Freudenberg

Since I am a C# developer with C++ background, please let C# case sensitive! Regarding the With statement, it's hard to convert VB.NET samples to C# because of the missing WithEvents statement.

# re: What's missing in VB.NET and C#?

Tuesday, July 08, 2003 8:01 AM by Scott Swigart

C# is also missing a background compiler, which helps greatly with IntelliSense.

VB.NET is missing operator overloading.

C# is missing a simple mechanism for late binding.

VB.NET is missing unsigned types.

C# is missing optional arguments.

VB.NET is missing unsafe code.

The list goes on and on.

And to clarify a previous post, VS 2003 does NOT provide Edit and Continue for VB.NET or C#.

# Thomas Freudenberg

Wednesday, January 21, 2004 5:36 AM by Marc

'With' and 'WithEvents' are two completely different things!

'With' allows you to reference an object without having to specificy that object each time, eg:

With Form1.Controls.TextBox1
.Text = ...
.Enabled = ...
End With

(simple example, but sometimes you have to set a lot of properties on an object multiple levels deep).


WithEvents is short hand for [event] += New System.EventHandler([eventHandler])

# re: What's missing in VB.NET and C#?

Thursday, February 05, 2004 3:42 PM by dasmb

It seems to me that VB6 nonsense like WithEvents and optional variables just gets recompiled, anyway. I can't see how you can have a concept like delegates and then break it by pretending events are sent by variable name, not by object. And as for optional arguments...i constructed a class in VB and another in C# that had nothing but a constructor which made three assignments. In VB, I made them optional. In C#, I made 8 seperate constructors for each of the possibile ways to call the constructor (which them called the most complete constructor with their own defaults). I compiled them both with the same switches and dependencies...the VB file was 20% larger. Implies to me that it's coding each calling signature as its own individual method. I'll stick with doing it myself, thanks.

# re: What's missing in VB.NET and C#?

Tuesday, March 30, 2004 5:48 AM by boris

I would find it really useful if within a with block I could refer to the with object directly. This would enable me to pass the object as a parameter to a method for example. In the english dictionary this concept is

with myObject.subProperty.subProperty
.property1 = value
myString = .property2
myOtherObject.Method( ~ , value2 )
end with

'instead of...
dim tempRef as ClassName = myObject.subProperty.subProperty
with tempRef
.property1 = value
myString = .property2
myOtherObject.Method( tempRef, value2 )
end with
tempRef = nothing



# ammendment!

Tuesday, March 30, 2004 5:49 AM by boris

oops, I forgot to finsh the sentence. It should read: In the english dictionary this concept is denoted by the tilda character (~)

# re: What's missing in VB.NET and C#?

Tuesday, April 27, 2004 2:02 AM by Anders Sidwall

I'm only going to comment things that are NOT going to be implemented in the next version of .NET Framework.

1. Property ReadOnly is good for readablity. It should be "C# is missing Readonly".

2. CType is used in VB (compared to (type) in C#). Which is better is a matter of taste.

3. VB is missing a way to turn the background compiler off. In large projects it can get very slow.

4. C# can use unsafe code. Good or bad? Bad if you ask me, because you should avoid using unsafe code.

5. VB has optional parameters. Good or bad? Not sure myself so I try to avoid using them (uses overloading instead), in fact I haven't used them so far.

6. C# is missing WithEvents. In my opinion WithEvents is great for readabilty and fully sufficient in many cases (not all though).

7. C# is missing implements object.Method. In VB you specify which method that implements an interface. Great for readabilty and flexibility.

I'm sure there is much more, but that will do for now.

# C# vs. VB

Tuesday, July 13, 2004 1:41 PM by Reader

I program in both C#.NET and VB.NET and have experience in VB, C++, and Java.
In .NET 2003, at least, C# supports continue. I whish VB.NET would as well. In my experience, VB.NET is too verbose. WithEvents, ReadOnly, Implements, are just a pain.

Overall, I think C# is preferable, and I hope it never degrades to the point of losing case-sensitivity. Laslty, if you call a method, add your own (). There's no excuse for being lazy.