Java 1.5 vs C#
Here's the list of enhancements to the Java Language:
- Generics (C# 2.0 already supports this)
- Enhanced For-Loop (the foreach construct in C# 1.0, duh!)
- Autoboxing/Unboxing (C# 1.0 already has this, everything is an object, even the primitives - not really, but they do it so well...)
- Typesafe Enums (again C# 1.0 already implemented this, but I think they've added a little bit more twist in Java, that its actually a better implementation)
- Varargs (C# 1.0's params construct, ellipsis construct in C++)
- Static Import (I don't know if C# 1.0 has this, or C#2.0, but C# has a construct for aliasing your imports - which is way cooler. Static Import, actually promotes bad coding habits IMHO)
- Metadata/Annotations (this is C# 1.0's Attributes, Sun's upturned noses just gave it a fancier name - also, C#'s implementation is better and more intuitive)
They've beefed up the API some, and integrated several packages with the regular JSDK that used to be a part of a separate package or installation ---in my NSHO, the Java API has become bloated...
At this point (even before Whidbey) the deciding factor (as always) for Enterprise work, when choosing a language platform, should be the support it has behind it, in terms of IDE, tools, api, and longevity of the vendor pushing it (forget the OpenSource crap argument, those guys are too in love with Perl, Python, and Ruby - Java could become the child nobody wants to talk about if Sun dies) - right now that's C# and the .NET Framework ---
If you ask Paul Graham though, both language would be utter crap and fit only for idiots :) http://www.paulgraham.com/gh.html [I'm exaggerating, so hold off on those flames.]
...and let me tell you, java doesn't have to do that much to "catch up" to it.
"Quoting famous computer scientists out of context is the root of all evil (or at least most of it) in programming." - K
That sounds like it should be some Adams-esque race of semi-competent space pirates...
Obliteracy: Words with explosions
How about a cross-compiler that takes advantage of this vendor competition in cooperation to combine both communities of programmers into one pool targeting either virtual machine?
--
make install -not war
Fix that first link. It shouldn't have a slash at the end:
a tu res.html
http://java.sun.com/j2se/1.5.0/docs/relnotes/fe
Where's the story? Or is this just one person's interpretation of Java vs. C#?
I've never seen so many grammatical errors. You win.
Attention deficit disorder is a complicated issue, spanning several major... HEY LET'S GO RIDE BIKES!
and you're foundations in OOP is rock-solid
What about our foundations in English?
Quidquid latine dictum sit, altum sonatur.
At this point (even before Whidbey) the deciding factor (as always) for Enterprise work, when choosing a language platform, should be the support it has behind it, in terms of IDE, tools, api, and longevity of the vendor pushing it (forget the OpenSource crap argument, those guys are too in love with Perl, Python, and Ruby - Java could become the child nobody wants to talk about if Sun dies) - right now that's C# and the .NET Framework ---
Why again can't I mod a story as -1 Flamebait?
--
I'll pay you $10. Really.
It's a bit unfair to compare the new Java 1.5 release with c# 2.0 since c# 2.0 is not due to be released until sometime Q2 or Q3 next year. But I do agree that before the 1.5 release Java had a lot of catching up to do to c#, but now c# is a bit behind (Mainly because of it's lack of support for generic classes which Java now supports).
What language was this post written in? Amazing.
I want actual functions, not "activity objects". Almost everyone, except for the extreme OO zealots, agree that OOP is not necessarily the best approach to every problem.
Table-ized A.I.
This would get a -1 Flamebait.
My feeling is that these features are good news. There should be no gloating on the part of C#, it was clearly built on Java's coattails.
Competition is a great thing, ain't it?
Maybe it makes more sense to listen to what the tech lead of Java 1.5 had to say here.
(= Calvin Austin)
Neither are open source.
Both require virtual machines.
Despite being marketed as portable, but have portability issues. Java is not backward compatible with older versions. C# has problems with porting some of the graphics stuff to Linux.
We don't really need them. PHP/Perl serve my needs on the web/server side. C++ and Python server my needs on the desktop side.
They're closely tied to their respective companies.
If you think this is flame-bait, check out this article's title.
Seriously, this looks like an ad for C#, a bunch of claims with very little support/evidence for those claims.
I've worked on C# and Java projects. As far as I'm concerned, C# = MS Java. MS could not control Java, so they abandoned support for it and built thier own "version." It's really a rinse & repeat cycle for MS: see successful software, build own version of said software to try to take over that market as well.
After templates (generics) come out in a few months, i dont expect java to have an easy time catching up.Personally, I really miss templates from C++ and would drift over to the camp that offers it.
The war with islam is a war on the beast
The war on terror is a war for peace
Perhaps /. will correct the error. I emailed the editor when the story was in preview, but it was too late.
Here's my theory. Along with the ubiquitous slashvertisements and the Microsoft-bash-of-teh-day barrage posts, these are a perfect opportunity to create a story that will generate 1,000+ comments and ten times those many page views and ergo ad impressions.
C'mon, C# vs. Java? Outside of "RIAA sues 86 year-old grandma", "We hate Bush, let's talk" and "Microsoft patents KDE" there is no better source of inflammatory material in the dorkosphere.
Sad, really.
Is this article flamebait? Maybe I am just misunderstanding when he says:
"At this point (even before Whidbey) the deciding factor (as always) for Enterprise work, when choosing a language platform, should be the support it has behind it, in terms of IDE, tools, api, and longevity of the vendor pushing it (forget the OpenSource crap argument, those guys are too in love with Perl, Python, and Ruby..."
Which "crap" argument is he talking about? I assume he means that when using those languages you have thousands of directions to go for help in howtos, docs, tutorials, books and of course the loving #perl. I normally would not reply to something like that, but I took offense. Yes I love those languages. They all have strong points and make life fun when coding. I have support and have never had to rely on a company to provide said support. Oh yeah, and I write enterprise software with the mod_perl crap everyday of my life. Thanks.
iamchaos
So which version number is it? Java 2, Java 1.5, or Java 5? Someone should teach these guys to count before they start coding!
Java has a few advantages over C# in optimization. It's very easy to analyze Java programs to be certain that certain memory locations absolutely will not be modified. That's much harder in languages with native pointers. Those invariants allow you to compile out certain calculations that would have to be done at runtime in a C# program. You can even start spreading loop cycles over multiple CPUs, but I'm pretty certain that the present JVMs aren't that smart.
CMDRTACO CHECK YOUR EMAIL!
XML Parser
You mean like JAXP and JAXB?
Attention deficit disorder is a complicated issue, spanning several major... HEY LET'S GO RIDE BIKES!
I'm not pleased with the "catch-up" game that Java is playing here. Java was a fairly nice middle-ground betweeen high and low level programming, and what appears to be an effort to become a high level language is rather ominous for those who are interested in testability and performance in Java.
This, BTW, is why you don't want your language to be controled by a company which in turn has a marketing-driven bottom-line. The idea that two languages could co-exist with different target audiences is nonsense to marketing droids, but perfectly reasonable to someone like Guido van Rossum, Larry Wall or any of the other maintainers of truly open-source languages. Open source isn't the only way to maintain this focus, but in today's marketing-driven world, you aren't likely to see too many Bell Labs-like organizations putting out languages like C (which was semi-open source, as was Unix). Java and C# are probably much more typical.
SexyFingers writes "Sun released Java 1.5...
The ultimate question is... how did you get those sexy fingers ? Java, C# or... Pr0n# ?
getSexySig();
No. Checked exceptions were an interesting experiment that turned out to be a bad idea. I won't rehash the arguments here (for a reasonable example, search for Bruce Eckel's writings on the topic), but when the ivory tower of checked exceptions meets the real world of deadlines, something has to give.
I've no plans to use C#, but it's something they definitely did right.
I use DOM within XML as well as the MessageDigest using the MD5 algorithm every day. So I'm letting you know...
Or, is your complaint based on the fact that the libraries that underlie the XML and Security algorithm API's can be swapped out? To me, that's a feature not a bug but YMMV.
Waltz, nymph, for quick jigs vex Bud.
whoever wins, we lose.
I code C# for a living, so according to your definition, sold (or more appropriately rented) my soul to the devil. (This does not change the fact that I personally prefer free/open source technology. My PDA, my media players, my home operating system are all free/open source based.)
Java is not any more closer than C# to open source technologies. Sun doesn't like open source, just as Microsoft.
It's a very well known fact that Java has been a base (or in other words "the" figure) for Microsoft while developing C#, but that does not imply that "Java is good, C# is bad" or vice versa.
I would be happier personally to code in Java, but professional life yields to disqualify who resists new technology.
Your choice of programming language is not your religion, and it can change continuously through your life. Just like your operating system.
A quick Google for "java MD5" gives a code example in the first hit, http://www.bombaydigital.com/arenared/2003/10/10/1
Think before you whine.
It's not so much the language that is a question of contest, but the platform they run on. I've done Java programming since 1.1.8, and have deployed on Tomcat, Resin and Weblogic.
.Net? What the fuck is up with IIS (oh yeah, it's crap)?? Where is any sort of replicated server side session management (no, long ass hidden fields are *not* sessions - and a M$SQLServer *only* solution doesn't count).
.Net's deployment platform (singular). Man I miss working with J2EE platforms and loathe IIS...even though it is my job to keep all this stuff running on IIS! :(
Recently I switched to C# (new job) and I have to tell you, the language is pretty neat with some of the tricks you can do. Nothing ground breaking though.
What's really missing is the platform for release, and release management. Where are WARs and EARs for
The constructs and tricks of a language can be debated as long as you want. You will probably find something nice in every language. But when you have to [operationally] deploy any application, great or not, on some cheap as shit, crap ass, hard to manage, non-repeatable platform such as IIS, that's when the real rubber hits the road with Java.
J2EE deployment platforms are light years ahead of
-bk
While neither Java nor C# is truly free of being controlled by an Evil Corporation(tm), Java at least has multiple vendors, runs on a wide variety of platforms, and has an open standardization process.
C'mon, C# vs. Java? Outside of "RIAA sues 86 year-old grandma", "We hate Bush, let's talk" and "Microsoft patents KDE" there is no better source of inflammatory material in the dorkosphere.
Oh, how I pine for the days of vi vs. Emacs.
- Tony
Microsoft is to software what Budweiser is to beer.
He kind of forgot that there are many programmers and customers who DON'T want to deploy their systems on win32. With Java apps, you don't have to. In fact you can choose almost any operating system and hardware. Anybody who chooses C# over Java for enterprise deployments is truly a MicroWeenie.
:]
I much prefer my 8 processor HP UX box any day
Let me know when stuff like an XML Parser and MD5 are native in Java.
They ARE.
XML package
MD5 and SHA support
The former has been in Java since 1.3, and the later since 1.1(!).
Honestly, Java has every feature and the kitchen sink in its core APIs. And if a feature isn't there, it's very easy to write a library to add it. That's why programmers like Java so much.
Any other features you'd like me to find for you?
Javascript + Nintendo DSi = DSiCade
How do you explain that Sun provides official Java runtimes for Linux (and for that matter sells Linux boxes) as opposed to Microsoft's complete lack of support for anything except Windows?
Sun has always been much more open than Microsoft. They are also allowing open-source implementations without fear of reprisal. We'll see if Microsoft manages the same tolerance with Mono.
Galileo: "The Earth revolves around the Sun!"
Score: -1 100% Flamebait
opinion. broken link... poor grammar... this guy is a joke. He pulls out 7 new features!! What about built-in queue support?
Only thing I agree with is generics has been long overdue.
So, were you trolling, or did you just not bother to keep up with Java?
It is this similarity and 'compatibility' of Java & C# that is now making it easy to port various applications between the two languages. For instance, the very popular Lucene (Information Retrieval library from Jakarta (i.e. Java)) has a very solid .Net port written in C# called dotLucene. The Lucene -> dotLuene port is fairly automated, it appears, which allows developers of the .Net/C# port to keep up with the original software written in Java.
If C#/Java continue in this direction, I think we will see many more applications that have parallel versions in the two languages.
See:
Lucene
dotLucene
Simpy
"In the case of Math, where's the bad style in writing Cos(x) instead of Math.Cos(x)?"
... } can be.
None at all, but I cannot count the number of times I have had to change a co-worker's static members into Object methods because of a side-effect of some other change. And don't even get me started on what a nightmare static {
-fb Everything not expressly forbidden is now mandatory.
See, you're just too in love with Python, Perl, and Ruby. I myself used to think that those were real and useful languages. Then I discovered that c# is maintained by Microsoft and I realized that they were actually crap.
This problem is the primary reason that C# exists. If the C++ committee had fixed their language, we wouldn't need C#.
It's a big issue for the open source community. The publicly standardized languages have major problems, and the newer languages are controlled by single large vendors.
Sorry, guys but as long as you don't have that, you're not really OO.
There are some important limitations of generics in
Java, which are properly addressed in C#.
For more details, you might want to read:
http://www.artima.com/intv/generics.html
C# still has a few extra niceties like properties,
events, delegates, anonymous methods and iterators.
Miguel.
My biggest beef with java right now (well Sun, really) is that they are make design decisions in the name of backward compatibility that are leading to poor design choices. Backwards compatibility is an important consideration, but it should not be used as an excuse to make poor design decisions. I use a variety of java programs day to day that only work with certain VM versions due to bugs, features, etc. It seems silly to give this one aspect such heavy consideration as if the current java versions are perfectly backward compatible today when they clearly are not.
The new generics feature is clearly patterned after C++ templates, but in the name of backwards compatibility Sun chose to implement generics using erasure. This means that a generic type loses all of its type information leading to a alot of issues including broken support for arrays. Using erasure keeps much of the potentially confusing syntax of C++ templates and virtually none of the power.
I suppose I would be less upset if the feature had a different name. Maybe something like AutoCasting (like the name AutoBoxing). "Generics" implies things that the feature does not even try to deliver. Adding true generic programming constructs to java would have been a huge leap forward for the language. Instead we are left with a toy feature that allows you to build type safe containers, nothing more. Very disappointing.
SYS 49152
Quick correction:
The XML APIs were part of a standard extension in 1.3. They were added to the core in 1.4. Also, I found the JavaDocs for 1.1, so here's a link to back up my statement that MD5 support has been around that long.
Javascript + Nintendo DSi = DSiCade
Funny, we were talking about the 1.5 APIs last week here at work, while talking about migrating our apps over from 1.4.x. This site Official Java Programming Documentation gives you a ton to think about. I rem when we were on 1.2...
CB*($#@
free ipod and free gmail!
Last time I checked, few industries were doing enterprise development with J2SE, regardless of the version. J2EE is the preferred platform for enterprise application development (hence the 'EE', or 'Enterprise Edition', after the 'J2' bit). J2SE 1.5 is a great release, but it means little currently for J2EE developers.
The new features to Java in version 1.5 are all anticipated and appreciated by the development community, but us J2EE developers won't be able to access these new features in our apps until the official J2EE 1.5 release comes out, and the various app server vendors (IBM, BEA, Oracle, Sun, JBoss, Apache, etc.) support it in their products.
I've read the arguments on the topic, but I don't agree.
Relying on documentation to tell API users what exceptions can be thrown is a really terrible idea if you're trying to write server software that has to actually work. And work all the time, 24/7, not just in a demo. MS still seems to be in the mindset where their developers are mostly making client-side VB applications or tiny ASP sites.
We've had a number of cases so far where C# library methods unexpectedly threw an undocumented exception (that would most likely have been a checked exception in a Java implementation). Now, often if you were smart you'll be lucky and the exception falling through to a general handler won't break anything too badly, but other times something unfortunate will happen.
In my book, when Microsoft's fast-to-develop-cut-all-the-corners methodology meets the real world of SLAs where software actually has to work, something has to give. And yes, you can say "just use Java/Python/Cobol/whatever instead" but the point here is debating whether using checked exceptions is a good idea or not.
I'll be honest - I like a lot of things about C#. It's a good language and their IDE is also good. But deciding that checked exceptions were bad was very unfortunate.
I think you've completely misunderstood polymorphism and/or varargs.
I've never, ever had to write a Java method that would have been better implemented using varargs, but I've written plenty in C and C++ in the past that would have been better written without them...
I can only think of a couple of cases in Java where varargs would actually improve matters (have a look at MessageFormat, the work around it uses to emulate varargs is painful so varargs would be great there). But I just know varargs will get horribly absued: so overall I think Java was better off without them.
Personally I think that, overall, Java 5.0 is a mistake. Metadata is already going out of fashion: Google for "metadata hell" to read why. It's a passing fad that's passing. Autoboxing/unboxing *shrug* nice when you need it, but how often do you actually need it? Generics/templates was something I missed when I first moved from C++ to Java 10 years ago: but now it feels like more unnecessary complexity.
So overall it seems to me the 1.5 changes address some limited circumstances at the cost of additional complexity; and no doubt we'll see them mis-used and abused and that will outweigh any benefit by an order of magnitude.
What they should have done in 1.5 is strip out all the deprecated crap: Sun has this habit of constantly adding layers but never actually removing the old stuff. I really would hate to be learning Java now: it's so bloody big!
Bad analogies are like waxing a monkey with a rainbow.
> should be the support it has behind it, in terms
.NET.
.NET Framework ---
> of IDE, tools, api, and longevity of the vendor
Eclipse/IntelliJ/Together
Apache/Tomcat, WebSphere, BEA
RedHat/Suse/Mandrake/Debian
All of these tools and vendors have been around longer than C# and
> pushing it (forget the OpenSource crap argument,
> those guys are too in love with Perl, Python,
> and Ruby - Java could become the child nobody
> wants to talk about if Sun dies) - right now
> that's C# and the
You misspelled "FUD."
"For my own opinion I prefer unchecked exceptions as the code is far cleaner. "
No, the code will just appear cleaner. Hiding exception propogation is an invitation to ignore exceptions. If someone wraps code in a single catch, you can at least see where they've been sloppy. The equivalent in a non-forced exception check is to do nothing, which is invisible.
I think the problem you are seeing is Ravioli Code; a (perhaps excessive) reaction to spaghetti code. Also Java (and probably C#) programmers seem to take Patterns too seriously as well, patterns should be descriptive, not prescriptive.
Basically, Sun did a bunch of things they could do without changing the VM too much and without breaking old code. But for a bunch of other features, they punted and just added a bit of syntactic sugar to the compiler that makes Java look superficially like it's doing the same thing but is much less efficient under the covers.
For enterprise applications, those differences may not matter much (and they may even be harmful), which is probably why Sun doesn't do anything about them. But for desktop use and application programming, they do matter. Microsoft wanted to create a new language that their legions of C++ programmers could use, and C# is a pretty credible answer for that. Those people don't care about cross-platform features, they care about getting the job done, and if that involves the occasional unsafe module, it doesn't matter to them.
If I am not mistaken MS helped Mono out on their C# implementation.
In the driver arena this the prefered solution to having a closed official impementation. I would assume it is the same for the sake of a language also.
Wow, sent an e-mail as suggested when clicking on "use classic" banner, and got a fast response that addressed my msg
For enterprise-grade work I still prefer J2EE over
----- You know you have ego issues when you register a domain in your name.
Welcome to planet earth - we also have a language called 'C++', but it is rather different from what you describe.
Here, we have compilers that can do bounds checking - avoiding buffer overflows, if you decide to use them.
However, the template feature of our C++ is so powerful, that when used together with structs and classes, one can produce beautiful code that is extremely powerful, yet so simple that it is easy to ensure it is not susceptible to said buffer overflows (or memory leaks or the thousand other plagues of much of the software that surrounds us).
This is why there is actually not anything fundamentally wrong with our C++. We are some who want template namespaces though, but outside of little issues (that do have workarounds) like that, the only things we really want is additions to the (already powerful) standard library, the STL.
One problem remains with our C++ though. We live on a planet inhabited mainly by clueless morons, people who do not like to learn, people who refuse to accept that maybe others have seen farther than themselves. This is why we, too, have a lot of problems with software in general - buffer overflows as you mention, among many other problems.
I am sure we can arrange for you to get a copy of our C++ standard - that will allow a clever individual, such as yourself, to write software without the problems we discussed. I would then suggest that we join our efforts, in teaching the unwashed masses how to actually use the language properly, so that we will not have to re-do all software in the world (both ours and yours) by ourselves.
Deal?
Just because C# has more features does NOT make it a better language. Infact most of these Java 1.5 java changes annoy me. You could almost all these things in 1.4 there was just a certain way of doing it. If you have every programmed in C++ before with lots of different people who program things differently you will know that having different ways of doing things can be a VERY bad thing. This is way Java was so strong because there was 1 right way and 1 wrong way. Where in C++ you have like 3 right ways (that don't mesh together) and about 15 wrong ways to do something. Java is simpiler and faster to write code because you don't have 5 or 6 different ways of doing the same thing!
that I dont care which a client wants anymore. Its like asking for 6 of one and a half dozen of the other. I had been afriad of learning Java for ages but knew C# very well. Then I forced myself to learn Java and as soon as I got into it I kept saying "Wow MS copied Sun!"
When you think about it though good OO concepts tend to evlove toward similar goals. Languane and usablitly concepts are the same all around. Its to the point now where the differences between Java and C# are more syntax and available libararies. Ive even been able to easily port Java to C# and vice versa since the languges are so similar.
It has defintaly opened up things more for me, as now I leave it to the client as to what they want. If they are an MS shop then C# is an obvious choice if they use Linux or perfer alternative platforms then Java is obviously what you should build in.
"Don't mess with him, he taunts the happy fun ball."
I sincerely apologize for feeding troll. :oD
Sometimes the truth is arrived at by adding all the little lies together and deducting them from all that is known.
Java's primitive types are not objects. There's no reason they couldn't have been (compilers that generated efficient arithmetic code from high level components date back to the '70s) but they're not... which means you have to drop down to C-style types over and over again.
It hinders programming efficiency, and it hinders code efficiency: any place where primitive types can be used, the compiler can infer that primitive code can be generated, any place it can't you'd have had to use object types... but the compiler is MUCH smarter about figuring where casts need to be than average (or even above-average) programmers.
Smalltalk is "OO from the ground up". Java is "OO from the Integer up".
it just does not force you to declare and handle checked exceptions, an issue of strong contention within the Java community
Um, Java supports both checked and unchecked exceptions.
Irritable, left-wing and possibly humorous bumper stickers and t-shirts
It's good to use your head, but not as a battering ram.
Well people are here now saying oh java is better and people are saying that c# is better. In my opinion both are good and just like competition should do (assuming MS plays by the rules this time) both products will end up the better because of it. For the longest time java had no real competition (in my opinion) and its development slowed down greatly but now that C# is starting to be used more and more often javas development has finally started to take off again. Nothing but good can come from this so rather than flame each other over this I think we should simply consider what features might improve either language and attempt to talk to communicate with the developers when possible to request these features and improve competition all around.
The java generics system just saves typing and ensures type-safety for collections. But it does nothing about the problem of excessive boxing and unboxing that plagued java collection classes from 1.0 on.
For example if you have an ArrayList<Integer> in java, it internally uses an object[] to store the elements of the array. So everytime you write a new value to the ArrayList<Integer> by e.g. calling list.Add(i), a new object is allocated on the heap.
A List<int> in C# on the other hand uses an int[] internally, so adding or changing an element in the List<int> will result in no boxing/unboxing at all. A List will be just as fast as an int[] since the indexer method will be inlined.
The performance difference is dramatic: try creating an ArrayList<Integer>/List<int> and filling it with 1000000 numbers. The C# code will run 10 to 20 times faster, while the java version will use 20 bytes per Integer instead of 4 bytes per Integer like the C# version.
I am currently not at home, but if somebody is interested I will post a benchmark later.
Private property is the central institution of a free society (David Friedman)
Yeah, there's a syntax for this. It's called "put the try and catch in the function, with an empty catch block, and a comment that indicates why the exception can't happen." Then your function doesn't have to be declared as throwing an exception, and someone who looks at your code will understand that you didn't just eat the exception for no reason.
And, before you whine about having to write the try/catch block, let me echo what somebody else said, that an IDE like IntelliJ will do it all for you (except for the comment).
Autoboxing/unboxing *shrug* nice when you need it, but how often do you actually need it?
I love this feature. Currently I have to do this sort of crap all the time:
String to int:
new Integer("1").intValue();
or parseInt
int to String:
String.valueOf(1);
In truth, Java should have dropped the primitive types altogether and went with a 100% object approach and allow things like this:
Integer _integer = 3;
Long _long = 5;
Number _number = _integer + _long;
_number--;
The above would be total sweetness.
What they should have done in 1.5 is strip out all the deprecated crap
Agreed. First to go: java.util.Date. And fix Calendar to be actually usefull.
Oh, how I pine for the days of vi vs. Emacs.
You must have meant, of course mutt.
www.vanheusden.com - home of Multitail, HTTPing, CoffeeSaint, EntropyBroker, rsstail, bsod, listener, nagcon, nagi
I have a couple of rules when regarding languages:
.NET and C#). And just when you get used to version XYZ, they come out with XYZ+1 which changes EVERYTHING. Sorry, I don't need my code to die at the whims of MS.
1. Does it have wide industry support or is it merely another "we ship it until we kill it" single-sourced language.
2. Does the name sound like it could hurt you?
C# pretty much fills the bill (no pun intended) for both 1 and 2.
MS is no stranger to introducing something and then killing it some time later (hence my avoidance of both
Then there is the whole "C#" name which, frankly, I think sounds retarded. To most Americans, the '#' symbol is pronounced "pound". Few people I know call it a "sharp" (actually, NO ONE that I know calls it that).
Finally, just the sound of it sounds dangerous and, if inserted in the wrong place (like my MIND) could cause harm.
IANAL, but I've seen actors play them on TV
I've done enterprise-level Java and C# implementations for financial institutions, and reckon there is one thing that people always miss when comparing the two languages: installation.
C#, despite any other flaws, Just Works(tm). Install Visual Studio, write some code, click the run button. Sure it takes a bit of thinking to get a n-tier implementation up and running properly, but the installation of the back-end stuff (IIS, db connections, remoting) is incredibly simple.
On the other hand, to get enterprise Java (J2EE, although some would argue that a class library is easier and more versatile), you need to learn how to install an app server (JBoss, Orion, or god forbid WebSphere), and how to configure that system for database connections, performance, session and object permanence, etc..
None of this really matters in a 'big-iron' enterprise environment, because there's room to hire a websphere monkey to look after the cat-herding. In anything below a mega-corp or mega-bank however, the overhead of running Java can sometimes be a burden that developers just don't want to think about.
I see it kinda like using Firefox over IE. They both do pretty much the same thing, and one does it 'better', but at the same time requires some effort to implement. Some people just can't be bothered with the effort.
gadgetophile.com
Sometime in 1999 after I'd worked at Sun for about a year, a routine all-hands meeting was held for all of the Java Software division. JDK 1.1.8 was the current version of Java on the street and JDK 1.2 was in the works, almost ready for release. We sat there and listened to the usual rah-rah speaches from the divison's head honcho (can't recall who it was at the time), and then he introduced us to a marketing guy to tell us about the launch for JDK 1.2. As he begun talking he displayed a new slide on the project and it read, in all its powerpoint glory, 'Java 2000!' And he went on to say that the new JDK would be called, not Java 2, but Java 2000. Everyone in the audience started laughing hysterically. We all thought it was a big joke. I mean, Microsoft was on the verge of releasing Windows 2000, so you don't really mean.... Turns out this marketing guy didn't have much of a sense of humor. "I'm not joking", he said. The laughs and knee slappings turned into boos and hisses. Head honcho guy says something like the marketing guys have worked hard on this and that's the name they've choosen. The Q&A session was next and, boy, did both of these guys get an earful! Anyway, I can't say for sure, but I think that had it not been for the outrage and disbelief at that all-hands we'd be stuck with even weirder Java naming convenstions today.
Rich
"I want C# on my *N*X/Window box"
http://www.go-mono.com/
"I want Windows.Forms support on my Mac/*N*X/Windows box"
http://www.dotgnu.org
If it's a choice of language based solely on the portablity of code, C# wins out IMHO. With Java, you're dependant on Sun to support your system, which is a royal pain. (as anyone with a *BSD box will tell you)
Basically because he makes the point Java is portable and c# is not - no matter what the niceties of c# are, it misses this basic feature. Java is comparable to, if not exceeding the features of c#, in addition to its portability. We can readdress this when mono is finished and both languages are on a level playing field, until then, it's a moot point, Java rules. If MS supported .NET on other platforms, this would be a different discussion and not so cut and dry.
ymmv
Free C# compilator? Right here: .NET Framework SDK
.NET 2.0, go here:
.NET Framework 2.0 SDK
Or here: Mono project
Free IDE? Here: Sharp Develop
Or, if you want to test
As you see, you don't have to pay anything to try C#; since you say you're convinced, go for it!
As other posters have said, I don't think that C# is meant for big enterprise apps, but littler 'toy' apps. Still, you'd be surprised how many of such apps are in use right now. The biggest strengths of C# are:
.NET, so that a user can program to a higher level library. Documentation is all there. It also provides all of the tools and files needed in one tidy install, without the need for combining different packages. It all comes from one vendor, and it's easy to get your mind around.
1)Simplicity. Everyone loves to argue about how purists should code things, but in the real world, a lot of code is written by people who are blissfully ignorant of theory. VS allows them to make obvious progress, reusability be damned. A crude, but working app is more impressive to a clueless manager than a collection of nascent classes.
2)Integration. This goes along with #1. Much of the heavy lifting in creating desktop apps is rolled into
3)ASP.NET. I would argue that ASP.NET is the easiest way to accomplish application-like behavior in a web site. Session state works well, database access is a couple lines of code, and you can even draw the page on a coordinate system if HTML stymies you. Scorn it if you must, but it's a good step toward standardizing web/application development.
As Stroustrup says of the ellipsis construct in C++, "The most common use of the ellipsis is to specify an interface to C library functions that were defined before C++ provided alternatives", and gives an example of the "extra work that face[s] the programmer once type checking has been suppressed using the ellipsis." Using the ellipsis construct, other than where it has to be used to access some legacy C library, is definitely very poor style in C++.
The included libraries will make/break a language, and right now, the .NET libraries are much easier to use. Partly because they were designed "as a whole" and don't have a lot of cruft in them (yet). And partly because the MS on-line help is vastly superior to JDoc (does Sun not believe in code samples?).
.NET framework is that 90% of it uses concrete implementations. Because they didn't use an Interface-driven design, they now have to fall back on the Win32 style of appending "-ex" to class names when they want to improve them, rather than letting a dynamic loader find the class the developer needs.
The biggest weakness I see in the
Even so, the Visual Studio IDE is so far ahead of any of the Java IDEs (Eclipse comes closest), that it's probably Microsoft's single best competitive advantage.
Chip H.
C# is just one option for .NET eh?
Hmm... if only there were some other languages that could be compiled to JVM bytecode.
DISCLAIMER: I develop heavily in both C# and Java, more C# than Java, about 80% C#, 20% Java, not by choice but based on client demands.
.NET, though, is that the libraries seem to be more consistent, whereas the Java APIs have evloved and been added to by different developers using diffferent programming styles and approaches to patterns, each package seems to implement different programming styles and constructs, but you get used to it after a while. Plus, Java has so much deprecated code, they need to clean those out once and for all and clean up the APIs, see this for more details of what I'm talking about.
I don't think it's fair to compare Java 1.5 (released) vs. C# 2.0 (beta, who knows when it'll actually be released). That's like comparing Linux to Longhorn.
And re: IDEs, while programming so much in VS.NET, I missed all of the cool features of my IDEA IntelliJ Java IDE that I was excited to buy ReSharper, bringing some of IDEA's cool features to VS.NET.
One of the main things I like about
Say Amen!
Just because operator overloading can be used for evil is no reason to throw the baby out with the bathwater.
Java lacks a Currency class, so I wrote a Money class some time ago that I use for common financial calculations, and it takes care of the pesky problem (and newbie mistake) of using floating point types for money.
BUT, in Java, you have to have add(), sub(), mult(), and div() methods. Reading RPN style caclulations consisting of sequenced and nested method calls instead of algebraic operators is painful. Operator overloading is wonderful in those cases.
Operator overloading certainly can be evil: What does it mean to increment an Employee? Do I really want to know? But for new types that you can actually do algebra with, it is quite helpful.
And there are other cases.
In my C++ days I wrote a FileHash class that kept an index of offsets to the start of each text line in a text file. Then I overloaded the array subscript operator so that a text file could used like an array of char pointers (or a String class if you liked). That was a perfectly good use of overloading.
Moreover I think overloading the array subscript on ordered collections also makes perfect sense.
I often wish Java had this feature. I agree with every simplifying choice they made except this one.
Yeah,
... in respect to Symantec C++.
.... because they never heared about IDEA IntelliJ or about Omnicore CodeGuide :D at home I use CodeGuide for dayly work and Eclipse for CVS.
... well, the old SNIFF IDE was crafted by the same guy behind Eclipse. But thats a guy from GOF ... and most /.ers put OO and patterns into one basket and still think assembler rules :D
indeed, debuggin in visual studio is awesome. Granted. Hm, does anyone remember the company from wich MS bought that technology? I can reboot one of my very old 486 (year 1993) PCs where I have used the same debugger on Symantec C++ 6.0 (Larry Wall, D++, ever heared about?). Frankyl, I don't see much improvement in Visual Studio, but my latest version is from 1999
OTOH, I use Eclipse at my customer sides
I would dare a statement:
*ALL* Java IDEs are *FAR* beyond any C++/Microsoft IDE. The only thing comming close to Eclipse is SNIFF+ from WindRiver (shit, forgot the old company name, was it Take Five?)
angel'o'sphere
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
I'm not too found of Intellisense, actually. I've found that 99% of the time, it locks up my interface while it searches the browser database for a tag, and or it requires me to move my hands from the alpha keys to the arrows to complete a task. It's mentally exhausting to deal with when all I want to do is stream-of-consciousness programming.
I won't even deal with auto-format which is much worse in my opinion...
But to each his own. Best of luck to you!
-Chris
----
Visual C++ user since 2.0.
I like both Java and C# from a language perspective, however, working for a large company, I would recommend Java over MS's .Net. Java has been _very_ stable and _SECURE_ while the .Net security holes have already started at only version 1.1. We also appreciated the fact that we were able to switch our Java server apps to Linux over Solaris, we could even use MS Windows if we wanted to for our Java app servers; we don't have that same choice or luxury with MS .Net.
If Tyranny and Oppression come to this land,
it will be in the guise of fighting a foreign enemy. -James Madison
In C++ the decision whether or not to make use of exceptions is hard to make. If you don't use exceptions, the results of many function calls have to be checks, which is considerably more of a hassle than Java. If exceptions are used, writing exception-safe code is really quite limiting (It often means significantly more little objects when "new" can't be used freely, and much of the existing code have to be rewritten, and I hate comments like "func() can't throw, so this is safe"). Seems that an garbage-collecting language like Java/C# is very helpful if one want to use exceptions.
Pure and utter FUD
m icrosoft-deliver-64-bin-dotnet/view
.NET for 64-bit Windows 2003. Infoworld in a recent analysis explains:
.Net Framework means that the hard work many Windows developers have put into migrating to the .Net development model is for naught on Windows on Itanium.
from http://www.manageability.org/blog/stuff/why-cant-
Despite having a research and development budget that is almost 7 billion dollars a year, Microsoft apparently can't deliver
The lack of a 64-bit implementation of the
In the meantime, IT shops that wish to employ 64-bit Windows as an application server or Web services platform will be forced to revert to the older, Windows DNA (Distributed Internet Applications) environment.
In stark contrast, BEA Systems and Sun have been shipping JRockit and J2SE with Itanium support ever since JDK 1.4.1 was released. Furthermore, according to the reports 64-bit Opteron support is expected at the same time JDK 1.5 is released.
Well, that is an API issue, not a language issue.
If you wish to address it as an issue with the Java API, the problem there is that it ignores the question of: if exceptions could be just ignored, what other changes to the Java API would be necessary in order to accommodate this? The API designers could no longer assume exceptions thrown by API methods would be caught. This would certainly have a serious impact on how the APIs are constructed and interfaced with.
Irritable, left-wing and possibly humorous bumper stickers and t-shirts
It's too easy to give C# an advantage about what it adds to Java and forgetting it's a 95% Java clone.
Don't forget It took 7 years of Java and a Borland expert to produce C# !
During this time, Java did conquer most of the enterprise application development market and defined a technology model based on application servers handling component lifecycles.
C# as a language,has taken most of java state of the art paradigms and added some new features which are neat but, despite its huge base library is far from Java versatility and degree of maturity.
Java 1.5 advantages
Java 1.5 Drawbacks
- Client Side:
- Swing (but SWT / Eclipse rocks)
C# advantages- Management aspects
- Still time to have plenty of Microsoft support if you have a interesting project.
C# drawbacksSo, my conclusion is that by now, both technologies are interesting but Java is the most versatile.
I would prefer C# for:Windows Programming ,Attractive Web based interfaces (if an acceptable target platform is Mono or Windows),
Porting existing windows applications to Web,
Simple Self-Contained Web Services
I Would prefer Java for developing:Enterprise Applications,Complex Web Services,Highly interactive web interfaces (through applets),Multi OS client application.
For me, both languages are relevant, it's only a matter of what work has to be done and what resources are available to make it.Most of the time, technology is chosen based on a company resources capabilities!
You press CTRL-Break. It's undocumented but it works, even when you're surrogate-debugging a COM object.