I have become very good with visual basic 6.0 and 2005.
I want to get out of the easy stuff and move on to C#
i have a few questions though
how do i do an IF statement in c#?
how do i do a 'dim' in c#?
and a last question..
what is the difference between c# and vb, Dont say its more advanced because i know that
but what im trying to get at is can i really do a lot more in c# than vb?
because i am very, very good in vb
What is your favorite visual designing program?
if statement looks like this
I'll use 2 checkboxes as an example
Dim statements are like this
You declare the variable type before the variable instead of after
Well the difference between C#.net and VB.net in performance is C# performs a little bit better than VB. They both get compiled into the same IL language, but C# is optimized and compiles better code. The syntax is obviously different. I would say C# is more object oriented than VB, not that you can't write object oriented code in VB, C# is just more based on it. If you are really comfortable with VB, then you don't absolutely need to switch to C#, but maybe if you would like something to do then you could, or if you want to keep up with the changing technology. Learning another language probably wouldn't be that hard, it's not the syntax that's difficult with programming anyway, it's the concepts, and you can learn those in any language.[/code]
I'll use 2 checkboxes as an example
Code: Select all
if( checkBox1.checked)
{
// insert code for when checkBox1 checked is true
}
else if(checkBox2.checked)
{
// insert code for when checkBox2 checked is true
}
else
{
// insert code for when neither are checked
}
You declare the variable type before the variable instead of after
Code: Select all
// vb.net looks like this I believe:
// Dim s As String = "hey there"
// here's the C#.net
string s = "hey there";
// another example
// In vb.net(I think):
// Dim ofd As OpenFileDialog = new OpenFileDialog
OpenFileDialog ofd = new OpenFileDialog();
No.. C# gives you more access over your code, thus the possibility to better optimise it.OwnZ joO wrote:Well the difference between C#.net and VB.net in performance is C# performs a little bit better than VB. They both get compiled into the same IL language, but C# is optimized and compiles better code.
Yes. C# tends to be more inclined towards using symbols, ie. '!' instead of 'Not', C# is also case sensitive.OwnZ joO wrote:The syntax is obviously different.
Wut. Both languages were made to be object-orientated >_>OwnZ joO wrote:I would say C# is more object oriented than VB, not that you can't write object oriented code in VB, C# is just more based on it.
Yea there's some truth in that. If Microsoft are going to bring something new to the table, then it's C# that'll normally be compatible first. XNA is a good example of that.OwnZ joO wrote:[...]or if you want to keep up with the changing technology.
Halo 2 Prophet - Skin with ease with the simple 3D point and click interface.
Halo 3 Research Thread - Contribute to the research into Halo 3.
Halo 3 Research Thread - Contribute to the research into Halo 3.
- FullMetalParka
- Posts: 16
- Joined: Wed Jun 28, 2006 2:42 pm
- Location: Richmond, BC