Click here to Skip to main content
15,913,933 members
Home / Discussions / C#
   

C#

 
GeneralVB.NET or C# Pin
Luis Ricardo16-May-04 6:48
Luis Ricardo16-May-04 6:48 
GeneralRe: VB.NET or C# Pin
Bee Master16-May-04 7:04
Bee Master16-May-04 7:04 
GeneralRe: VB.NET or C# Pin
Luis Ricardo16-May-04 8:10
Luis Ricardo16-May-04 8:10 
GeneralRe: VB.NET or C# Pin
Stefan Troschuetz16-May-04 7:19
Stefan Troschuetz16-May-04 7:19 
GeneralRe: VB.NET or C# Pin
Colin Angus Mackay16-May-04 8:47
Colin Angus Mackay16-May-04 8:47 
GeneralRe: VB.NET or C# Pin
Luis Ricardo16-May-04 9:24
Luis Ricardo16-May-04 9:24 
GeneralRe: VB.NET or C# Pin
TigerNinja_16-May-04 18:34
TigerNinja_16-May-04 18:34 
GeneralRe: VB.NET or C# Pin
sreejith ss nair16-May-04 19:37
sreejith ss nair16-May-04 19:37 
Syntactically, Visual Basic .NET and Visual C# .NET are two different languages, just as Visual Basic, Visual C, and Visual C++ are different languages. Visual C# .NET looks more familiar to Visual C, Visual C++, and Java programmers, and Visual Basic .NET looks more familiar to Visual Basic developers. The biggest differences between the languages fall into the following categories:

Case sensitivity

dentifier names in Visual Basic .NET are not case-sensitive, but identifier names in Visual C# .NET are case sensitive.

Variable declaration and assignment

Variables in Visual Basic .NET are declared with the variable before the data type. In Visual C# .NET, the data type precedes the variables.

Data types

Integer in Visual Basic .NET is int in Visual C# .NET. However, System.Int32, the .NET Framework base type for which Integer and int are aliases, can be used in both languages. Visual C# .NET also supports the signed byte, unsigned short, unsigned int, and unsigned long data types, which are not available in Visual Basic .NET.


Statement termination


Statements in Visual Basic .NET are terminated by the end of the line. You can use the colon (Smile | :) to put multiple statements in a line, and you can use the line continuation (_) character to make a statement span several lines.
Statements in Visual C# .NET are terminated by the semicolon (;). You can use multiple statements per line, and statements can span multiple lines.


Statement blocks


Visual Basic .NET does not use arbitrary statement blocks. Instead, certain keywords that have a specialized terminating statement are used instead of the statement blocks.
In Visual C# .NET, braces ({}) are used to delimit a statement block; otherwise, a single statement is assumed.


Use of () vs. []


Visual Basic .NET uses parentheses () to delimit array elements, function arguments, and property indexes.
Visual C# .NET uses parentheses () to delimit function arguments, and brackets ([]) to delimit array elements and property indexes.

Error handling


Visual Basic .NET supports both structured and unstructured error handling, but Visual C# .NET supports only structured error handling.


Overflow checking


Visual Basic .NET has a project level setting to check for overflow. However, the checking can only be turned on and off at the project level, instead of at the level of an expression or a block of code. Visual C# .NET statements can run in either a checked or an unchecked context. In a checked context, arithmetic overflow raises an exception error. In an unchecked context, arithmetic overflow is ignored and the result is truncated. This can be used on an expression or a block of code.


Late binding


Both Visual Basic .NET and Visual C# .NET can implement implicit late binding through reflection. However, implementing late binding in Visual Basic .NET is much easier than in Visual C# .NET.


Handling unmanaged code

Visual C# .NET permits you to write unmanaged code. In unmanaged code, you can do things such as declare and operate on pointers, perform conversions between pointers and integral types, and take the address of variables. In a sense, writing unmanaged code is much like writing Visual C code in a Visual C# .NET program.

n Visual Basic .NET, you cannot write unmanaged code.



Sreejith S S Nair
GeneralModifing the configuration of an IIS virtual dir Pin
Mauricio Ritter16-May-04 6:43
Mauricio Ritter16-May-04 6:43 
GeneralRe: Modifing the configuration of an IIS virtual dir Pin
Heath Stewart16-May-04 11:57
protectorHeath Stewart16-May-04 11:57 
Generalregd datagrid Pin
karteek16-May-04 6:19
karteek16-May-04 6:19 
GeneralRe: regd datagrid Pin
Heath Stewart16-May-04 12:12
protectorHeath Stewart16-May-04 12:12 
GeneralGranting/Demanding a custom permission Pin
Mike Hodnick16-May-04 5:01
Mike Hodnick16-May-04 5:01 
GeneralRe: Granting/Demanding a custom permission Pin
Heath Stewart16-May-04 12:02
protectorHeath Stewart16-May-04 12:02 
GeneralRe: Granting/Demanding a custom permission Pin
Mike Hodnick17-May-04 5:27
Mike Hodnick17-May-04 5:27 
QuestionHow can I transfer the video stream use usb cam Pin
haruntopuz16-May-04 4:02
haruntopuz16-May-04 4:02 
AnswerRe: How can I transfer the video stream use usb cam Pin
Dave Kreskowiak16-May-04 4:32
mveDave Kreskowiak16-May-04 4:32 
AnswerRe: How can I transfer the video stream use usb cam Pin
Wackatronic30-May-04 12:06
Wackatronic30-May-04 12:06 
GeneralTransfering Images with TAPI Pin
Member 69108916-May-04 2:59
Member 69108916-May-04 2:59 
GeneralRe: Transfering Images with TAPI Pin
Dave Kreskowiak16-May-04 4:28
mveDave Kreskowiak16-May-04 4:28 
QuestionGetBaseline from Font? Pin
Roger Alsing16-May-04 2:39
Roger Alsing16-May-04 2:39 
AnswerRe: GetBaseline from Font? Pin
leppie16-May-04 4:09
leppie16-May-04 4:09 
GeneralSerial communication problem Pin
wk_vigorous16-May-04 0:10
wk_vigorous16-May-04 0:10 
GeneralRe: Serial communication problem Pin
Anonymous16-May-04 1:21
Anonymous16-May-04 1:21 
GeneralRe: Serial communication problem Pin
wk_vigorous16-May-04 21:52
wk_vigorous16-May-04 21:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.