×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

C# for Java Developers

timothy posted more than 11 years ago | from the pointy-pointy dept.

Programming 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.

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.

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

382 comments

wow great (0)

Anonymous Coward | more than 11 years ago | (#4189095)

This is great. I think I 'll get the book.

C# (1)

TerryAtWork (598364) | more than 11 years ago | (#4189102)

This is a maligned language. I think it will prove important in the future, if only beacuse it helps people make their complexity quota, which some people seem to have.

Re:C# (2)

RevDobbs (313888) | more than 11 years ago | (#4189138)

I think it will prove important in the future, if only beacuse it helps people make their complexity quota,

Funny, I thought that C# was supposed to reduce complexity.

Although pronouncing it "C-sharp" is a little counter intuitive; my first thoughts are always "C-pound". The maybe the first `Obfuscated C#' contests can center on it's name.

Re:C# (2)

Idarubicin (579475) | more than 11 years ago | (#4189204)

Although pronouncing it "C-sharp" is a little counter intuitive; my first thoughts are always "C-pound". The maybe the first `Obfuscated C#' contests can center on it's name.

I believe it was The Register which approached this topic in some detail. For me, I've found that the best cross-cultural pronunciation is "C-hash". "C-octothorpe", though perhaps the most precise and technically correct, doesn't roll off the tongue nearly as fluidly.

Re:C# (0)

Anonymous Coward | more than 11 years ago | (#4189231)

"C-Pound"? That would be C£, surely?

Yes yes, The Register have already tackled this one...

Maligned? (2, Interesting)

p00ya (579445) | more than 11 years ago | (#4189355)

It's disappointing to see so many developers give c# a rough time. I really do not see how c# is any more maligned than other languages.

It really is just scared developers concerned that anything redmond can cough up is too mainstream and below them...

Take a look at the ecma standards, download mono, and crawl out of your shell.

How Is "Odd"?? (-1)

Anonymous Coward | more than 11 years ago | (#4189116)

With all those huge Visual Studio.NET ads on slashdot, I'm just waiting for when I need a .NET Passport to logon to Slashdot. Or will it be called Slashdot.NET?

Good Stuff! (-1)

Anonymous Coward | more than 11 years ago | (#4189123)

Since C# is obviously the future of .NET programming, and since .NET is the future of the internet, You Bet I'm interested in this.

Too bad there isn't a free version of this; I'd ditch my toy Linux/GCC combo in a heartbeat if there was!

Re:Good Stuff! (2)

pmz (462998) | more than 11 years ago | (#4189196)

C# is obviously the future of .NET programming

Perhaps.

.NET is the future of the internet

Absolutely not.

.NET is an acronym for "Proprietary Lock-In". Keep this in mind as you learn C# and immerse yourself into the .NET "experience".

Re:Good Stuff! (0)

Anonymous Coward | more than 11 years ago | (#4189246)

.NET is an acronym for "Proprietary Lock-In". Keep this in mind as you learn C# and immerse yourself into the .NET "experience".


Hey! If that's true, can't sun sue them for use of a trademarked acronym?

Again, I repeat ".NET is the future of the internet". You get a kewpie doll for noting it's proprietary (not that's an esp relevant point...do you REALLY expect to get EVERYTHING for free?)

Re:Good Stuff! (0)

Anonymous Coward | more than 11 years ago | (#4189430)

Do you know what I do when I have nothing to say?

Re:Good Stuff! (2, Interesting)

thedarkstorm (468783) | more than 11 years ago | (#4189219)

There is a somewhat free version available for Linux. It's called Project Mono I believe. Here is the URL:
http://www.ximian.com/devzone/projects/mono. html

Small SUmmary from page, "The Mono Project is a community initiative to develop an open source, Linux-based version of the Microsoft.NET development platform. Incorporating key .NET compliant components, including a C# compiler, a Common Language Runtime just-in-time compiler, and a full suite of class libraries, the Mono Project will enable developers to create .NET applications and run them on Windows or any Mono-supported platform, including Linux and Unix. Besides greatly improving the efficiency of development in the open source world, the Mono Project will allow the creation of operating-system-independent programs. "

Re:Good Stuff! (0)

Anonymous Coward | more than 11 years ago | (#4189385)

Mono is pretty neat. My only reservation about it is that
I am afraid Microsoft will come along with some stealth
patent and start to charge licensing fees for anything
written for Mono. ECMA doesn't guarantee that there will be
no future patent claims on the language or the runtime, only
that Microsoft didn't disclose any during the submission process.
I realize I am being a little paranoid, but remember who
we're talking about here.

Re:Good Stuff! (0)

Anonymous Coward | more than 11 years ago | (#4189240)

It is free, the compilers and all. Just runs on windows only though.

Re:Good Stuff! (0)

Anonymous Coward | more than 11 years ago | (#4189264)

If it's free, where's the source? Java licensing isn't great, but .NET licensing is the opposite of freedom.

Re:Good Stuff! (0)

Anonymous Coward | more than 11 years ago | (#4189375)

free as in beer, "playing dumb" guy...

C# may not stand for long... (4, Insightful)

FortKnox (169099) | more than 11 years ago | (#4189124)

Now, C# is a pretty language. MS looked at Java and started on their list... "This is good in Java, lets include it. This isn't, lets either not include it or make a nicer alternative." They made quite a nice, competitive language.

But I think C# will be used to convert the C, C++, and Java crowd into the .NET framework. Now, once you are in the framework, you'll see that VB.NET is easier to use, has the OO that Java/C++ people desire, and can make the deadlines easier to make.

Yeah, I think C# is MS's way to convert everyone to VB.NET.

Luckily, .NET isn't as platform independent as Java atm, so I'll stick with my cup-of-joe.

Re:C# may not stand for long... (0)

Anonymous Coward | more than 11 years ago | (#4189152)

IIRC, Didn't MS cover that by releaseing some .NET code to run under FreeBSD?

Or are you just karma whoring again||still?

Re:C# may not stand for long... (1)

FortKnox (169099) | more than 11 years ago | (#4189164)

which is why I added 'atm' meaning "at the moment".
Yes, .net is being ported to Linux and BSD.

Re:C# may not stand for long... (1, Interesting)

Anonymous Coward | more than 11 years ago | (#4189183)

Problem is is that VB.NET isn't easier to use. It's actually harder and in many ways fits strangely around the .NET framework. That along with an obvious lean toward C# in all the docs I'd say VB is not long for this world. Look for C# to take over completely in the next 2-3 releases of M$ dev products.

Re:C# may not stand for long... (5, Informative)

km790816 (78280) | more than 11 years ago | (#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.

Re:C# may not stand for long... (2)

Pfhreakaz0id (82141) | more than 11 years ago | (#4189318)

exactly. That was gonna be my point. I can tell you, most of the ASP+/.NET examples are in C#, not VB

Re:C# may not stand for long... (2)

Wakkow (52585) | more than 11 years ago | (#4189373)

Is is now safe to say that Microsoft's goal is to convert people from using C, C++, Java and VB to .NET?

Seems reasonable: get the competition using product.

Re:C# may not stand for long... (2)

Jugalator (259273) | more than 11 years ago | (#4189429)

MS is probably not trying to get people to use VB specifically, but, yes, *that* is safe to assume.

Re:C# may not stand for long... (2)

cscx (541332) | more than 11 years ago | (#4189431)

Another interesting note is that all of Microsoft's .ASP scripts on microsoft.com are written in JScript. Odd that they stay away from VB as much as possible but promote it so much!

Re:C# may not stand for long... (2, Insightful)

El Neepo (411885) | more than 11 years ago | (#4189249)

"Now, C# is a pretty language. MS looked at Java and started on their list... "This is good in Java, lets include it. This isn't, lets either not include it or make a nicer alternative." They made quite a nice, competitive language."

You're right, I think it is a much nicer alternative to Java for client side apps.

"But I think C# will be used to convert the C, C++, and Java crowd into the .NET framework. Now, once you are in the framework, you'll see that VB.NET is easier to use, has the OO that Java/C++ people desire, and can make the deadlines easier to make."

C# is far from just a tool to convert people to the .NET framework. C/C++ people will probably still use C++ .NET if they want .NET development. C# directly targets Java developers, but it can easily be decoupled from the .NET framework (look at Mono). Personally I'd rather not use the .NET Framework for C#, but until Mono becomes more mature I'm stuck using the .NET Class Library unless I want to rewrite all that stuff myself. VB.NET is simply C# with the VB words. VB.NET is nothing like VB6 and earlier. I can't say that 100% but from the VB.NET examples in the class library that sit along side the C# ones, they're so similar.

"Yeah, I think C# is MS's way to convert everyone to VB.NET."

I think its other way around.

"Luckily, .NET isn't as platform independent as Java atm, so I'll stick with my cup-of-joe."

True. I refuse to use ASP.NET on IIS since IIS is such a crock. I hope Mono keeps going strong for client side however.

Re:C# may not stand for long... (1, Insightful)

Anonymous Coward | more than 11 years ago | (#4189270)

But I think C# will be used to convert the C, C++, and Java crowd into the .NET framework.

You can have my C compiler when you pry it from my cold, dead, fingers.

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? It seems to me that even Microsoft arn't clear on this; certainly if they are, they're not doing a very good job of communicating this exciting new technology to me (I don't think I'm the only one, either).

Will anyone take the challenge, I wonder?

Re:C# may not stand for long... (2, Interesting)

Graspee_Leemoor (302316) | more than 11 years ago | (#4189414)

" 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? "

The .net framework is a collection of command-line compilers for various languages which produce bytecode. It also includes the compiler from bytecode to native-code, a disassembler and the .net classes. Basically the .net framework is everything you need to compile and run .net code. It is free as in beer.

There you go. Pipe that to wc -w and I think you'll find I win.

graspee

Re:C# may not stand for long... (1)

xswl0931 (562013) | more than 11 years ago | (#4189274)

I think you're reaching a bit. I don't believe Microsoft really cares if you use C#, VB.Net, JScript.Net, Managed C++, etc... as long as you're using the .Net Framework. That's the whole point of the CLR: language independence. It's not like MS makes more money if you use VB.Net over C#.

Re:C# may not stand for long... (2)

Jugalator (259273) | more than 11 years ago | (#4189411)

Yeah, I think C# is MS's way to convert everyone to VB.NET.

I think the opposite.

C# is made easier than C++. VB.NET is *very* rewritten in .NET to be much more object oriented *and* easy to move from to C#.

But, of course, due to the nature of .NET, it's equally easy to move from C# to VB.NET.

However, C# wasn't written to match VB.NET. VB.NET, on the other hand, went throught one of its greatest rewrites so far to match C#. Make up what you want from that.

C# for non-java developers? (1)

Winterblink (575267) | more than 11 years ago | (#4189125)

This is a great review of a book from the perspective of a Java developer, but has anyone on /. reviewed a decent book teaching the language (period)?

Re:C# for non-java developers? (1)

Strudelkugel (594414) | more than 11 years ago | (#4189232)


Have a look at "Professional C#" published by Wrox, and "Programming Microsoft Windows with C#" by Charles Petzold. I'd recommend any book by Petzold, though!

Re:C# for non-java developers? (1)

Aeron56 (595989) | more than 11 years ago | (#4189278)

2 books that I recommend if you want to learn C# specifics. 1) "Programming C#" , O'Reilly - An Excellent base language primer. 2) "Programming Microsoft Windows with C#", Charles Petzold. - This is sort of a "how to" book to program actual windows apps. Between the two of them, they touch on nearly all that a C# developer would need to start.

Assembly: Why It Will Replace C++/Java (0, Funny)

Anonymous Coward | more than 11 years ago | (#4189128)

Gentlemen,

Computing is a fast-paced field. What was cutting edge yesterday is as outdated as a pet rock today. Newer, more efficient technologies are always being developed. The 8" floppy gave way to the 3.5" floppy which was later replaced by the CD-R. The acoustic modem eventually yielded to the DSL/Cable modem. Unix was overtaken by Windows XP. And so on.

The same technology also applies to programming languages. C yielded to C++ which gave way to C#. However, the time has come for a complete paradigm shift in programming. I propose a de facto migration towards a relatively new, but promising language known as assembly.

Most of you are probably unfamiliar with this langauge. I know I was until I chanced upon it in my community college while completing my MCSE. So allow me to give you a little background on this language:

C++ and Java do not allow the programmer to directly access the hardware. Instead they compile into a "bytecode" which is then interpretted by a virtual machine. While very portable, this limits the speed of Java and C++ programs.

Assembly, however, was designed to allow the programmer *direct access* to the hardware! This makes for *much* faster programs.
Furthermore, assembly is the same language "spoken" by computers.
Because of this, you may sometimes see assembly referred to as "machine code".

I fear that without the support of a large corporation (the way MS has pushed Java, or Sun supported C#) assembly will fall by the wayside like many other interesting languages (Python, I'm looking at you!) Thus I hope to start a "grass-roots" movement to support assembly. I would like to see the FSF release a GNU-based assembly compiler (although they can keep the bugs that have plagued the 3.0 release of gcc which caused people to switch to Visual Studio for their Linux programming.)

I would love to expound on the superiority of assembly over C++/Java but I'm late for my "Intro to TCP/IP" class. Those of you familiar with assembly, please feel free to educate the many ignorant C/C++/Java users on the glory of this superior language.

Thank you and God bless!

Re:Assembly: Why It Will Replace C++/Java (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#4189181)

i wish i had like 10000 mod points so i could rate this +10000, informative!

Aw! What a CUTE lil troll! (0)

Anonymous Coward | more than 11 years ago | (#4189185)

Unix was overtaken by Windows XP. And so on.


Makes me wanna just pinch those shiny lil apple cheeks of yers.

Now go play in the freeway.

Assembly (1)

kyoko21 (198413) | more than 11 years ago | (#4189202)

I like assembly. It has every control over everything. For VB programmers, it will never fly. For the anal-retentive programmer that likes to micromanage everything down to the last bit, assembly is the way to go.

I would like to see more assembly being taught at all levels: high schools and collegiate.

Re:Assembly (0)

Anonymous Coward | more than 11 years ago | (#4189285)

Most kids can't even identify their own country on a map, and you want to teach Assembly in High School? Yeah, sure, that'll fly.

Wow... (2)

ebbomega (410207) | more than 11 years ago | (#4189316)

Once again someone misses the point in its entirety of high-level languages.

If you decide that you're going to stick only to assembly and nothing else, you're going to find little love in the computer industry.

High-level languages are designed so that you don't have to go through a couple billion lines of extraneous code to do something. Sure, if you program in assembler, your code will be cleaner, faster and has a greater potential for looking brilliant to other hackers, but I dare you to try coding around in assembler making a couple of graphics engines and tell me how simple it is in x86 against C++.

I mean, christ, I love assembler. You can do whatever you want with the memory, write self-modifying code, know at all times what is going on with the processor and everything else in the system, but fer crying out loud, if I want to make something as simple as a function call in Motorola HC11 that requires about 6 lines of code per call. A simple 4-line if block can result in a 20-line assembly instruction that would just be bloody easier to do if you just let a compiler automagically run it for you.

While Assembly is pretty, and I encourage that if you want to be a programmer, learn it and use it well, but for crying out loud, don't stop there.

Re:Assembly: Why It Will Replace C++/Java (1)

cpex (601202) | more than 11 years ago | (#4189379)

>However, the time has come for a complete paradigm shift in programming

hey assembly is where it started. and a lot of people still use assembly. Just when your trying to write a full application assembly will just simply take to fricking long but it great for those tiny segments

>C++ and Java do not allow the programmer to directly access the hardware. Instead they compile into a "bytecode" which is then interpretted by a virtual machine. While very portable, this limits the speed of Java and C++ programs.

Ok first of while java is compiled into byto code, C++ is compiled to machine code. Also in C/C++ you can wirte inline assembly to really make some core parts of your code fly.

>(the way MS has pushed Java, or Sun supported C#)

are you backwards?

>I would like to see the FSF release a GNU-based assembly compiler

already there.

Sweet...! (-1, Offtopic)

jsonmez (544764) | more than 11 years ago | (#4189131)

Sweet that book review changed my life... I was a devout linux supporter, but now after reading this review on slashdot I think maybe Windows is the best operating system!

Re:Sweet...! (me too!) (0)

Anonymous Coward | more than 11 years ago | (#4189220)

Actually, for me, it was seeing the ad for Visual Studio .NET here, of all places, that intrigued me. I figured that Cmdr Taco wouldn't put up ads for anything he wouldn't use himself, so I forked over the cash and DAMN!

Linux used to make windows look like a useless toy OS, amazing how the tables have turned, isn't it?

The book has one page. (1, Flamebait)

spiro_killglance (121572) | more than 11 years ago | (#4189134)

And that that page reads:

C# for java developers:

Please Stick to Java. Don't sell you soul
to mickysoft.

Re:The book has one page. (1)

junkpunch (514143) | more than 11 years ago | (#4189272)

Please Stick to Java. Don't sell you soul
to mickysoft.


Exactly. Sell it to Sun instead, because that is better.

Re:The book has one page. (1)

Razzy (175090) | more than 11 years ago | (#4189336)

Okay, I can't take it anymore. No one on slashdot knows the difference between your and you're. In a post body, fine, I won't nitpick. But in a sig? Don't even get me started on the different forms of there. These are things even engineers should know.

Re:The book has one page. (0)

Anonymous Coward | more than 11 years ago | (#4189346)

drop dead

Terrarium (3, Interesting)

killthiskid (197397) | more than 11 years ago | (#4189142)

The thing that finally got me to play with C# was Terrarium [gotdotnet.com] . Players create 'creatures' which then compete in a peer-to-peer set of virtual terrariums. You can create plants, herbivores, or carnivores. It was quite fun (in a super geek way) and VERY challenging.

Refreshing indeed (2, Interesting)

Anonymous Coward | more than 11 years ago | (#4189143)

"... 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."

Try finding that balance in a Java book, most of which devote all of Chapter 1 to a buzzword parade and list of Java perks (prevents bugs, write once run anywhere, cures baldness, etc).

Re:Refreshing indeed (1)

Corporate Troll (537873) | more than 11 years ago | (#4189253)

prevents bugs, write once run anywhere, cures baldness, etc

Hey, but Java cured my baldness! Since I started programming in Java hair has been thriving on my head again!
However, I must admit that Java is a bit low on the "prevent bugs" and "write once run anywhere" things...but to avoid baldness it's clearly there!

Java developers should use J#, no? (1, Interesting)

Anonymous Coward | more than 11 years ago | (#4189144)

J# for .NET is there (its installable already) for Java developers to leverage their Java knowledge in order to create managed applications for deploying on the .NET framework.

Use that.

Wow- C# review on Slashdot? (3, Insightful)

glh (14273) | more than 11 years ago | (#4189147)

I'm really suprised by this (especially with the book being from MS) but I think it is a nice to see on Slashdot.

C# really is a nice language. It is more powerful than other .NET languages (such as VB.NET) because it allows you to write unsafe code (ie, code that doesn't have to go through the garbage collector). Not that most MS programmers will need this capability, but its nice to have if you need the extra performance over maintainability/safety.

C# also gives you the ability to write XML comments in your code that can be parsed by the compiler to generate documentation. There is also an open source project called "NDOC" (hosted on Source Forge) that lets you generate really cool and helpful docs.

However, the majority of Slashdot readers probably don't care how C# is better than other .NET languages. The real question is- how does it compare with Java. Honestly, I believe there are some differences in syntax and power, but I don't know the details (as I am not that experienced with Java) but it would seem this book could help answer that question. I plan on taking a look at this book. Thanks for the review, and again- nice to see this kind of thing on Slashdot!

Re:Wow- C# review on Slashdot? (0)

Anonymous Coward | more than 11 years ago | (#4189217)

The acid test is the ability to compile a kernel with it.

Re:Wow- C# review on Slashdot? (1, Flamebait)

Kynde (324134) | more than 11 years ago | (#4189262)

C# really is a nice language. It is more powerful than other .NET languages (such as VB.NET) because it allows you to write unsafe code (ie, code that doesn't have to go through the garbage collector). Not that most MS programmers will need this capability, but its nice to have if you need the extra performance over maintainability/safety.

Where do these people come from?

C# also gives you the ability to write XML comments in your code that can be parsed by the compiler to generate documentation. There is also an open source project called "NDOC" (hosted on Source Forge) that lets you generate really cool and helpful docs.

Some people really know not just where do we want to go tomorrow, but also where we've been for years now.

Honestly, I believe there are some differences in syntax and power, but I don't know the details (as I am not that experienced with Java) but it would seem this book could help answer that question. I plan on taking a look at this book. Thanks for the review, and again- nice to see this kind of thing on Slashdot!

Ah, now I get it. Mickeysoft's PR/marketing person making a fake appearance in Slashdot. Thank god, and I thought this was for real...

C# the only real choice (2, Funny)

Anonymous Coward | more than 11 years ago | (#4189148)

The thing that makes C# so much better than Java is that there are so many free Java VMs and development tools. If you want a VM for Java, all you have to do is go out to blackdown.org and download one. Well, what does that say about the quality of the language? Back when I was a wee pup we had a phrase, "you get what you pay for." Well, at least C# development tools cost a fair amount, to me that suggests that it is a much better language. After all if Java was so good they wouldn't be giving it away for free.

Also with the upcoming war on Iraq it's best if we're all patriotic and support our country's companies with our hard-earned dollars. Why, if you use Java, you might as well hang an Iraqi flag in your yard and wear a Republican Guard uniform to work every day. That's how important this is. Don't you Java developers feel ashamed of yourselves? I would.

C# not so bad folks (1, Insightful)

Anonymous Coward | more than 11 years ago | (#4189155)

C#/.NET is actually a good thing and Visual Studio.NET is a wonderful product if a bit buggy. .NET to me is the development enviornment including the IL, class libraries, and framework. Since M$ can't define it, I will. =) That said Java is also an excellent technology and I use both in my work. Usually the client already has a preference for one inane reason or the other so I simply work with what they like. The problem with both of these is the learning curve for the library classes.

I would urge slashdot readers not to reject out of hand (even though we're really good at it) the possible benefits of this technology. BTW, I abso-freaking-lutely hate the manner in which Microsoft has conducted itself over the last 5 years or so and think that they should be punished by the courts for anti-competative practices against small companies, in the event you believe me a Bill-zombie.

Hmm... (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#4189156)

14th post!

What was wrong with J# for Java users? (3, Informative)

SadatChowdhury (512992) | more than 11 years ago | (#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.

C: A Dead Language? (-1, Troll)

Anonymous Coward | more than 11 years ago | (#4189174)

Gentlemen, the time has come for a serious discussion on whether or not to continue using C for serious programming projects. As I will explain, I feel that C needs to be retired, much the same way that Fortran, Cobol and Perl have been. Furthermore, allow me to be so bold as to suggest a superior replacement to this outdated language.

To give you a little background on this subject, I was recently asked to develop a client/server project on a Unix platform for a Fortune 500 company. While I've never coded in C before I have coded in VB for fifteen years, and in Java for over ten, I was stunned to see how poorly C fared compared to these two, more low-level languages.

C's biggest difficulty, as we all know, is the fact that it is by far one of the slowest languages in existance, especially when compared to more modern languages such as Java and C#. Although the reasons for this are varied, the main reasons seems to be the way C requires a programmer to laboriously work with chunks of memory.

Requiring a programmer to manipulate blocks of memory is a tedious way to program. This was satisfactory back in the early days of coding, but then again, so were punchcards. By using what are called "pointers" a C programmer is basically requiring the computer to do three sets of work rather than one. The first time requires the computer to duplicate whatever is stored in the memory space "pointed to" by the pointer. The second time requires it to perform the needed operation on this space. Finally the computer must delete the duplicate set and set the values of the original accordingly.

Clearly this is a horrendous use of resources and the chief reason why C is so slow. When one looks at a more modern (and a more serious) programming language like Java, C# or - even better - Visual Basic that lacks such archaic coding styles, one will also note a serious speed increase over C.

So what does this mean for the programming community? I think clearly that C needs to be abandonded. There are two candidates that would be a suitable replacement for it. Those are Java and C#.

Having programmed in both for many years, I believe that C# has the edge. Not only is it slightly faster than Java its also much easier to code in. I found C to be confusing, frightening and intimidating with its non-GUI-based coding style. Furthermore, I like to see the source code of the projects I work with. Java's source seems to be under the monopolistic thumb of Sun much the way that GCC is obscured from us by the marketing people at the FSF. Microsoft's "shared source" under which C# is released definately seems to be the most fair and reasonable of all the licenses in existance, with none of the harsh restrictions of the BSD license. It also lacks the GPLs requirement that anything coded with its tools becomes property of the FSF.

I hope to see a switch from C/C++ to C# very soon. I've already spoken with various luminaries in the C coding world and most are eager to begin to transition. Having just gotten off the phone with Mr. Alan Cox, I can say that he is quite thrilled with the speed increases that will occur when the Linux kernel is completely rewritten in C#. Richard Stallman plans to support this, and hopes that the great Swede himself, Linux Torvaldis, won't object to renaming Linux to C#/Linux. Although not a C coder himself, I'm told that Slashdot's very own Admiral Taco will support this on his web site. Finally, Dennis Ritchie is excited about the switch!

Thank you for your time. Happy coding.

security? (0)

sirius_bbr (562544) | more than 11 years ago | (#4189179)

... but chapters cover areas such as threading, security and networking

Hmm, since when do they care about that ;)

Re:security? (1)

RebelTycoon (584591) | more than 11 years ago | (#4189398)

They do... Its just an advanced topic, so if you are a beginner... Don't worry about it... Publish your stuff to the web.. Since you are only a beginner, we'll cover that next week.

The problem is some "professionals" are really beginners...

Not so strange... (0)

Anonymous Coward | more than 11 years ago | (#4189184)

It might seem strange to review a C# book on Slashdot, especially one published by Microsoft

A few years ago, this would have seemed strange, but with the proliferation of Microsoft banner ads on Slashdot, I've actually been wondering why we don't see more stories like this.

I'm not sure whether I like it or not... I have no special hatred for Microsoft. In fact, I like them more than I like VA Software (LNUX). But it is kind of sad to see Slashdot become yet another Microsoft-sponsored tech site.

C# may not stand for long.... (-1)

cut-N-paste Troll (584533) | more than 11 years ago | (#4189186)

Now, C# is a pretty language. MS looked at Java and started on their list... "This is good in Java, lets include it. This isn't, lets either not include it or make a nicer alternative." They made quite a nice, competitive language.

But I think C# will be used to convert the C, C++, and Java crowd into the .NET framework. Now, once you are in the framework, you'll see that VB.NET is easier to use, has the OO that Java/C++ people desire, and can make the deadlines easier to make.

Yeah, I think C# is MS's way to convert everyone to VB.NET.

Luckily, .NET isn't as platform independent as Java atm, so I'll stick with my cup-of-joe.

Good starting point online (3, Interesting)

km790816 (78280) | more than 11 years ago | (#4189189)

A Comparative Overview of C# [genamics.com]

This is a great site. If anyone wants to learn C# coming from a C/C++ or Java background I send them here. Shows source in all three languages (where applicable). Good place to start.

I must say I was a hard-core Java fan until I found C#. I must qualify that statement since I develop exclusively for Windows.

If you write code that will only live in the Windows world, you owe it to yourself to check out C#/.NET.

Re:Good starting point online (4, Insightful)

Kynde (324134) | more than 11 years ago | (#4189330)

This is a great site.

After a first glance I saw :

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.

I just knew it. For C/C++ coders C# is what Windows is to a proper OS users. It may be easier if you're a numwit, but I'm quite sure that the design is rigid and quite quickly you'll wind face to face with some illogicality or utter impracticality. And there you are... not happy as a clam, but happy as a lion with a hedgehog rammed up in it's butt.

If you're now thinking "well, C++ is flawed, too" the you've missed the point or you only think you know C/C++. There's a big difference in knowing and mastering and my guess is that that in particular will be the problem with C#, as with all other Mickeyware.

Re:Good starting point online (1)

scrytch (9198) | more than 11 years ago | (#4189389)

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.

Biased? Perhaps. It also happens to be true. Your visceral hatred of Microsoft has you defending Java's disgustingly verbose syntactic conventions for properties where yep, they got that wonderful beans model, then proceeded to do absolutely NOTHING with the language syntax to support it.

But the ironic and funny thing is, by polarizing the issue so, you appear to credit Microsoft with the invention of a more intuitive language syntax for property accessors. "Use C#, rabid java partisans on slashdot hate it!"

I bet you thought those were direct property accesses, right? I wouldn't expect such a staunch defender of The One True Faith to actually look up the mechanisms of property declarations...

Crack-smoking moderators (0)

Anonymous Coward | more than 11 years ago | (#4189401)

Your post is eloquent and correct. The parent to which you replied is ridiculous. What idiot modded you down from 2?

What are you talking about? (0)

Anonymous Coward | more than 11 years ago | (#4189331)

Anyone with a clue when reading that link can immediately see the biased nature of the examples given, i.e. using proper encapsulaiton in the c++/Java examples and using none in the C# examples. I quote: 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; You can do exactly the same in C++ and Java, just make the private data public and access directly as you would a C structure member. It's been years since I last looked at C++ but I distinctly remember being able to do that sort of thing.

Re:Good starting point online (1)

jmauro (32523) | more than 11 years ago | (#4189345)

One would think an unbiased compairson would find something java does better than C#. Also, I'm less than trustworth of the article because in the first point it fails to understand the functionality of Java Fields and how they compair to C# Properties.

Windows.Forms (2)

zephc (225327) | more than 11 years ago | (#4189195)

While not part of the language but rather somewhere in the .NET APIs, Windows.Forms is a really cool set of classes and methods that let you do GUI building with relatively little pain. Now I'm no Microsoft apologist, but what they did with Windows.Forms is a LOT nicer than AWT and Swing, and as far as I can tell, the backend was written in native code.
There are some articles about it too. [gotdotnet.com]

C# ~= Java (1, Redundant)

jhol (301546) | more than 11 years ago | (#4189211)

I actually took a course in C# through my company, and even though i was late for the course, I didn't miss anything. Basically C# IS Java, but with a different naming convention.

Anyway, if you know Java already, you don't need a book on 600 pages to get to know C#, all you need is info located for free on the web, here [genamics.com] for instance.

Tempting people with devices of the enemy... (0, Troll)

The J Kid (266953) | more than 11 years ago | (#4189212)

You know what we do with people who temp us with devices of the enemy?

This [bayinsider.com]

Re:Tempting people with devices of the enemy... (0)

Anonymous Coward | more than 11 years ago | (#4189386)

Wow, you're so witty; you must be a genuine genius!

It's pronounced *SEE-SHARP* by the way. (0)

Anonymous Coward | more than 11 years ago | (#4189213)

I just thought I'd point that out, because loads of people seem to be calling it one of the following:

* see-hash
* see-pound
* see-octothorpe
* dee-flat :-)

which are all wrong. Of course you could pronounce it cuh-hash, which sounds a bit like cash, which is something you won't have much of left if you buy a Microsoft product.

Ignorance, or cluelessnes? (2)

Quarters (18322) | more than 11 years ago | (#4189234)

"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."


Where in any of the court documentation for any of the court proceedings that MS is invloved with does it say, "You have to divest yourself of your publishing brand?"

Re:Ignorance, or cluelessnes? (0)

Anonymous Coward | more than 11 years ago | (#4189372)

Is just, by bearest squeak, possible that the trouble referred to was over the Microsoft's use of Java trademark and License?

Engage brain _before_ flaming.

Wow.. review sounds pretty good! (3, Flamebait)

Quixote (154172) | more than 11 years ago | (#4189237)

Too good, in fact. Am I the only one who was reminded of the recenty story about 'stealth advertising', with paid "actors" using cool gadgets as if they were normal users, to create a buzz? This review, with its liberal dosage of "I was skeptical of ... but was pleasantly surprised to find ... " reminds of just such marketing efforts.

Why should it seem strange to mention C#? (5, Insightful)

Tattva (53901) | more than 11 years ago | (#4189243)

It might seem strange to review a C# book on Slashdot

There is absolutely nothing strange with not keeping your head buried in the sand. Just because some folks seem to have a knee-jerk reaction to all things Microsoft doesn't mean Slashdot should be expected to ignore relevant and widespread programming practices.

Re: Why should it seem strange to mention C#? (0)

Anonymous Coward | more than 11 years ago | (#4189280)

Just because some folks seem to have a knee-jerk reaction to all things Microsoft doesn't mean Slashdot should be expected to ignore relevant and widespread programming practices.

Looks like their marketing works just fine. Like the entertainment industry, who declares their product as stars before anybody even got to know them, Microsoft has told us, through books and journals, a lot about .NET and C# before it even existed.

Re: Why should it seem strange to mention C#? (2)

Tattva (53901) | more than 11 years ago | (#4189328)

Just because some folks seem to have a knee-jerk reaction to all things Microsoft doesn't mean Slashdot should be expected to ignore relevant and widespread programming practices.
Looks like their marketing works just fine.

It's true I have only anecdotal evidence to back up my assertion that C# and .NET are gaining widespread adoption. The division of the company I work for is heavily involved in .NET development, and we are in an industry that is traditionally behind the curve in software practices. I think only common sense will tell you of the general interest in .NET. I attended the kick-off in Denver and the place was packed.

I don't know why I'm responding to you, it is easy to close your eyes and say "show me the statistics or I believe nothing." Not to mention you're posting as an AC.

C# vs. Java comparison (2)

prostoalex (308614) | more than 11 years ago | (#4189255)

This article is a bit old, in fact, the folks at ExtremeTech probably celebrated its birthday just recently, but nevertheless, it turned out to have a lot of useful information for me when it was just published.
ExtremeTech: Java vs. C#, a Code-for-Code Comparison [extremetech.com]

Other books avalible (0)

Anonymous Coward | more than 11 years ago | (#4189273)

c++ for c devlopers
c for c++ developers
shell scripts for batch file devlopers
perl for python developers
basic for assebley developers
trolling for moderators.

Microsoft press has some good titles. (3, Informative)

Zapman (2662) | more than 11 years ago | (#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.

WOW (2)

Lxy (80823) | more than 11 years ago | (#4189301)

I'm impressed that MS Press wrote a content packed book. Most of their publications were light on the tech details and more like FUD, it's nice to see they're actually writing some useful material.

And no, there's nothing wrong with posting books about C# or .NET to Slashdot. It's new technology that will affect us in a few years. While I don't like MS, I don't understand C# or .NET, and I know that in 2 years I'll wish I did.

Duh! (0)

Anonymous Coward | more than 11 years ago | (#4189317)

You're so retard for assuming right from the beginning it would be biased because it's from Microsoft... Typical Slashdot trash.

Review of this review (3, Insightful)

gabbarsingh (207183) | more than 11 years ago | (#4189326)

While I am a Java developer and I am interested in C# from a knowledge-about-languages perspective, this review is far from getting me there. At exactly one point the reviewer mentions threads and Swing. But then what about it? At more than four places Microsoft press is mentioned and it is advised to give them a fair chance. Well, after reading this review I still don't have a clue what the book is about. The ToC is interesting but not helpful. I bet that a 'Python for Perl Programmers' book would get an objective review with less focus on publishers and book contents/excerpts that would do the topic some justice. What I am trying to say is that there is no 'java angle'

I propose slashdot community lay down some guidelines about reviewing a technical book. I applaud the reviewer's efforts and for keeping an open mind towards the source ;-)

but why ? (1)

famous actress (603434) | more than 11 years ago | (#4189394)

I'm a JAVA developer forced to learn C# for a recent project. Frankly, the C# language borrowed almost everything from java anyways. There are alot of keyword replacements, some added complexity (delegates, structs), and some missing nessecity ('throws' statement).. All in all, the C# LANGUAGE is essentially JAVA, syntactically. You'd be better off spending time reading about the .NET platform and the CLR. IMHO that's where the signifigant differences are. -phill ps. The books I found usefull were Programming C#, Jesse Liberty (Oreilly)... and Understanding .Net, Chappel (?)..

dotGNU (1)

Anonymous Coward | more than 11 years ago | (#4189418)

I program in C#. On my Mac. The GNU Project has recoginized the need for an open .NET system to battle and replace Micrsofts proprietary system. dotGNU aims to be a total web service replacement. Not just a .NET runtime. The project is a parallel to GNU/Linux vs. UNIX. THis time its dotGNU vs. .NET. http://www.dotgnu.org
Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...