Should I go in to c# as well?

Im currently learning C++ and i find it a fantastic language but should i also go in to c#? Are they similar? or is one more advanced/power-fuller than the other?

Thanks In Advance!
I actually love c# I'd recommend having it in your tool-belt.
C# is my favourite language. I see it as "C++ done right." It's not without it's faults, but it has far less of them than any other language I've ever used (except maybe Haskell but I didn't use that for very long). The syntax is very similar to C++. The only things you'll need to learn are a few minor differences in the way objects work (C# is a true object-oriented language, OOP in C++ seems kind of half-assed IMO, probably because Stroustroup wanted to retain some semblance of backwards-compatibility with C, so C++ really is just "C with classes"), the keywords, and the .Net framework (which is, IMO, much better than the C++ standard library).

There are two main reasons to use C++ over C# - one is if you need greater computational performance (but even then, you can just write some parts of your C# program in C and retain the same performance as an equivalent C++-only program) and the other is if you want to use references. C++ references are vastly superior to references in C#. There's no point even learning about references in C#, you probably won't ever use them and even if you do you probably shouldn't.
I wonder if C# is tied to the .NET runtime? If it is, then the program you wrote is most likely Windows specific? Are there Linux .NET runtime already?
I've started to pick up some C# this past semester, and I definitely like it. I find it most similar to Java and of course both are similar enough to C++ that it shouldn't be to hard for you to grasp. The only concept I'm having trouble with in C# (so far) are delegates.

@chrisname
I haven't had the need to use C# references yet, but can you explain a little why they are inferior to C++ references?
@Sohguanh

Take a look at monodevelop.com
In short, there is a compatible .NET alternative for *nix flavors. (it's even been ported to iOS and Android)
I have learned C++ pretty thoroughly myself and I am learning ASP.net so I can be in demand but I feel like I am spending most of my time learning HTML, CSS, and SQL/LINQ syntax instead of C# for the server-code.

It's really overwhelming do to the syntax because you can't just use logic to code stuff, you have to spend hours and hours looking up the syntax or you get constant unhandled exception errors.

I wonder if I should just focus on learning C# though and leave the markup and database querying alone.
If you have the desire and the ability, yes, definitely. Each language you learn enriches your vocabulary of concepts, paradigms, etc. There are parts of C++ which I appreciate (a lot) only because I know APL.
naraku9333 wrote:
I haven't had the need to use C# references yet, but can you explain a little why they are inferior to C++ references?

C++ references are more flexible (C# references can only be used in a method) and, though it's not a big thing, C# references have two keywords - ref and out - and the only difference is that with ref you have to initialise the variable before passing it to a method, which IMO is pointless. I haven't used references in C# yet, either. I was going to use them once, but then I realised I didn't need to, and did something else instead.

http://www.codethinked.com/ten-c-keywords-that-you-shouldne28099t-be-using
Topic archived. No new replies allowed.