Book offers detailed comparison of C# for Java developers

Though many developers consider C# to be a Java copycat, this book says otherwise. Find out how the two languages compare in this recent Apress publication.

Many eyebrows were raised when Microsoft abandoned Java support in its development tools and operating systems. Suspicions were further aroused with the introduction of C#. Many Java pundits cried foul, calling for Sun Microsystems to sue because of the similarities between Java and C#. As a certified Java programmer, my interest was immediately piqued to learn more about C#. .NET Development for Java Programmers from Apress satisfied my curiosity.

.NET Development for Java Programmers

By Paul Gibbons
July 2002
432 pages
ISBN: 1590590384
List price: $49.95

Easy layout
The book begins with a basic introduction to C# and progresses into deeper coverage of the language and the .NET framework. The second chapter compares the base C# language with Java; this type of comparison is sprinkled throughout the book. As a Java developer, having something familiar compared for illustration made it much easier to understand some of the concepts. In addition, there is an excellent comparison of the Java JVM and .NET CLR.

Once the language and platform have been covered, the book progresses into more advanced topics like working with Windows forms, ASP.NET, and ADO.NET. These technologies do not have a corresponding Java technology, so the comparison stops in these chapters. The side-by-side discussion picks up momentum in the rest of the book, including working with multithreading, networking, application distribution, and XML. I might mention that a thorough knowledge of these concepts in Java makes it a breeze to pick up their .NET counterparts. Later chapters cover advanced topics such as working with external C/C++ routines, messaging, Active Directory, and Windows Services.

A core aspect of the J2EE platform is component-based development with Java Beans. Chapter 10 covers this topic and offers the .NET alternative called COM+, and extensive coverage of working with legacy COM code is also included. I found chapter 11 to be the most useful; it covers the packaging and distribution of .NET applications as opposed to the Java approach. I needed to deploy a simple C# application at the time, which explains my interest in the material. The chapter exhausts the subject with thirty pages chock full of valuable information for packaging and installing applications.

Where is the code?
The book is full of useful code snippets and complete applications in both Java and C#. These validate the concepts presented in the book. The book doesn't include an accompanying CD with the code samples, but they are available from the Apress Web site. However, I had a problem locating the book on the site. It isn't listed under Java or .NET, so I had to use the search feature with the book’s ISBN.

A common occurrence with technical books of this nature is code mistakes, but I found nothing disturbing when working through the text. The code is easy to read, includes detailed explanations, and leaves but a few holes in the concept explanations.

The book discusses both .NET SDK for command line compilation and Visual Studio .NET in chapter 1, but the SDK is never mentioned again; Visual Studio .NET receives all the attention. However, the book targets Java developers, so this was a big mistake; it's erroneous to anticipate a Java developer possessing Visual Studio .NET, when the .NET SDK is available as a free download from Microsoft. In addition, free tools, such as SharpDevelop, offer a low-cost alternative that many Java developers are more likely to favor until they're completely sold on .NET.

The closing chapter of the book is a major disappointment. The title “Migrating to .NET” promises much more than it delivers. A paltry six pages is clearly insufficient for such a topic. I anticipated valuable advice for migrating from Java to C# (J2EE to .NET), but it read like pages hurriedly added with no real useful information.

A good beginning
This book provides a good .NET introduction for a Java developer. It lays the groundwork for future development efforts. Other books are available that focus on particular aspects of .NET, so these should be pursued when necessary. If you are a Java programmer who's curious about the .NET world (especially C#), I recommend that you pick up this book to calm your nerves.

Editor's Picks