[java] Moving from Java to C#

Started by
7 comments, last by TheBluMage 18 years, 8 months ago
I'm moving to C# in work, coming from Java background and was hoping someone could answer some questions. My boss told me it's far closer to Java than C++ is this true? He also claims that I would have to spend minimal time learning the new language because of similarities to Java. And most learning would be the new keywords rather than anything else as work will not be conserned with pointers(something I noted when changing to C very briefly) On that note anyone got any ideas on good books for picking up C# when moving from Java development. Thanks Mick
Advertisement
C# was basically designed to be Java plus some other stuff that Java should (erm, doesn't) have, e.g., operator overloading.

So yes, learning C# after knowing Java would require relatively little time. I haven't looked at C# a whole lot before, but from what I have seen, one of the largest difference is what packages (or whatever they're called in the C# world) you "import" (I believe the equivalent C# keyword is "using").
A good book on the language C# is Tom Archer's Inside C# or Liberty's C# Programming.

On the differences, I can only say that the two languages are both semantically and syntactically very much alike, so you should be able to transfer your knowledge quite easily. Of course not all Java idioms can be applied to C#, but almost.

Other than that all you need to know is here: The C# Programming Language for Java Developers.
"We confess our little faults to persuade people that we have no large ones." -Francois de La Rochefoucauld (1613 - 1680). | My blog
I can suggest c# in a nutshell. Since you already program in java you will be able to move through that book and pick up the c# stuff that you need since you have the basic programming concepts down already. It will mostly be learning a few new statements and concepts and you'll be set.
Quote:Original post by rohde
Other than that all you need to know is here: The C# Programming Language for Java Developers.



Brilliant page I have to say. Really enjoying the language too, it is very like Java, except for the "import" "extends" and "super" changed, the gc addition is nice too. I've moved most my knowledge across with the help of Visual C#, but about to put it too the test tomorrow as have to make something that I'm so used to doing in frames.

Chers
Mick
@rohde: Thanks for that link, excellent information.
@rohde oh god i wish i had that link earlier :/.

I started learning c# after doing a few years of java (1.4). I must say that excepted a few feature which look strange (not virtual by default mhhh?) and the code editing in visual studio which is not as good as eclipse, c# is really good language and that it's features are rather nice :).
Not only does C# provide operator overloading. It can also drop to "Unsafe code" and you can use pointers. Even though that is highly unrecommended it is still a usefull feature when its need arises.
My JournalComputer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter. (Eric Raymond)"C makes it easy to shoot yourself in the foot. C++ makes itharder, but when you do, it blows away your whole leg."-- Bjarne Stroustrup
I learned C# after knowing only Java and the transition was very easy for me. All I had to do was get familiar with the new framework, change a few keywords and voila, instant C# code. As you continue using C# you will learn to use some of its more advanced features (pointers, pass by reference variables, structs, etc). Personally, even though I learned Java first, I still feel a lot more able to accomplish just what I want in C#. (Not to diss Java or anything. I still love the language, it's just a close second for me now.)

This topic is closed to new replies.

Advertisement