Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Programming Books Media Book Reviews IT Technology

C# for Java Developers 382

joefrench writes: "It might seem strange to review a C# book on Slashdot, especially one published by Microsoft, but I felt that there must be a lot of readers like me -- programmers who know Java, but want/need to learn something about C# and .NET. C# for Java Developers aims to teach experienced Java programmers how to write in C#." Joe outlines what he considers the book's good points (many) and weak points (few) in the rest of his review, below.
C# for Java Developers
author Allen Jones, Adam Freeman
pages 548
publisher Microsoft Press
rating 9
reviewer Joe French
ISBN 0735617791
summary A comprehensive C# from Java tutorial

First things first

First of all, let's deal with the Microsoft issue. I was surprised to find that this book even existed given the problems MS has had in the courts recently. I was even more surprised to find that C# for Java Developers is very balanced and does not hype up C# at the expense of Java -- throughout the book there are places where the authors say that "Java is better at this" or "We have no idea what the C# designers were thinking." A refreshing attitude from a company that is not known to be an admirer of Java.

I was reluctant to pay for a Microsoft book, but I have to admit that I am impressed. This is the first MS book I have ever purchased, and it is clearly written, well thought-out and very, very comprehensive. One of the best features for me is that all of the instructions for compiling and managing code assume that you are using the command-line tools, rather than Visual Studio. For someone on a tight budget, this was a real bonus.

The Scoop

The first part of the book is an overview of .NET, and contains the boiler-plate description that you get from the .NET web site. Not that useful, but pretty short. There is a chapter that compares .NET to Java (J2SE and J2EE), but again, there is nothing new or important there.

The second part of the book covers the C# language, using Java as a starting point. The coverage seems comprehensive, and explains where the two languages are the same (quite often), where they are different (now and then) and when they appear to be the same, but you are likely to spend a couple of hours tracking down something weird (more often than I would like). I had started playing around with C# before buying this book, and all of the problems that I had in the early days were detailed here with clear explanations.

Part three delves into the .NET class library, covering basic topics such as collections, IO and handling XML. Once again, I was impressed with the depth of coverage and the way in which the authors use Java classes to explain the workings of .NET. It was while I was reading through this section that I realized just how different C#/.NET and Java can be.

The last part of the book covers "advanced" topics. There seems to be little reason for the division between basic and advanced topics, but chapters cover areas such as threading, security and networking. The one thing that is consistent in this part of the book is that there is less of a parallel between Java and C#. For example, "Windows Forms" is used to build client UI applications, but is very different toolkit from Swing/AWT.

The appendix list is a little dull, covering topics like GC and configuration files. There are some interesting snippets, but I got the impression that these were topics that the authors thought were important, but didn't know where else they should go. The exception is the "Java to .NET API Reference" which, for me at least, sets this book apart from the competition. Every class from the J2SE class library is mapped to an equivalent .NET class and a reference to where the topic is covered in the book -- having something like this has saved me hours of searching.

What's to Consider?

This book uses a lot of C# fragments to demonstrate how classes are used, but contains very few full "working" examples. I found this to be great once I knew the basics of C# (because I could focus on the topic), but difficult at first (because I could not play with complete code).

C# for Java Developers covers much more of the .NET Framework than the other books in my local bookstore, but because of this the text can be dense at times, as the authors try and pack in a bit too much detail.

I can't find major fault with this book, and a (small) part of me admires Microsoft for publishing such an unbiased book.

Summary

If you are a Java programmer who wants or needs to learn about C# and .NET, then this is a great book. Don't be put off by the Microsoft logo, and bear in mind that you don't need a copy of Visual Studio to follow the examples.

The book effectively uses Java as a tool to teach C# and explain the workings of .NET. If you are like me, then you will find this book invaluable and will likely keep it close at hand for quick reference.

Table of Contents

  1. Introducing .NET
    1. Introduction to Microsoft .NET
    2. Comparing Java and .NET Technologies
  2. The C# Language
    1. Creating Assemblies
    2. Language and Syntax Features
    3. Data Types
    4. Advanced Language Features
  3. Programming .NET with C#
    1. Strings and Regular Expressions
    2. Numbers and Dates
    3. Collections
    4. Streams, Files, and I/O
    5. XML Processing
  4. Advanced Topics
    1. Reflection
    2. Threading and Synchronization
    3. Networking
    4. Remoting
    5. Database Connectivity
    6. Security and Cryptography
    7. Graphics and UI
    8. Introduction to XML Web Services
  5. Appendices
    1. Platform Integration
    2. Shared Assemblies
    3. Configuring Applications
    4. Garbage Collection
    5. Cross-Language Code Interoperability
    6. Java to .NET API Reference


You can purchase C# for Java Developers from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

This discussion has been archived. No new comments can be posted.

C# for Java Developers

Comments Filter:
  • by Carnage4Life ( 106069 ) on Tuesday September 03, 2002 @11:41AM (#4189162) Homepage Journal
    The article C# From a Java Developer's Perspective [25hoursaday.com] which appeared on Slashdot last year [slashdot.org].

    Mirrors:
    1. Mirror 1 [soften.ktu.lt]
    2. Mirror 2 [monash.edu.au]
    3. Mirror 3 [infoiasi.ro]
    4. Mirror 4 [geneura.ugr.es]
    5. Mirror 5 [stevens-tech.edu]
    Translations:
    1. French [dotnetguru.org]
  • by SadatChowdhury ( 512992 ) on Tuesday September 03, 2002 @11:41AM (#4189171)
    If anyone wants to port Java application to .Net platform, wouldn't it make more sense to use J#? With .Net's language insensitive nature, C# vs J# should not matter, and so J# would naturally make more sense to someone wanting to attempt to port a Java application into the .Net platform.
  • by km790816 ( 78280 ) <wqhq3gx02@@@sneakemail...com> on Tuesday September 03, 2002 @11:48AM (#4189224)
    Slow down, turbo.

    No one at Microsoft likes VB.NET. It was meant as a crutch to get old VB developers into the new programming model.

    All of the .NET class libraries were written in C#. I don't think they are planning no changing that in the near future.
  • by Zapman ( 2662 ) on Tuesday September 03, 2002 @11:53AM (#4189276)
    They're not Oreilly, but they do have a good reputation for quality books. Code Complete and Rapid Development are amazingly good books by Steve C McConnell, put out by MS press.
  • by MORTAR_COMBAT! ( 589963 ) on Tuesday September 03, 2002 @12:25PM (#4189491)
    No registration required: download [microsoft.com] the Microsoft .NET Framework SDK [microsoft.com]. Includes command line utilities, documentation, etc.

    The sound you here is a dozen moderators clicking 'Troll'.
  • mono for windows (Score:4, Informative)

    by MORTAR_COMBAT! ( 589963 ) on Tuesday September 03, 2002 @12:48PM (#4189656)
    Just downloaded the excellent 4 MB mono 4 windows [formativ.net] as mentioned in an earlier thread, and as a C# hobbyist, let me tell you, it is a pretty nice way to get acquainted with the language without having to download the 150 MB or so of the full .NET SDK.

    And as is said elsewhere, every language has its place. C# is pretty nice for building Windows native applications. If you don't want to do that, then use a different language.

    More on-topic, I'll definitely be checking this book out of the company library.
  • by the eric conspiracy ( 20178 ) on Tuesday September 03, 2002 @02:44PM (#4190526)
    After I read that I article I also came away with the impression it was highly biased. Nowhere does it describe some of the significant advantages that Java has over C# such as checked exceptions, inner classes, class granularity reflection, a far better collections implementation and so on.

  • by thomas.galvin ( 551471 ) <slashdot&thomas-galvin,com> on Tuesday September 03, 2002 @02:51PM (#4190568) Homepage
    This is typical code you might write in Java or C++:

    foo.setSize (getSize () + 1);
    label.getFont().setBold (true);

    The same code you would write like this in C#:

    foo.size++;
    label.font.bold = true;


    Now, if that isn't biased crap then I must be the guy bending over at goatse.cx. The rest of the article goes on in much the same way.


    Actually, IIRC, C# supports some syntactic sugar called "accessors;" basically, label.font.bold = true maps to a call to label.getFont().setBold(true). They didn't make the member data publically acessible, they just lowered the keystrokes to call simple mutator methods.
  • VB.NET (Score:3, Informative)

    by Bodrius ( 191265 ) on Tuesday September 03, 2002 @04:26PM (#4191209) Homepage
    Well, I don't know about Microsoft, and I do know a lot of VB developers that hate VB.NET with all their guts, but I have to say I find it impressive for the same reasons they hate it: it's a language that forces OO design, uses modern libraries, and in the end it's all source code.

    I'm not a big fan of VBisms such as "MustOverride", "MustInherit", "NotInheritable" etc, which can easily become unreadably verbose for my taste as you combine them, but after trying it out for a couple of simple apps as an experiment I find it an outstanding improvement over the original VB.

    I think it's perfectly feasible to build a relatively big project in VB.NET without destroying some hardware and going on Prozac, as I would expect with any other VB.

    Not that I would, but it has become a matter of taste or distaste for the VB-like syntax, not a major disfunctionality of the language itself.

    VB.NET is a crutch. But it's a crutch that manages to fix VB as a language. I consider that an achievement, to say the least.

  • by broody ( 171983 ) on Tuesday September 03, 2002 @04:55PM (#4191378)
    As for all these Frameworks; can any single one of you actually describe, in under 200 words, exactly what the .NET Framework is, what its comprised of, and why I should find it so exciting? ...

    Will anyone take the challenge, I wonder?


    Don't confuse this with advocacy, .Net is a a know they enemy technology. Below you will find my 188 word summary. Comments and corrections are welcomed. I think Passport.NET has been canned but I am not certain.

    Microsoft.NET is a product, note not a standard, intended to develop enterprise class web services. Microsoft.NET is comprised of ASP.NET, .NET managed components, and Host Integration Server, with additional hooks for SQL Server, Passport.NET, Exchange, Commerce Server, Application Center, etc. ASP.NET can render interfaces in HTML, XHTML, XML or using Windows forms.

    Microsoft.NET is mostly a rewrite of Windows DNA with enhanced language support and web services. The primary 'benefit' is language independence and inter-operability. The .NET framework includes the Common Language Runtime (CLR) which operating as an intermediary layer providing automatic garbage collection, cross-language inheritance, and concurrent execution of different versions of a .NET component. It also provides SOAP, WSDL, UDDI support for web services and will soon support ebXML [ecommercetimes.com].

    There are several pluses for the Mircosoft.NET framework and a great deal of draws with J2EE. The programming model is simpler than J2EE. The .NET framework provides language neutrality rather than forcing you to treat other languages as separate applications. Both .NET and J2EE require training, can create enterprise web services today, offer scalable enterprise solutions, and are available on the low end.

It is easier to write an incorrect program than understand a correct one.

Working...