Link to home
Start Free TrialLog in
Avatar of XK8ER
XK8ERFlag for United States of America

asked on

apps made using .net

hello there,
I have VS2010 and I had a question about developing apps using C# and vb.net
I was wondering if anything that can be coded in C# can be also coded in vb.net or not?
Avatar of wasiftoor
wasiftoor
Flag of United States of America image

This is almost always true because both C# and VB.net because although both languages are compiled using their own individual compiles, the .NET Common Language Runtime (CLR) is responsible for converting the Common Immediate Language (CIL) to native machine code.

There are syntactical differences off course. Take a look at the following link to look at examples of common syntactical differences.

http://www.harding.edu/fmccown/vbnet_csharp_comparison.html
Avatar of XK8ER

ASKER

I understand and is it possible to write in C# everything that has been done using C++ prog language?
Avatar of Chinmay Patel
No :) C++ Goes way beyond C#. But yes Visual C++ is everything. Though C# has unsafe extensions to possibly do everything that can be done by C++, I have a strong feeling that VC++ wins hands down.

PS: I am a hardcore C# fan :)
Yes. It could be done.   VC++.net is close to C++.  There are 30+ (or even more by now) languages built  targeting .net framework.
NO. C# can use external libraries to achieve everything you can do in C++ but C# is still managed language and therefore by itself has limitations. You could possibly write the same software but not with the same amount of optimisation.

Unmanaged C++ has more control over the way memory and devices are accessed meaning it can do more when it comes to lower level access to them. For example a 3d graphics developers would use native C++ over C# in fact they would use unmanaged C++ over managed C++.
C++ uses pointers, enabling it to work directly with the computer memory, one of the main causes of instability and security problems in the 90's.

As most new languages that came after that, pointers are not available in C#. So even if the syntax is the same, most C++ code uses pointers that cannot be used in C#. If you see C++ code that has variables with an asterisk in their name, it cannot be converted directly to C#. Classes are often available in the framework to perform the same operations, but you would have some rewriting to do to use those instead of pointers.

As for VB and C#, the declarations (variables, if, for) need to be rewritten, and both languages use a different way of defining events, but you can usually copy and paste big portions of the code, because the real work is done by the framework classes, and both languages use the same classes. The only differences when you call methods or work with properties is that C# needs a ; at the end of each line while VB takes a carriage return, and array and collection indexes are between square brackets [ ] in C# while they are between parenthesis in VB ( ).
Avatar of XK8ER

ASKER

good information in here!
I have a lot of apps written in C, C++, C#, VB.net and some work on windows, mac and linux..
I have basic knowledge on them but I would like to specialize in one language of those 4 so i would like to know what do you guys recommend looking ahead into the future.
If you work in a multiple OS environment, and unless you have to write applications that are very close to the system (drivers and the likes) or require a lot of performance (games, graphics), go for C#.

C is dead. It is not object oriented, and most programming nowadays that is not simple scripting is OO.

C++ is going away because of the problems I was talking about in the first line of my last post.

VB is Microsoft only and although you can write and compile VB programs in Windows that will work on other platform, testing and debugging is a pain because VB is not available on other platforms.

C# is an open language. There are compilers and editors provided by third parties for almost all the other operating systems out there.

And the guy who tells you to go for C# is a trainer specializing in VB, who likes VB more than he does C# (for a few reasons that have nothing to do with your question, so I won't start the war here).
Avatar of XK8ER

ASKER

okay so basically vb.net and c# should be top ones?
SOLUTION
Avatar of shanejh
shanejh
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
JamesBurger it is portable, yes, but there are still limitations which is why platforms such as Mono exist.