C# shows error why not VB?

  • Thread starter Thread starter schneider
  • Start date Start date
S

schneider

C#
In Function or Property, if you don't return a value, the IDE gives you an
error "Function does not return a value"

VB
Does nothing


Anyone going to fix this (MS) ?

There's also several other cases like this....

Thanks,

Schneider
 
similar items to be Fixed:

Not all code paths are hit.
Variable is never used.

All I can think of right now...

I develop in C# at work so I see these things....

I'm surprised, this is the kind of things I would expect to see in C#. Most
C# programmers have no idea what VB.NET/IDE features they are missing...

Are they fixing this in the latest releases?

Thanks,

Schneider
 
Hi Scheider,

Because that Herfried is not active some days, I write it for him, that he
finds very bad and he never forgets to add that to this kind of messages.

However searching for all those answers about this from him I found this.

http://www.google.com/[email protected]

I found that a very nice answer.

Cor
 
schneider,
As Cor stated, VS.NET 2005 (aka Whidbey, due out in 2005) has added support
for most or all of these warnings.

Note, I really don't see that VB.NET is "broken" per se so I don't really
consider any thing being "fixed" in the next version.

For information on VS.NET 2005 & to download a beta copy see:

http://lab.msdn.microsoft.com/vs2005/

Hope this helps
Jay
 
schneiderwrote:
C#
In Function or Property, if you don't return a value, the IDE gives you an
error "Function does not return a value"

VB
Does nothing


Anyone going to fix this (MS) ?

There's also several other cases like this....

Thanks,

Schneider

It's not broken because VB automatically returns the default value of
the method return type if you haven't explicity set it. C# does not
attempt this.
 
Yes I forgot about the Function thing.
Although i think its bad practice to us the function name. If you rename the
function it causes problems. And if Option Explicite if Off even harder.

Anyway C# all has the message "Variable is never set/used".

All I'm saying is C# does a few thing better, to prevent errors.

Hopefully it's all there in the new release..

This would be a good check for FXcop....

Schneider
 

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

Back
Top