From Java to C#: A Developer's Guide
Description:The fastest way for Java developers to pick up C# and .Net - by leveraging on what they already know in Java to learn the new language. *Allows a Java developer to pick up C# as quickly as possible by highlighting the similarities and differences between the two languages. *Extensive detailed coverage of the new features in C# not found in Java. *A useful introduction to the .NET platform and how the new architecture works. It's important for a C# developer to know what happens behind the scenes.User Level: Intermediate. Audience: All intermediate Java developers. Technology: C# is a new programming language which is promoted by Microsoft as the successor to C++. C# together with Visual Basic .NET are the two most popular programming languages .NET developers use to write applications targeted at the .NET platform. Author Biography: Mok Heng Ngee is an experienced software developer and architect who has been involved in numerous large-scale software enterprise projects based on the Java 2 Platform, Enterprise Edition (J2EE). Mok has writes for Computer Times and has been invited to speak at the official launch of Visual Studio .NET in Singapore. He has been accorded MVP (Most Valuable Professional) status by Microsoft Asia.
Good transition primer from Java to C#
When a developer is making or considering the move from Java to C#, the features of C# can be placed into three general categories. Those that are the same in both languages, those that exist in both languages but where there is a difference in behavior and those that do not exist in Java. In general, a book whose purpose is to assist the transition from Java to C# should mention most of what is in the first category, list and explain the differences and thoroughly describe those in the third category considered essential. It is not necessary to cover everything in C# that is not in Java, as some of the less widely used features can be left to more detailed language manuals.
Given this background, the author succeeds in providing an effective primer for those considering a transition from Java to C#. Since that is the premise of the book, it will be of little help if you are transitioning from C++ to C# and no help if you are trying to learn C# without knowing Java or C++. The author is quite correct in making no attempt to cover all of the features of C# where there is no comparable feature in Java.
While there are errors and some of the code examples are a bit simplistic, the first is almost impossible to overcome and the second is largely a matter of taste. What I found to be more of a problem was the large number of footnotes, many of which I considered unnecessary. The note `A sealed class in C# is a final class in Java.` appeared several times, even after sealed classes were covered in the main text. A reasonable person could guess the meaning of the sealed keyword and once told, would not have to be reminded. Others would have been handled in a much better way if the wording of the text had simply been altered. At other times, the footnote is much longer than it needed to be. For example, on page 16 there is a footnote that explains the unsigned keyword in C/C++ and how it allows for the `sign bit` to be used to store larger positive integers when the unsigned keyword is used. In my opinion, over twenty words could have been cut from that note and there would have been no significant reduction in knowledge transfer.
I can recommend this book for developers experienced in Java who are considering or planning a move to C#. All others will find it of limited or no value
Awkward, Dry, and Uninformative
I bought this book based on the unanimous five star reviews posted here and was deeply disappointed. I honestly have no idea how someone can give this book five stars.
First of all, it is full of grammatical errors, some of which cause the entire section's conclusion to be ambiguous. Often the wrong word is used. For instance, the author begins one section by saying that there are many differences in paramater passing between in Java and C#, and then proceeds to list only similarities. Even when the writing is clear it is painfully dry, even for a computer book. The entire book reads like a laundry list, with no suggestion as to which features might be helpful or which might be confusing.
The various bullet points offer no explanation as to their relevance. For instance, at one point the author goes at length into describing how, in constrast to Java, a method can't return an object that is less accessible than the method itself. That sounds reasonable, but why is this the case? What issue in the Java security model does this address? What Java security considerations does this render moot? All the author suggests is to try it and see the compiler error.
More importantly, the entire focus of the book is wrong. The author glosses over most of the .NET framework and spends his time concentrating on the differences between the Java language and the C# language. The .NET framework itself is where the real architectural differences lie. I'd like something that tells me which .NET class to use in place of each Java class I know. The book doesn't even include an appendix for this. And truth be told, Java and C# are very, very similar. I don't need five pages explaining how I should use a colon instead of the word `extends`.
When the book does address fundamental differences in the languages, it does so only on the most superficial level. For example, it mentions that while Java threads offer an isInterrupted() method, C# threads do not. But it gives no indication as to what replaces what is essentially Java's only external thread control mechanism. The only thing it says is that in C# suspend() and abort() take effect only in `safe` situations. The definition of `safe` is left to the reader's imagination.
Perhaps worst of all, the author gets tons of facts wrong about Java. The size of integers, nesting of exceptions, and the definition of daemon threads are just of few of the many errors the author makes in describing the Java language. With so many mistakes, I can't help but wonder if he was giving me an accurate picture of C#.
If you have more than a very rudimentary knowledge of Java, you will learn more from browsing the class docs in .NET than you will from reading this book. If you don't, there will probably be better books for you anyway. In short, save your time and save your money and look elsewhere.
A great transition book.
Hearing a lot about C# since it was announced, I wondered how similar it was to Java and C++, which I'm more than familiar with. This book stopped the wondering, and started the learning of C# without needing to go into introductory concepts about programming. It provides enough parallels from Java so that you can feel at home, and when covering topics exclusive to C#, they are described in enough detail that you can feel comfortable with them.
I've also dealt with another book on the topic, C# for Java Developers, and found it to be biased against Java; no surprise, considering that book is published by Microsoft. From Java to C# seems to be a much more balanced look at the transition. As a C++ programmer, I was entertained by the coverage of operator overloading, which was eased in as something new to Java developers. The pointer chapter is priceless as well.
All in all, a great transition book.
Essence of C# for Java Developers
Mok's book is the best amongst the few targeted at the same group of Java audience. It focuses specifically on the new C# language, rather than how to make use of Visual Studio.net (which really isn't what I was looking for - I mean, Visual Studio.net is just an IDE, & I think the emphasis on learning a new language such as C# should be placed on the language itself, rather than the tool.)
This book will appeal to current Java developers who needs to pick up C# (the langauge) as quickly as possible. There is no beating about the bush, though important language concepts which may affect the design & architecture of your program are covered with sufficient detail. I particularly enjoyed reading the 1st chapter on a brief intro to .net as a whole. That chapter itself gave me a really strong foundation on .NET, & puts things in clear eagle-view perspective.
If you are a Java developer, & want to pick up C# quickly, this is the book to get. If you don't know Java, look elsewhere.
Very balanced treatment of C# and Java
As a Java developer, I've stood aside from the Java versus C# debate that has been boiling since Microsoft first released C#. The interminable debates on the web and at programmers' forums,,. Never actually learnt C#, until I came across this book.
Mok expounds specifically for the Java person[*], as that is his background and he thinks that there are others like us out there who have a similar curiosity. You can treat the book as a generalised `diff` of the two languages. Which may actually be more useful than the thick hardcover tomes put out by Microsoft, which scrupulously avoid mention of that four letter word, Java. As Mok makes clear, C# has clear intellectual roots in Java, plus C and C++.
In some ways, C# is a mishmash of those languages. It chose to follow Java in things like single inheritance and garbage collection, unlike C++. But it adopts the operator overloading of C++, unlike Java. And, it uses pointers, which is completely forbidden in Java. The last chapter of his book, which dealt with pointer manipulation was a stroll down memory lane. The functionality is straight out of C, and will be home ground for the many C programmers out there. (As I once was, too.) With this capability, it seems like Microsoft is aiming C# at a market from which Java has been virtually locked out - real time systems, where you need direct memory access.
The book seems very balanced in its treatment of C# versus Java. I thought his critiques of Java were fair, as were those of C#. He carefully points out the limitations of both.
[*] = Java man? No, he is extinct.