Moving from VB.Net to C# [closed]

2019-04-11 22:35发布

I'm seriously considering moving from VB.Net to C#. If you made the jump to C# from vb.net, then what were the best resources you used to learn the language going from novice to pro?

Thanks

9条回答
贼婆χ
2楼-- · 2019-04-11 22:54

In pre .net days, there was a real perception (and deservedly so) of VB being for kids and the C languages being for grown ups. The .net Framework has changed (the reality if not the perception of) all that. I don't recall seeing anything in c# that couldn't be done in VB. I don't do VB very much so I don't remember irritating things about the language, in c# two pet peeves for me are the case sensitivity and the syntax of the for loop. Neither of which apply to the VB language. So the question is, are you sure you need to change?

查看更多
女痞
3楼-- · 2019-04-11 22:56

I use this VB.NET C# comparison reference all the time.

查看更多
Deceive 欺骗
4楼-- · 2019-04-11 22:58

Maybe one of the best things to do is to rewrite some of your VB code, some classes, i was a vb coder some time ago, and one of the things i did was write the NerdDinner App in C#, following the Scott Gu tutorial it really help me.

查看更多
地球回转人心会变
5楼-- · 2019-04-11 23:03

Since you know Visual Basic .Net, you will not have much difficulty on learning C#

Besides other posts Visual Basict .Net to C# converter will help you too much.

You can write your code in Visual Basic .Net and see the equivalent in C#

http://www.developerfusion.com/tools/convert/vb-to-csharp/

查看更多
欢心
6楼-- · 2019-04-11 23:07

OJT worked for me. the framework is the same. Syntax is "just another language" to learn. People get hung up on "what langauage" far too often. Skills I learned as an assembly language programmer are just as valid in higher-level languages.

The VB editor in Visual Studio does have some nice features.

查看更多
\"骚年 ilove
7楼-- · 2019-04-11 23:07

Programming C# is a great reference.

You'll struggle with the syntax (End versus curly brace and semicolons), but the transition should be somewhat smooth. It's just understanding the differing syntax which will make it frustrating.

Choosing between C# and VB.NET

The only major difference between the two languages is that C# can break out of the ‘managed’ world of .NET to support unsafe code should this be required. However unsafe code is, as its name suggests, inherently hazardous and you may feel that it is a good thing to avoid using it. Explicit use of pointers is seldom required when programming .NET. If you really feel that you cannot do without pointers, then C# would be a good choice of language. If you are happy to work within the managed world of .NET, then C# or VB.NET would be equally suitable for your purposes.

Of course, there are other .NET languages available too. At first sight, C++ might seem the most attractive choice for programmers with previous experience of that language. You need to be aware, however, that the .NET version of C++ is best used for manipulating unmanaged memory. In most cases, C# would be a better choice of .NET language for a programmer with C++ experience. Unlike C++, the C# language was specifically designed for the .NET Framework. It benefits from a simple syntax, garbage collection and type safety to eliminate many potential bugs.

查看更多
登录 后发表回答