Where to start out first?
-
That's a matter of choice really. Neither will help you in the .NET world, but C++ is still the dominiant programing language in the non-.NET world. So that'd be good to learn eventually, but won't help you for .NET. VD is really useless, it's a crap programming language anyway (.NET or no), so I wouldn't suggest it. VB.NET and C# are really the same language (remember that CLI thing?), but one looks like VC and one looks like C#. C# is cooloer and slightly more powerful amd I would suggest it. You'll also have a bit of familiarity with the syntax since you know JavaScript. So, I suggest you learn C#, and C++ if you want to (although it's not gonna be used in .NET). Skip all falvors of VB altogether if you can. You won't be missing much.
-Domenic Denicola- [CPUA 0x1337] MadHamster Creations "I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
Thanks for all the info! Isn't C# and C++ a lot harder to implement? I thought that's why programmers used VB for applications that don't depend on high optimisation (since it looks a lot simpler and less strict than C++?). Anyway, I'll start checking that out and see. Thanks!
-
Thanks for all the info! Isn't C# and C++ a lot harder to implement? I thought that's why programmers used VB for applications that don't depend on high optimisation (since it looks a lot simpler and less strict than C++?). Anyway, I'll start checking that out and see. Thanks!
merlin9876 wrote: Thanks for all the info! No problem. It's nice to see someone who's interested for a change :) merlin9876 wrote: Isn't C# and C++ a lot harder to implement? Well, put it this way. In 5th grade, after messing around with HTML and JavaScript for a while, I moved straight into C++ and pretty much mastered the language by 6th grade. From 6th - 7th, I had taken my understanding to the point where I was programming with the DirectX 7 and 8 COM APIs, as well as a some MFC. In 8th grade, I learned C#. I am currently going into 9th grade. I never even heard about VB and VB.NET until I came to CodeProject, actually. I'd seen people using BASIC, but always thought it looked rather, well, basic. So if I can do it in 5th grade, you can too! In general, I think C# is easier than C++, but more powerful (because it's .NET). C++ has some advanced features such as templates, multiple inheritance, pointers, etc. that make it more complex, but also better for programming certain things. VB used to be the language of choice for quick GUI programs, because of how it was set up in the Visual Studio 6 package. Apparently it was a lot easier than MFC, the only other Microsoft package for GUI applications at the time. I wouldn't know, though, because that's the far past by now. With Visual Studio .NET, there is no reason to use VB.NET over C#. It's simply for people who want to use a VB-like language instead of a C++-like language. The GUI development is the same (Windows Forms with the .NET Framework), there's the same Form Designer for each of them, the who IDE is the same. Yes, it is a LOT simpler than C++. VB (notice not VB.NET) is simpler than C#. But if you're going to be working with .NET (highly recommended), you'll be using VB.NET or C# (or Managed C++, but that's a whole 'nother story... not recommended except when you need some unmanaged code to combine with managed code in the same source file), which have almost the same level of simplicity. Plus, C# is a lot better, cooler, more powerful, and I just plain like the sytax better. Tell me now, would you like to do these nice curly bracket thingies:
{ code here }
. Or would you go with something ugly like:Begin code here End
;P Any more questions, I'm happy to help.-Domenic
-
merlin9876 wrote: Thanks for all the info! No problem. It's nice to see someone who's interested for a change :) merlin9876 wrote: Isn't C# and C++ a lot harder to implement? Well, put it this way. In 5th grade, after messing around with HTML and JavaScript for a while, I moved straight into C++ and pretty much mastered the language by 6th grade. From 6th - 7th, I had taken my understanding to the point where I was programming with the DirectX 7 and 8 COM APIs, as well as a some MFC. In 8th grade, I learned C#. I am currently going into 9th grade. I never even heard about VB and VB.NET until I came to CodeProject, actually. I'd seen people using BASIC, but always thought it looked rather, well, basic. So if I can do it in 5th grade, you can too! In general, I think C# is easier than C++, but more powerful (because it's .NET). C++ has some advanced features such as templates, multiple inheritance, pointers, etc. that make it more complex, but also better for programming certain things. VB used to be the language of choice for quick GUI programs, because of how it was set up in the Visual Studio 6 package. Apparently it was a lot easier than MFC, the only other Microsoft package for GUI applications at the time. I wouldn't know, though, because that's the far past by now. With Visual Studio .NET, there is no reason to use VB.NET over C#. It's simply for people who want to use a VB-like language instead of a C++-like language. The GUI development is the same (Windows Forms with the .NET Framework), there's the same Form Designer for each of them, the who IDE is the same. Yes, it is a LOT simpler than C++. VB (notice not VB.NET) is simpler than C#. But if you're going to be working with .NET (highly recommended), you'll be using VB.NET or C# (or Managed C++, but that's a whole 'nother story... not recommended except when you need some unmanaged code to combine with managed code in the same source file), which have almost the same level of simplicity. Plus, C# is a lot better, cooler, more powerful, and I just plain like the sytax better. Tell me now, would you like to do these nice curly bracket thingies:
{ code here }
. Or would you go with something ugly like:Begin code here End
;P Any more questions, I'm happy to help.-Domenic
Domenic [_Geek_n] wrote: Or would you go with something ugly like: Begin code here End That sounds like Pascal or FORTRAN, not VB ;P The large difference is in syntax:
// C#
public int Foo(int f)
{
System.Console.WriteLine("{0}", f);return f;
}' VB.NET
Public Function Foo(f as Integer) as Integer
System.Console.WriteLine("{0}", f)Foo = f
End FunctionJames "Java is free - and worth every penny." - Christian Graus
-
Domenic [_Geek_n] wrote: Or would you go with something ugly like: Begin code here End That sounds like Pascal or FORTRAN, not VB ;P The large difference is in syntax:
// C#
public int Foo(int f)
{
System.Console.WriteLine("{0}", f);return f;
}' VB.NET
Public Function Foo(f as Integer) as Integer
System.Console.WriteLine("{0}", f)Foo = f
End FunctionJames "Java is free - and worth every penny." - Christian Graus
James T. Johnson wrote: hat sounds like Pascal or FORTRAN, not VB Guess so. I suppose I just remembered seeing the "End Function"s and "End If"s and such, and automatically moved VB into the "Begin/End" bin in my mind. However, you must admit that the C# approach just looks better, doesn't it. I suppose that's just me, though. Also much more compact: without spaces, it looks like VB is 94 characters while C# is 66. Now of course I'm not whining about file size, as we all have 80 gig hard drives and such, but just in terms of logical structure and compactness, and fitting the same information into a smaller space with no unreasonable squishing, the C# syntax is the clear winner. Can't forget multi-line comments either.
-Domenic Denicola- [CPUA 0x1337] MadHamster Creations "I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
-
James T. Johnson wrote: hat sounds like Pascal or FORTRAN, not VB Guess so. I suppose I just remembered seeing the "End Function"s and "End If"s and such, and automatically moved VB into the "Begin/End" bin in my mind. However, you must admit that the C# approach just looks better, doesn't it. I suppose that's just me, though. Also much more compact: without spaces, it looks like VB is 94 characters while C# is 66. Now of course I'm not whining about file size, as we all have 80 gig hard drives and such, but just in terms of logical structure and compactness, and fitting the same information into a smaller space with no unreasonable squishing, the C# syntax is the clear winner. Can't forget multi-line comments either.
-Domenic Denicola- [CPUA 0x1337] MadHamster Creations "I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
-
I'd be interesting in hearing about these, for as you can see, I'm rather uneducated in the whole VB area.
-Domenic Denicola- [CPUA 0x1337] MadHamster Creations "I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
-
I'd be interesting in hearing about these, for as you can see, I'm rather uneducated in the whole VB area.
-Domenic Denicola- [CPUA 0x1337] MadHamster Creations "I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
The one that will make some C# users jealous is that there is a VB.NET construct to attach a method to an event via the method signature; instead of having to attach it manually in the constructor.
' VB.NET
Public Sub MyButton_OnClick(sender as Object, e as EventArgs) Handles MyButton.Click
...
End Sub// C#
// Constructor
public MyForm()
MyButton.Click += new EventHandler(MyButton_OnClick);
}public void MyButton_OnClick(object sender, EventArgs e)
{
...
}Its merely a bit of short hand; but something that could save a bit of typing over time. VB.NET still offers Late-binding; which is currently not possible with C# unless you wish to use Reflection. I'm not positive on the syntax; but if it is VB6 style it is usually done like so
Public Sub CallFoo(o as Object)
o.Foo()
End SubEven though the Object class doesn't have a method
Foo
you can make a call to it without having to cast it up to the correct type. In traditional ASP this is done all the time because VBScript lacks support for types other than Variant.' VBScript
Dim o
set o = Server.CreateObject("MyComponent.Foo")o.Foo()
As I said it is possible to do the same with C#; its just not as straight forward.
// C#
public void CallFoo(object o)
{
Type t = o.GetType();MethodInfo mi = t.GetMethod("Foo");
if( mi != null )
mi.Invoke( o, new object [] { } );
}Not nearly as straight forward and it only gets worse if the method is overloaded. James "Java is free - and worth every penny." - Christian Graus
-
The one that will make some C# users jealous is that there is a VB.NET construct to attach a method to an event via the method signature; instead of having to attach it manually in the constructor.
' VB.NET
Public Sub MyButton_OnClick(sender as Object, e as EventArgs) Handles MyButton.Click
...
End Sub// C#
// Constructor
public MyForm()
MyButton.Click += new EventHandler(MyButton_OnClick);
}public void MyButton_OnClick(object sender, EventArgs e)
{
...
}Its merely a bit of short hand; but something that could save a bit of typing over time. VB.NET still offers Late-binding; which is currently not possible with C# unless you wish to use Reflection. I'm not positive on the syntax; but if it is VB6 style it is usually done like so
Public Sub CallFoo(o as Object)
o.Foo()
End SubEven though the Object class doesn't have a method
Foo
you can make a call to it without having to cast it up to the correct type. In traditional ASP this is done all the time because VBScript lacks support for types other than Variant.' VBScript
Dim o
set o = Server.CreateObject("MyComponent.Foo")o.Foo()
As I said it is possible to do the same with C#; its just not as straight forward.
// C#
public void CallFoo(object o)
{
Type t = o.GetType();MethodInfo mi = t.GetMethod("Foo");
if( mi != null )
mi.Invoke( o, new object [] { } );
}Not nearly as straight forward and it only gets worse if the method is overloaded. James "Java is free - and worth every penny." - Christian Graus
Wow! You learn something new every day, it seems. Although I'm curious... why wasn't the C# version of
CallFoo
(assumingo
was really an instance of FooClass):// C#
public void CallFoo(object o)
{
((FooClass)o).Foo();
}? Still not as convenient, of course. I wonder why they haven't added this to C#, if it was available through .NET in the first place?
-Domenic Denicola- [CPUA 0x1337] MadHamster Creations "I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
-
Wow! You learn something new every day, it seems. Although I'm curious... why wasn't the C# version of
CallFoo
(assumingo
was really an instance of FooClass):// C#
public void CallFoo(object o)
{
((FooClass)o).Foo();
}? Still not as convenient, of course. I wonder why they haven't added this to C#, if it was available through .NET in the first place?
-Domenic Denicola- [CPUA 0x1337] MadHamster Creations "I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
Domenic [_Geek_n] wrote: // C# public void CallFoo(object o) { ((FooClass)o).Foo(); } This is early binding ie. at compile time the compiler knows what type to look at to resolve the method call. In the VB.NET and the C# Reflection examples the binding is resolved at run time. In COM this is would be done via the IDispatch interface. James "Java is free - and worth every penny." - Christian Graus
-
Domenic [_Geek_n] wrote: // C# public void CallFoo(object o) { ((FooClass)o).Foo(); } This is early binding ie. at compile time the compiler knows what type to look at to resolve the method call. In the VB.NET and the C# Reflection examples the binding is resolved at run time. In COM this is would be done via the IDispatch interface. James "Java is free - and worth every penny." - Christian Graus
Oh, OK. Makes sense. Thanks.
-Domenic Denicola- [CPUA 0x1337] MadHamster Creations "I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."