I have already studied C, and C++. I googled for the best programming languages. Somewhere I found c# also. I want to know that, what type of programming language is this. I heard that C is useful in writing operating systems, C++ in gaming and i also used it in gaming, Java(which also I'm planning to study in upcoming days) is useful for application designing. I want to know that where c# is most useful, what are the advantages that will be gained after knowing all about C#.
And, at last why should i learn c# as I already know c, and c++.

Recommended Answers

All 9 Replies

c# is a great tool when you want to built applications rapidly. it has a great built-in framework that you can work with. using c# you can create windows applications, web applications, web services, mobile applications and windows services. c# is my favorite language.

Sharp is great for doing anything quickly. Its not the most powerful, and its not the fastest. But it gets the job done.

also, there is a framework called XNA. it is for writing 3d games for windows and the XBOX360. XNA It is exclusively C#.

It is fairly easy to learn, straightforward, and object oriented. It has THICK requirements, the .net framework, which has to be the right version for your app to run. and you get no warning if its not. It just crashes. So almost all C# apps are installed using MSI, which checks for the required framework. the code doesn't compile to native, and runs through the CLR, you don't have direct memory access, all this is what is referred to as "managed". It has its drawbacks, but its so easy to learn compared to C++.

you certainly can't create operating systems with it, nor dos, or any outside of windows applications period. there is a framework hack for Linux, but its not a guaranteed thing. If you are familiar with programming, go ahead and pick it up. Like I Said its pretty easy to learn.

C# together with the .NET environment and Visual Studio lets you develop an application very quickly. It gives a weird feeling in the beginning, it feels like you are out of control of everything. You must of course stay in control and know what you are doing if you want to develop anything serious. You can do that of course, but it is handy to know that this c# system e.g. takes care of the boring details of setting up a button control.
In C#, everything is an object, even an integer.
C# is also a very strict language. A boolean is a boolean. In C you can mix boolean and integer in C# not, I like that.

Syntax in C# is very similar to C/C++, so the transition will be very easy and the compiler errors should look familiar.

You will no longer be able to manipulate pointers like you could in C++, which is a selling point to corporations, but a slight to major inconvenience at first to learning C# coming from a C background. Also, you will no longer be able to set "data" breakpoints because of this feature.

Functions become methods in C#, and you cannot assign values to arguments in the prototype/signature of the method. Although, I read a few months back that they were going to add this feature to the C# language in the next release.

Inheritence: you can only inherit a single base "class" in C#, which is a different way of thinking after developing in C++. C# makes heavy use of "interface" objects.

>>>You will no longer be able to manipulate pointers like you could in C++,
Sorry DdoubleD to correct you, look at this C# code:

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            unsafe
            {
                int i = 4;
                int* ip = &i;
                *ip *= *ip;
                Console.WriteLine("My int = {0}", i);
                Console.ReadKey();
            }
        }
    }
}

If you feel happy about coding that way by all means do(I hate it) but C# will still allow it as long as you put everything between the unsafe keyword.
You also have to set a checkbox(Allow unsafe code) in the Build options of the properties of your project.

True. However, note the keyword "unsafe" and take heed. Since you already come from a C/C++ background, I would suggest writing any necessary pointer manipulations in that language and keeping your C# code clean of such practices because .NET allows you easily mix languages. Also, consider that the C# environment does not support address level debugging, which is another good reason to preserve good managed code.

Ha, that is also very true. Did I not mention that I hate unsafe code?
( Perhaps because I have some C/C++ background ;) )
Just pointing out that if someone really wants to use it in C# he can!
This is the last time I did this, believe me.
BTW. The outcome of my pointer mumbo jumbo should be 16, everyone can see that immediately of course:)

Unsafe code has its advantages, there are some instances you will find that you just can't get the performance you desire without using pointers. I have had that trouble twice. Both times were related to images.

Whenever you need to develop an application, you can use the C# .Net.Windows,Mobile,Web,etc...C# is the best for me...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.