C# for Java Developers
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
- Introducing .NET
- Introduction to Microsoft .NET
- Comparing Java and .NET Technologies
- The C# Language
- Creating Assemblies
- Language and Syntax Features
- Data Types
- Advanced Language Features
- Programming .NET with C#
- Strings and Regular Expressions
- Numbers and Dates
- Collections
- Streams, Files, and I/O
- XML Processing
- Advanced Topics
- Reflection
- Threading and Synchronization
- Networking
- Remoting
- Database Connectivity
- Security and Cryptography
- Graphics and UI
- Introduction to XML Web Services
- Appendices
- Platform Integration
- Shared Assemblies
- Configuring Applications
- Garbage Collection
- Cross-Language Code Interoperability
- 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 is great. I think I 'll get the book.
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.
It's Christmas everyday with BitTorrent.
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.
.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.
.NET isn't as platform independent as Java atm, so I'll stick with my cup-of-joe.
But I think C# will be used to convert the C, C++, and Java crowd into the
Yeah, I think C# is MS's way to convert everyone to VB.NET.
Luckily,
Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
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)?
"I'm a leaf on the wind. Watch how I soar."
-Hoban Washburn
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!
And that that page reads:
C# for java developers:
Please Stick to Java. Don't sell you soul
to mickysoft.
The thing that finally got me to play with C# was Terrarium. 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.
"... 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).
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.
I'm really suprised by this (especially with the book being from MS) but I think it is a nice to see on Slashdot.
.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.
.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!
C# really is a nice language. It is more powerful than other
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
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#/.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.
www.cgisecurity.com/lib
Mirrors:
- Mirror 1
- Mirror 2
- Mirror 3
- Mirror 4
- Mirror 5
Translations: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.
... but chapters cover areas such as threading, security and networking
;)
Hmm, since when do they care about that
this sig has intentionally been left blank
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.
Makes me wanna just pinch those shiny lil apple cheeks of yers.
Now go play in the freeway.
A Comparative Overview of C#
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.
A speech...
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.
"I would say that 99 per cent of what my father has written about his own life is false." - L. Ron Hubbard Jr.
C# is obviously the future of .NET programming
.NET is the future of the internet
.NET is an acronym for "Proprietary Lock-In". Keep this in mind as you learn C# and immerse yourself into the .NET "experience".
Perhaps.
Absolutely not.
Healthcare article at Kuro5hin
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.
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 for instance.
You know what we do with people who temp us with devices of the enemy?
This
Moderation: +4. Modded 70% Funny and 30% Overrated. 100% Saturated.
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.
There is a somewhat free version available for Linux. It's called Project Mono I believe. Here is the URL:. html
.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. "
http://www.ximian.com/devzone/projects/mono
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
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?
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?"
(C# - MSLockIn) == (Java - crossPlatformPortablility)
It is free, the compilers and all. Just runs on windows only though.
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.
personal attacks hurt, especially when deserved
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?)
Slashdot. News for Nerds. Stuff about Microsoft.
Really, everytime Bill or Paul farts we get a Slashdot post.
Get your Unix fortune now!
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
If it's free, where's the source? Java licensing isn't great, but .NET licensing is the opposite of freedom.
That was just a joke... this is actually quite useful.
Get your Unix fortune now!
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.
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.
Zapman
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.
.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.
And no, there's nothing wrong with posting books about C# or
There is no reasonable defense against an idiot with an agenda
:wq
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.
Karma: Non-Heinous
You're so retard for assuming right from the beginning it would be biased because it's from Microsoft... Typical Slashdot trash.
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
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.
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.
Do I detect a hint of irony here?
I hope I do...
oh brave new world, that has such people in it!
free as in beer, "playing dumb" guy...
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.
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 (?)..
Q: Why do all JAVA programmers wear glasses?
A: They dont C well.
SELECT * FROM users WHERE clue > 0
0 rows returned
Your post is eloquent and correct. The parent to which you replied is ridiculous. What idiot modded you down from 2?
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
Comment removed based on user account deletion
Do you know what I do when I have nothing to say?
Thems caffeine talk are for sissies, real programmers do it in C!
It does not surprise me that this is a well written book. Truth be told, books by Microsoft Press tend to be well written. "Debugging The Development Process" by Steve Maguire is an excellent book both in content and in structure.
Examples:
In the table of contents at the beginning of the book, each chapter listing contains a one paragraph summary of the chapter. You could read the whole 4 pages of Table of Contents and have a very good feel about what the whole book is about.
At the end of each chapter has a bullet point summary of the highlights of the chapter. Save your yellow highlighter - you don't need it.
Each chapter itself it salt'n'peppered with real world in-the-trenches stores of the author's experiences at Microsoft and how they pertain to the do's and dont's of software development management.
Good Lord! If graduate level text books were written like this, I would have gotten SO much more out of college!!!
I swear by MacOS X. Although I use to swear *at* MacOS 9...
Bah I say! MS's orange books are normally very good. I have over 2 dozen and not one is biased or hypes microsoft products. Seems quite sad that the reviewer is more biased than the actual book. I have one MS orange book on my desk right now 'Inside SQL Server 2000'. It's quick to point out flaws in the design and implementation made by the SQL Server devel team. There's no hyping of SQL server and at times it even offers comparisons with Oracle and Sybase. It even goes in-depth about its origins. Now I've read books publish by MS Press that were just long ass press releases but never has one been an orange book.
Also, why the fuck should the trials affect what's being published. I'd be pissed off if MS didn't publish this book based on the trial. The trial is on MS business practices not it's publications.
*sigh*
PS: Any of you assholes want to point out spelling/grammar mistakes to attack what I've said you can do one thing: KISS MY ASS! Fucking pathetic fools who can't formulate an adequate response and instead has to nit pick to feel good.
No registration required: download the Microsoft .NET Framework SDK. Includes command line utilities, documentation, etc.
The sound you here is a dozen moderators clicking 'Troll'.
MORTAR COMBAT!
I personally don't plan on becoming a windows developer so I probably will not need to learn C# (not saying that i never will). My guess is that i will be using C and assembly but i guess that really depends on which company I end up working for and the way they do things.
In the late 1990's Assembly was on a path to overtake every modern computing language. A little known law called the DMCA outlawed the language and slowly began eroding personal freedoms.
In today's world all assembly must be generated through approved compilers. The compilers are controlled by a secret society composed of the leaders of the industrial-entertainment complex.
A fringe society of hackers are the only group of a people that are able to speak this fabled language (when they are not speaking in their annoying hacker dialect). This fringe society fights to uphold personal freedoms in an increasingly Orwellian environment.
Keeana Reeves stumbles into this fringe society and quickly becomes immersed in their cause.
Rent Matrix today at netflix.com...
Absolutely not.
.NET is an acronym for "Proprietary Lock-In".
And "Proprietary Lock-In" somehow *isn't* the future of the internet?
Try
, 12 082_1019481,00.html
n &t =gr,l=101,Robocode10
http://softwaredev.earthweb.com/java/article/0,
and you'll be back at Java again. Amazingingly fun!
From the RoboCode homepage
http://www.alphaworks.ibm.com/tech/robocode?ope
"What Is Robocode?
Robocode is a fun programming game that teaches Java by letting you create Java "Robots," real Java objects that battle it out onscreen against other robots. Robocode, with its snazzy graphics and hyper battles, is similar to a combination of Logo and CoreWars. While playing Robocode, you will learn how to write Java code, how to handle events, how to create inner classes, and more."
You must unlearn what you have have learned.
Judge software not by its price, for our ally is the source and a powerful ally it is.
hah, good nick and so relevant. you should try copying +5 posts and see if the moderators bite.
It did occasionally wander into slavish devotion ("Instead of just passing a function pointer you have to run these ten lines of 'thunking' code on it. Microsoft engineers are really smart for inventing the need for these extra ten lines of boilerplate!") but there were plenty of "just the facts" moments to offset the worst of the hiney-licking.
"I call a baby goat a 'goatse.'" -- my non-Internet-savvy 6-year-old stepdaughter
C# is so similar to Java and C++ that I don't think you'll get "loocked into" anything.
And things aren't changing much really. VC++ users will likely start switching to VC# over the next few years. Big deal...
Beware: In C++, your friends can see your privates!
Just downloaded the excellent 4 MB mono 4 windows 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.
MORTAR COMBAT!
Structs? Structs in C# are nothing like structs in C++. Structs in C++ are classes. The only difference is that all members are declared public in structs, private in classes (by default).
C# structs are objects that live on the stack as opposed to the heap. Don't confuse the two, please.
C++ doesn't have unsafe code. It's just code. the JVM/CLR has a pair of special goggles that slows down their view of the world in order to make it 'safe'. You can turn off the array bounds checking in Java (with certain VMs) for example.
While I guess you can call C++ a layer about C, it's really not. It's really a new language, that supports all the features of C and compiles C code. A superset if you will, as it supports many many more as well. I think that it's marketing that has forced C++ to be percieved so close to C. (Not always a bad thing)
Also you cannot multiple inherit in C#. It's not supported nor should it be. It creates too many problems if you want to be able to always let people inherit your classes.
Garbage Collection is not only avaliable for C#/Java enviroments. You can easily use a GC in C/C++. Just do a search on Google and you will find a free implementation. Yes is it supported by the 'language', but I think that people confuse the language with the runtime.
What makes java so easy to debug and test is the fact that the runtime is not native. An emulated platform (CLR/JVM) is much easier to debug and see the state of since if you want more debugging imformation you just have to change the software and not the hardware. Many problems with debugging machine level code arise from the fact that the processors today throw away any debugging information because it would slow down the processor. A VM can run in a 'debug' mode or not.
Which shortcomings of java are addressed in C#? Can you bind to C/C++ methods without writing C/C++ code? I really don't know the answer to that question.
http://www.geocities.com/csharpfaq/box.html
eg:
Q: What can we conclude from all this?
A: The 'Type System Unification' in C# is half-baked and full of pitfalls.
C# Best Practice
Do not use boxing and unboxing
A: To the extent that it makes sense, given the constraints of operating system compatibility, SWT already mirrors the beans behavior. An example of this is the use of standard beans mechanisms for event dispatch (EventListener, EventObject and adapter classes). Some aspects of the beans paradigm, such as the ability to create beans with null constructors, run counter to the constraints of the underlying operating systems that SWT runs on. For example, operating systems do not typically support creating a widget without specifying its parent.
The essence of the problem is that if you allow a widget to be created with a null constructor, then you can't actually create the o/s resources at the time the constructor runs (you would have to wait until later, after the parent has been set). We just can not do this, since we always create the o/s resources in the constructor, and for performance/efficiency/consistency reasons do not even keep slots in the object to hold whatever state would be required so that the object could be created later." I think the word they are looking for is "no."
http://msdn.microsoft.com/vcsharp/productinfo/topt en/switch.asp
Hey! If that's true, can't sun sue them for use of a trademarked acronym?
...do you REALLY expect to get EVERYTHING for free?
.NET provides a one-way ticket to the Microsoft Village; if you are comfortable with that, then, by all means, use C# and be happy. Those people looking for multiple-vendor technologies (i.e., lower risk technologies) should look elsewhere.
Not quite, since Java is widely implemented. Sun doesn't expend time and money trying to make these implementations incompatible; instead, Sun wants them to be compatible and has test suites available for that purpose. Conversely, Microsoft has a history of prefering their implementation over any others and works hard to drive other implementations into obscurity. Only time will tell if history will repeat itself with respect to efforts such as Mono.
No, but I do consider the amount of risk associated with a technology.
Healthcare article at Kuro5hin
It runs on StrongArm as well, for starters.
You know that
Table-ized A.I.
Yeah, that'll be the day that slash is re-done in ASP.NET, which will be the day AFTER LNUX is bought by M$. If you can tell me what day that will be, i'll give you a cookie.
We have no idea what the C# designers were thinking
Can you provide an example?
-- Brian
The most rabid believers in American Exceptionalism are the exact same people whose policies are destroying it.
Why would anyone write a book about that?
All you have to do is add "MS" to the front of all the standard Java classes, methods, and member variables, and run your code through a C# compiler isn't it?
Until AI renders us all obsolete (our lifetimes), the biggest ROI's in computing have been realized. So, now that the market has matured, the technology companies have learned what participants in every other market learn to do: "churn".
... All of them boil down to a sql statement executed against the database. We needed new acronyms, API's, books, and certification questions for this???
Brokers churn your accounts, technology companies churn your technology licenses, books, certifications, etc. And everyone's in on it: you wouldn't read that online magazine if there was nothing between the ads, the certification companies need loot, 3rd party developers make "new" tools or sell you "upgrades". Naturally, the primary technology drivers want legitimacy, so they make sure enough 3td parties have enough incentive to recommend or discuss the new technologies.
Net-net: the business user isn't getting any more functionality than s/he had before.
Take the easiest example I can find: RDO, ADO, DAO, OLEDB, (others I've forgotten)
Rewrite! Rewrite! Rewrite!
Market full of suckers.
Only in religion become things more true when you repeat them often enough, not in programming languages.
And no matter how often it is told, C# ist certainly NO replacement for C++. It lacks about everything that makes C++ such a powerful language. Programmers that are attracted by C++ are hardly "real" C++ programmers. I absoluetly fail to see how someone who is programming C++ seriously could be attracted to C#. There just isnt a lot of substance there.
-No generics ( please dont bitch about coming generics in one of the next versions of C#. C++ templates are compiled down to extremely tight, handwritten-like code, while C#/Java generics will be some kind of type-checked, RootObject-based RTTI nightmare )
-No stack-objects ( That IS MY garbage-collection, folks, ever heard of RAI ? )
-No multiple-inheritance ( before you cry: having 20 level inheritance trees from 3 different objects SUCKS in any language, but occasionally deriving from more than one object comes handy once in a while )
-No STL
These are the main things i miss, but there are other things that downright scare me:
-Everything derived from root-object
-GC (Yes GC scares me. I am well able to handle memory myself. Programming is just that: Handling memory )
-RTTI maxed out
I know exactly what kind of morons are attracted to these kind of programming languages because everything "is so easy and productive and radically simplified". Same with Delphi. Attracts the kind of guys that should never be allowed in front of a computer for programming. RAD usually stands for Rapidly Accelerating Desasters when things get too simple.
What Microsoft did invent with C#,VB.Net and stuff is a concept of "skinnable programming languages". Support for thousands+ languages ? Big deal, but they are all the same now. Your choice is about as deep as choosing the colour you want your braces in.
Did anyone notice change frequency of language features once this thing was not out in the wild and still in beta ? Core-language features changing every two weeks. This is almost getting as crazy as Delphi. But now it is in the wild, that means changing stuff BREAKS programs. Expect the speed of development of C# to slow down noticably.
C# ? No thanks.
FWIW, C++ and other languages have long has this ability thanks to Doxygen and similar tools. It's cool stuff. Doxygen doesn't use XML, but the syntax is pretty straightforward.
Build stuff. Stuff that walks, stuff that rolls, whatever.
You mean you didn't get a platform indpendent app when you used the form designer and tried to add an ActiveX control?
What was so hard about developing a platform independant app with J++? It seemed pretty clear to me what was Win32 and what was Java.
"Communism is like having one [local] phone company " - Lenny Bruce
C# for Java programmers...sounds like somebody wants to bully me into learning this IMHO redundant language. In all my professional life I have never encountered a customer who ran something vital on a MS boxen(apart from one who tried to cope with Oracle on Win2000 Server). Most of our solutions run on either Linux or Slowlaris(or, heaven help, OS390). And everyone up to now is satisfied with our Java dreck. I can't see, how C#/.NET will gain footing in this environment. But the very instance someone remotely asks for C#/.NET, I'll learn it. No sooner, no later. I simply don't see the market for it, yet. CU Bjoern
20 minutes into the future
is a FreeBSD for linux users, so we can get an entire generation of programmers back from the dark side
Info like: What is the equivalent of a Struts Model-2 architecture in the dotnet world? Or more specifically, do the C# APIs provide something similar.
http://www.tricker.net/
Cash deals with some syntax odities of simular languages in a nice way. It's a languageconcept worth while implementing. .Net on the other hand sux. It's buggy as hell, runs only on Mickeysoft (so much for "platformindependent") and gains as the singular plus the choice between VB .Net, Cash .Net and some other proprietary M$ Coding lingua. Big fat hairy deal. .Net in a way that their offering products made with it? .Net is gonna fail - or it's gonna cost M$ another few billion and a change in market policy.
Did anyone in the Industrie notice yet that near to zilch people are actually using
Either I wanna go M$, then I go native. Or I want go independent, then I go Java. Is that so hard to get across?
No, folks,
We suffer more in our imagination than in reality. - Seneca
Oh really? It's already been done Huzzah!
Where's my cookie?
As much as I hate Microsoft stuff, and am against closed source, C# is a very nice language. The whole time I've used Java, I've felt like "I wish something better would come out that wasn't so quirky".
We need an open source language similar to C#. Java's not open source, either. But I'd rather see a C#-type language than a Java-type language.
I hate to say it, but C# is definitely the better language. It's main drawback for me is that it doesn't (currently anyway) run on anything but the shitty Windows platform. C# on Linux and I'd be in heaven.
Of course, for C to be viable I would want 32 bit registers, more than 1 kilobyte of RAM, no bloody banking/segment registers (for ROM), more than one accumulator, a multiply instruction :-) in which case writing in assembler would be more fun anyway!
Everyone should know how to use it (just like everyone should know how to add and multiply without using a calculator) but it's nice that we don't always have to use it these days.
I have been a professional Java devloper for 4 years now. I started on a C# project with my company 2.5 months ago. I would say the biggest hurdles that I have had to overcome are:
1) no checked exceptions in C#
2) dotNET API is not as well organized as JavaDoc
3) getting used to applying hotfixes and security updates weekly
I definitely like the C# IDE. It is nice to spend more time coding and less time waiting for a slow Java IDE to respond.
The Kwisatz Haderach shall come again...
Oh quit your bitching. Want to reuse the same few functions across a set of classes? That's what the clipboard is for. You know, copy and paste. Just paste that useful code into every class that needs it.
Want to change, extend, or trim back that code that cut-pasted code that should have been a base class? That's what search-and-replace is for. You've got a lovely IDE, learn to use it.
Me? Bitter?
Seriously though, I've been thinking about creating a language called D. D is a half-step above C#. D will look just like C#, but it will add a new keyword: derivesfrom. Then you can write code like this:
public class BaseClass
// you know
{
// implementation and stuff goes here
}
public class Widget derivesfrom BaseClass, OtherBaseClass : IWhatever, ISomethingElse
{
}
The D "compiler" will read such things and emit perfectly compilable C# code, sparing you the cut-paste madness known as "code reuse" in the C# world. The only question is whether D should be implemented as a perl script (because I have a sense of humor) or as a D application (because geeks (like me) are fond of self-reference).
As a friendly gesture to those who oppose MI, the D compiler will spit out an error message if you attempt to derive from two classes that share a common base class. This one pathological example seems to have scared the bejeezus out of language designers everywhere. Other abuses of MI might be handled with stern warnings.
I submitted the project to the good people at SourceForge a few minutes ago. In the meantime, contact me directly if you're interested in bringing D to fruition.
Build stuff. Stuff that walks, stuff that rolls, whatever.
And since it only runs on Windows, hence x86, I need to produce bytecode why?
We've already heard about Windows CE.NET, which runs on ARM. MS has released a "preview" of a 64-bit version of Windows for Itanium, and it is making noises about a new version optimzed for the AMD Opteron.
I believe MS intends to eventually produce one deliverable (the CLR bytecode assembly) which will be compiled into native code on the ARM, x86, Itanium and Opteron, with different optimizations for each.
Also, one of the concepts I like about the CLR is the possibility of optimizing for your platform at the last possible moment. Imagine having different JIT compilers for Pentium III, Pentium IV and the Athlon, producing a different executable depending on your machine. I doubt it will happen, though.
Java and C# are very similar. C# offers some nice-to-haves. C# also offers some things that really don't make sense... properties are the best example. Exception handling is another example. C# takes a few minor steps forward and a few steps back. Which equates to pretty much standing still in reference to Java.
I simply don't see enough compelling reasons to switch from Java to C#. The two languages are nearly identical. Java has far more support. Java is far more mature. I just don't see the benefits of changing at this time.
Some of the C# examples are pretty bad, too. Who cares if I can write code like this in C#?I wouldn't write code like that anyways. Because it is poor code. Sure, it is quicker to type. But if you're really craving to save those extra keystrokes... use LISP. You don't get much more concise than that. Less keystrokes does not necessarily equate to better readibility or maintainability.
For now, I'll stick with Java. C# just doesn't have the value-add yet to even consider changing.
As a developer, if you want to expand your OO knowledge level... don't learn the same old thing over again... which is what you'd be doing going from Java to C#. Learn something worthwhile...
Learn Eiffel.
that C# has upper-case method names that are typically longer?? How useful is that?
Let's review:
C#:
infix operator-style functions, capitalized method names, vendor lock-in
Java:
true cross-platform capability, but you have to write foo.equals(otherfoo) instead of foo==otherfoo, darn!
Jee, I wonder what I should use? Maybe I'll sell my soul to Bill Gates so I can define infix operators and hit 'shift' all day! NOT.
My main complaint is that .NET and C# (notably the . and # symbols.) make it difficult to pull up information with search engines. When I want to know how to manipulate various C# controls I'm not interested in the sheet music for Bob Dylans Blowing in the Wind ;P
Market full of suckers.
I agree with this. Programming matured quite a while ago, and most recent contributions have added only unneccessary complexity to what should be a tractable situation.
The last five years have introduced more acronyms, buzzwords, and brand names into my vocabulary than my brain can handle. Yet, what am I using on a daily basis? 20-year-old technology: vi, sh, sccs, make, etc. Relatively few new software technologies have really pushed beyond where we were in 1982, and many of those technologies are simply eye candy-enabled versions of what was around 10, 20, and even 30 years ago.
It seems we could be better off not reinventing the platform on which everything is built every five years. FORTRAN, C, C++, Java, C# all touted revolutionizing our lives. FORTRAN and C really did revolutionize things; they broke us free of assembly code. But what about the rest? Why is software quality about the same now as it always has been? It's because none of these newer platforms have changed the fundamental complexity of making good software. Writing software today still requires the same amount of "brains" as it did decades ago.
Healthcare article at Kuro5hin
Too good, in fact. Am I the only one who was reminded of your usual anti-MS propagandist, spouting off unlikely scenarios as a knee-jerk reaction to the word "Microsoft"? Your post, with its liberal dosage of "stealth advertising" ideas reminds of just such silly efforts to discredit anything or anyone who gives Microsoft credit even when it is deserved.
C:\Documents and Settings\%USERNAME%\Cookies
Reminds me of IBM's Robocode. Anyone see the parallel here?
Either I wanna go M$, then I go native
.Net API is the replacement for the native Win32 API. This is a fact you ignore at your own peril.
.Net is gonna fail - or it's gonna cost M$ another few billion and a change in market policy.
.Net "suxx0rz" noobmaster flex.
The
No, folks,
Thanks for the prophecy nostradumbass. Can you back any of what you said up with facts and not FUD? Are you a developer or do you just play one on TV? Go write more than a hello world before you blab about how
Well, I can tell you who's learning it at least. MS and Developmentor (www.develop.com) recently had a "C# training camp" up in Redmond and from a registration survey here are the statistics of collective student experience (in years, out of 186 students):
.Net: 98.28
COM: 408.10
Java: 187.85
C++: 662.45
VB: 524.95
XML: 245.25
I got an idea.
If you all really care SO MUCH, go to your local Barnes & Noble and RTFB.
If you want to know if something if bullshit, there's really nothing like seeing for yourself.
CAn'T CompreHend SARcaSm?
What I noticed was just how uncomfortable the author seemed, to be seen saying anything positive about something from MS to this crowd.
Pretty sad when the political orthodoxy is so overwhelming that every sentence has to start with the equivalent of "please don't hate me for saying it, but this wasn't as bad as I naturally assumed..." when discussing a book on programming.
C# is what you get if you take several years of Java real-world experience and ask "if we could do it over again from scratch, with no backward compatibility requirements with existing Java, what would we do?"
C# is what you get if, instead of taking Sun's attitude of "please, you're a programmer, not a language designer -- if what you're asking for were a good idea, we would have done it", you take MS's "mercenary" attitude of "what changes would you make to Java if you could?".
"Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
We all know the vast secret conspiracy against poor Microsoft does not tolerate these kind of behaviour. Anyone speaking against Java, Linux, Apache and other fine technologies will be as good as dead for the mainstream media and the general public as is anyone who speaks for Microsoft. They all go down the same wall of silence we dump Chomsky and Moore on.
While searching for the book on Amazon, I came across this title:
7 35 617791/qid=1031083751/sr=8-1/ref=sr_8_1/103-896164 2-1803861?v=glance&s=books&n=507846
C# for Java Programmers, which is published by a different publisher. It seems that the book was published before Microsoft's... So for people that might want an alternative perhaps this book will give a more unbiased view since it's not from the Microsoft Press...
http://www.amazon.com/exec/obidos/tg/detail/-/0
Download the SDK from MS. It's just like downloading the Java SDK (JDK) from Sun.
.Net for non-Windows platforms.
It's free. You'll get a C# compiler, a bunch of class libraries, and a runtime, plus other goodies (e.g. other languages, but stick with C# if you're starting new.)
Get a beginning C# book and go to work. It's no different from learning what Java was about in Java's early days.
If your complaint is then, "but I'm not a Windows user", I can relate. One of the main reasons I became a Windows user was because I was having such a hard time learning the "cross-platform" Java language on my Mac back in the early days.
If you're not a Windows user, you should be used to waiting by now, so wait for (or go help) Mono. Since I'm not a Windows user on the server side, I have to wait with you for some things, but I think that there will eventually be an excellent
"Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
Dear bmajik, it is time to baman (a REAL man, silly). We do C++ or Java on Solaris when we want to get real work done. We do VB.NET when we want to sit in our pajamas n play with soft pillows. Sincerely, sweet jonnie
robocode is nowhere near as complex; there arent nearly as many options
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.
Freedom is the freedom to say 2+2=4, everything else follows...
The above poster have gotten a 4 insightful, but rather should have a "-1 Dreadfully biased troll", for being way more biased than what he is bashing for being biased.
What the f*** is so insightful about bashing language on the basis of it being high-level and created by Microsoft?
C, C++, Java and C# all looks like nice languages, and even if you are sceptical you should base languages on its merits, and not who created it.
I'm really paranoid about Microsoft, I run a small norwegian Linux site, and I'm a Linux user, but this is just BS.
Besides, reasonable C-coders might prefer to code in C, but won't dismiss C# or Java as some sort of "Mickey Mouse"-language just because it is high-level. Some times you need the power of C, sometimes you just want rapid development without the hassle.
There are at least enough C-coders that think C# is great, to create Mono.
Dear EvanED,
For someone who has done a good deal of research on languages, I find it odd that you should point to four of THE most superficial differences.
Had you pointed to differences between the CLR and the JVM, you might have had an audience.
Instead, you rehashed the oulde argument between C++ and Java. Who won that debate? The people who realized that it was a waste of time to argue THESE points.
EvanED, I wish you well in your research. I would like to point out to you that there is not a junior college on Earth that will give you any extra credit for your penetrating analysis.
Sincerely,
sweet jonnie
Look in VS.NET, all documentation and sample code for C# and VB.NET comes from the same source.
C++ samples are completely different (it is a really different language, with templates, MI etc).
In the VS.NET sample code there is a toggle that switches between VS.NET and C#. Really, the two are 100% equivalent, only the syntax differs.
I think that most traditional VB programmers shall stumble with VB.NET. Superficially they may think it is still the same language, but in reality it is totally different from what they knew. Only few of those can grasp VB/C#.NET.
The survivors come mainly from C++ background; for those, the C# syntax shall have more appeal.
Thus, VB shall die.
Rather than behaving as zealots, Slashdotters, and especially Java 'advocates', might want to remember that in some cases, comparisons may be inappropriate.
For example, simply stating that Java is superior to, or has signifigant advatages over, C#, is a bit unfair. Not to mention untrue, at least for the most part. Regardless of your opinion of the Java and C#, the fact is that the laguages were designed for different purposes, and are therefore different - in some cases, radically different.
Developers especially should keep that in mind when thinking about trashing some language. After all, compared to C++, Java is somewhat, well... limited, in power, speed, etc. Of course, Java and C++ are not exactly intended (or suited) for the same tasks. To use the eric consiracy's example, I could say that C++ has signifigant advantages over Java such as pointers, operator overloading, a superior standard class library, templates, a collections implementation (STL) that is orders of magnitude better than Java's, and asm{} (YCMV).
But that wouldn't be fair either; for all that C++ has over Java, Java has a few over C++. Most importantly, a learning curve that doesn't look like Mt. Everest.
I didn't know Barnes & Nobles sold binaries...
Programming tools have merely stagnated, yet they (and the profession) are still at the stone knife and voodoo doll level compared to other engineering disciplines less hampered by incompatibility. If I have seen little, it was by standing on the toes of giants....
Since when is a language which fixes a couple of serious flaws in Java 'mickeyware' ?
Oh, I see... It's not C++, so it must be stuff for kids or 'loonies' who think they are real programmers, right?
Grow up, kid. C# brings real type safety to the table + GC, which virtually eliminates the crap which bugs (pun intended) C++ code up till today and tomorrow. C++ is nice, but for most projects, it's just a language which requires too much overhead, too much typing (on the keyboard that is) and results in too complex code. Gee, Java and C# do a much better job in those areas. Limit yourself by choosing a language which holds you back in productivity, I don't care, nor do your competitors.
Never underestimate the relief of true separation of Religion and State.
He explained everything the grandparent totally misunderstood.
How shameful that someone can post something that is totally false AND it gets modded up and interesting or insightful.
Makes me want to cry.
This seems like a smaller scale of Hitler's planes.
Rather than trying to convince us that ther Jews are to blame for our troubles, they blame Java. The purpose is obvious. Microsoft wants us to exterminate Java in favor for a "prettier" language, when M$ ittself doesn't use that language!
The fact is that Java is what I want. I can use it on my Linux server/desktop, my iBook, my graphing calculator and even lego robots! I may not have moral reasons for keeping Java alive, but it is supperior.
You can't judge a book by the way it wears its hair.
it is for you all geeks out there. It is not about which language/SDK is better than the other. It is all about choosing the right language/SDK for the right job. I will use java/SDK if it has more support to fit my needs. On the other hand, I will use C#/SDK if it is right for the job.
Get a freaking life please.
I said it was free, and it is. It costs no more than the JDK, which is to say: nothing. That "if you already paid for Windows" stuff is silly. I already said that when Java was at this stage, I had to buy a whole PC to use it because the Mac version was hopelessly behind Windows (and the Linux version nonexistent.)
And what's this about source? Go ahead. Take that Java source, fork Java and see what happens to you. And where is the source for that darned javac? I can't seem to find it. I need it because I'd like to create a new dialect of the Java language to sell to scientific developers. Hmm.
If you want to customize a Java-like language without getting sued, start with ECMA C#.
"Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
The review seems surprised that the book was very honest about C#. back in previous times of my career (when I did win16 and then later win32 C++ programming) all of the Microsoft Press books I bought and read were of good quality. And they included healthy criticisms of parts of the technologies that weren't so great.
In spite of Microsoft Press sharing the name with the company they have generally published books that are fair in their dealings with Microsoft technologies.
Now just waiting for C# for C++ Developers
A Comparative Overview of C# [genamics.com] is blatant astroturfing from C# book author. The genamics.com review is riddled with problems, the author has ignored constructive feedback on the article, has a poor appreciation of OO and is inconsistency in his comparison. He also has a history of Atroturfing the forums.java.sun.com in support of C#.
IMHO this is a much higher quality comparative review.
Consider the fact that Java is being improved rather rapidly. .NET in a few years time.
I would like to compare JDK1.6 to
What percentage of Serious Java programmers are switching 1% 2% 5%?
The fact that VB and C++ coders are just switching to a Java clone MANY years after the release of Java just shows how much they swallowed Microsoft's propaganda by rejecting Java and then accepting C#.
I'll think twice before casting pearls before swine in the future.
IN TEH FUCHAR, LITERSY WLIL EB OPSHANAL!!!!!111