Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Java Programming

Java 1.5 vs C# 790

SexyFingers writes "Sun released Java 1.5. The non-API stuff that they've added made it finally "catch-up" with C# - since both languages are built to support OOP from the ground-up, their constructs become almost identical as additional OOP "features" are supported. So if you're doing C# and your foundations in OOP are rock-solid, there really isn't any difference whether you're coding C# or Java."

Here's the list of enhancements to the Java Language:

  1. Generics (C# 2.0 already supports this)
  2. Enhanced For-Loop (the foreach construct in C# 1.0, duh!)
  3. Autoboxing/Unboxing (C# 1.0 already has this, everything is an object, even the primitives - not really, but they do it so well...)
  4. 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)
  5. Varargs (C# 1.0's params construct, ellipsis construct in C++)
  6. 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)
  7. 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.]

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

Java 1.5 vs C#

Comments Filter:
  • by carpe_noctem ( 457178 ) on Monday October 11, 2004 @12:36PM (#10494240) Homepage Journal
    ...and let me tell you, java doesn't have to do that much to "catch up" to it.
  • I'm confused (Score:4, Insightful)

    by abrotman ( 323016 ) on Monday October 11, 2004 @12:38PM (#10494269)
    Where's the story? Or is this just one person's interpretation of Java vs. C#?
  • flamebait (Score:4, Insightful)

    by Bert690 ( 540293 ) on Monday October 11, 2004 @12:38PM (#10494284)
    It's times like this when you'd REALLY like the ability to mod the story itself as troll/flamebait!

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

  • by JUSTONEMORELATTE ( 584508 ) on Monday October 11, 2004 @12:40PM (#10494296) Homepage
    Why again can't I mod a story as -1 Flamebait?

    --
    I'll pay you $10. Really. [slashdot.org]
  • I want functions (Score:3, Insightful)

    by Tablizer ( 95088 ) on Monday October 11, 2004 @12:43PM (#10494338) Journal
    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.
  • by MojoRilla ( 591502 ) on Monday October 11, 2004 @12:43PM (#10494345)
    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?
  • by Dante Shamest ( 813622 ) on Monday October 11, 2004 @12:44PM (#10494356)

    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.

  • by Cloudgatherer ( 216427 ) on Monday October 11, 2004 @12:44PM (#10494364)
    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.
  • I call bullshit (Score:5, Insightful)

    by The Bungi ( 221687 ) <thebungi@gmail.com> on Monday October 11, 2004 @12:45PM (#10494383) Homepage
    There is no apparent point to this "story". It's full of grammatical errors and obvious flamebait arguments (flamebait in the context of the slashbot groupthink). What, "C# is teh roxx0rz and Java.. well, I forgot teh point I was makeing for Java"? "The open source crap argument"? Way to go.

    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.

  • Mistake (Score:3, Insightful)

    by ajs ( 35943 ) <{ajs} {at} {ajs.com}> on Monday October 11, 2004 @12:47PM (#10494409) Homepage Journal
    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.
  • Re:flamebait (Score:1, Insightful)

    by Anonymous Coward on Monday October 11, 2004 @12:49PM (#10494446)
    What's a better java debugger for large applications?
  • Re:APIs (Score:3, Insightful)

    by SnapShot ( 171582 ) on Monday October 11, 2004 @12:51PM (#10494467)
    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.
  • by jayminer ( 692836 ) on Monday October 11, 2004 @12:52PM (#10494489) Homepage
    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.
  • by daveho ( 235543 ) on Monday October 11, 2004 @12:53PM (#10494500)
    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 [jcp.org].
  • by JPyObjC Dude ( 772176 ) on Monday October 11, 2004 @12:54PM (#10494522)
    so if you're doing C# and you're foundations in OOP is rock-solid, there really isn't any difference whether you're coding C# or Java.

    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 :]

  • Re:APIs (Score:5, Insightful)

    by AKAImBatman ( 238306 ) * <akaimbatman@gmaYEATSil.com minus poet> on Monday October 11, 2004 @12:56PM (#10494535) Homepage Journal
    Let me know when stuff like an XML Parser and MD5 are native in Java.

    They ARE.

    XML package [developerd...ummaryhtml]
    MD5 and SHA support [developerd...iindexhtml]

    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?
  • by Glock27 ( 446276 ) on Monday October 11, 2004 @12:56PM (#10494540)
    Java is not any more closer than C# to open source technologies. Sun doesn't like open source, just as Microsoft.

    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.

  • Re:Mistake (Score:5, Insightful)

    by Sanity ( 1431 ) on Monday October 11, 2004 @12:56PM (#10494542) Homepage Journal
    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.
    Generics improve testability because they largely eliminate runtime ClassCastExceptions. I haven't seen any evidence to show that any of these features impose a performance penalty. Most just make the developers life easier by saving them from repeating common code patterns.
    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.
    Yeah, because hardly any companies are driven by their bottom lines...
  • by Black-Man ( 198831 ) on Monday October 11, 2004 @12:57PM (#10494553)
    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.

  • by fishbowl ( 7759 ) on Monday October 11, 2004 @01:00PM (#10494574)
    "In the case of Math, where's the bad style in writing Cos(x) instead of Math.Cos(x)?"

    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 { ... } can be.
  • by Westley ( 99238 ) on Monday October 11, 2004 @01:01PM (#10494593) Homepage
    So if you find C# abstract, where *exactly* is Java better, as a language? Or were you actually comparing the libraries? (Which bit of C# itself took hours for you to figure out?)

    Personally I find them reasonably equivalent, but C# has a few advantages (properties, delegates, events) and the .NET library has had fewer iterations so is less internally inconsistent than the Java libraries at the moment.
  • by Animats ( 122034 ) on Monday October 11, 2004 @01:02PM (#10494602) Homepage
    C++ is in deep trouble. The C++ committee is focused on additional features for templates to the exclusion of almost everything else. Strostrup has said that there's nothing really wrong with C++, and the committee buys that. So none of the huge safety problems get fixed. And buffer overflows continue to plague computing.

    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.

  • by scovetta ( 632629 ) on Monday October 11, 2004 @01:03PM (#10494616) Homepage
    You use PHP/Perl on a server? For something other than adding phpbb to your homemade website? Sorry, but PHP/Perl serves a purpose, and so do Java/C#, and they two are almost mutually exclusive.

    For enterprise-grade web-applications (not hacks), it's .NET or Java. For real applications, it's either .NET, Java, or C++.

    End of story. Don't argue with me, just accept it.
  • by nat5an ( 558057 ) on Monday October 11, 2004 @01:04PM (#10494624) Homepage
    Who modded the parent up? The post is woefully inaccurate.

    1. What exactly does it mean if a language is "open source?" Surely, the specification is available for free. If you wanted to, you could write a lexer/parser/compiler without paying anything to Microsoft/Sun. Do you mean that the tools provided by the companies aren't open-source?

    2. C# doesn't "require" a virtual machine any more than Java "requires" a virtual machine. One could write a native compiler for both. Additionally, in fact, Microsoft's .NET implementation does just-in-time compilation of the .NET assembly generated by the C# compiler (the bytecodes, basically), so it doesn't actually run inside of a virtual machine, nor is it interpreted. Since Sun's javac is supposed to generate portable bytecodes to run on different architectures, they decided to use a VM to avoid having to write a thousand different JIT compilers.

    Neither of these are inherent weaknesses in the specifications of the languages, they're implemetation details. Since this story is supposed to be about new language features in Java, I don't see how bitching about Microsoft/Sun's implementations is really relavent.

  • by mmusson ( 753678 ) on Monday October 11, 2004 @01:05PM (#10494640)
    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.
  • by Anonymous Coward on Monday October 11, 2004 @01:05PM (#10494645)
    Comparing an unreleased version of C# to the available version of Java is just stupid. Further, with no mention of the provided API any discussion is a waste of time. While JAVA offers a bloated API, it is extensible and great for programming, unlike dot NET 1.1 which seems to be an attempt to build OO on top of a procedural framework that doesn't provide the programmer with the same level of flexability. The other thing to consider is that dot NET means normally a purchase of Visual Studio, while JAVA normally means a free download of the JSDK and JCreator. Also IMHO Java doc is much better then the stuff that comes with dot NET. The rest is rant......

    Comparing a released software product that is available almost for free to an unreleased product that costs hundreds of dollars is just dumb. Where is the story here?
  • Re:I hope so. (Score:1, Insightful)

    by Anonymous Coward on Monday October 11, 2004 @01:06PM (#10494658)
    Coding standards are a waste of time to have to write and read and you know there will be plenty of people who won't follow them, or will at least gripe about their superiors having sticks up their asses for making those decisions. A language should be succinct enough that there should be no need to create a coding standard that has to specify which features to avoid.
  • Neither are open source.

    Don't want to get into a religious argument here. Being 100% open source is not always a benefit.

    Both require virtual machines.

    Really? [gnu.org]

    Despite being marketed as portable, but have portability issues.

    "They're not perfect, so toss 'em out!" Great argument...

    We don't really need them.

    Yeah, we don't really need Perl of PHP either. I do all of my web pages in assembler.

    They're closely tied to their respective companies.

    Really? [ibm.com]
  • Re:Only Microsoft (Score:3, Insightful)

    by clamatius ( 78862 ) on Monday October 11, 2004 @01:14PM (#10494737) Homepage
    I've read the arguments [artima.com] 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.
  • by pesc ( 147035 ) on Monday October 11, 2004 @01:14PM (#10494740)
    You are right. One main feature that Sun designed for Java was WORA (Write Once Run Anywhere). M$ thought this sucked. They tried to destroy that feature and got sued over it. So the invented C# instead. C# isn't WORA, it is WORM (Write Once Run on Microsoft). With C#, you are locked in again. That's the whole point with C#.
  • April 1st? (Score:3, Insightful)

    by cthrall ( 19889 ) on Monday October 11, 2004 @01:18PM (#10494778) Homepage
    > should be the support it has behind it, in terms
    > 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 .NET.

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

    You misspelled "FUD."
  • by PCM2 ( 4486 ) on Monday October 11, 2004 @01:21PM (#10494816) Homepage
    Short answer is that portability is not the purpose of the virtual machine for C# (and for many people, it's not the purpose of using the Java virtual machine).
  • Ravioli Code (Score:5, Insightful)

    by Ian Bicking ( 980 ) <(moc.ydutsroloc) (ta) (bnai)> on Monday October 11, 2004 @01:22PM (#10494822) Homepage
    I think the problem you are seeing is Ravioli Code [c2.com]; 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.
  • by spacecowboy420 ( 450426 ) * <rcasteen@NOsPam.gmail.com> on Monday October 11, 2004 @01:22PM (#10494823)
    Thread is over, 'nuff said.
  • by cpghost ( 719344 ) on Monday October 11, 2004 @01:28PM (#10494895) Homepage

    C++ is a great language, but it's choosy about its friends. It takes some time to master all (well most) advanced aspects, but as soon as you do, nothing beats a good C++/STL combo.

    What I don't like about C++ standard, is the lack of a decent socket library that would be part of the i/o streams. There are non-portable classes for this of course, and everyone could roll their own, but it's not in the C++ standard (yet).

    IMHO, one of Java/C# biggest advantages over C++ is this particular aspect. Not that it would convince me though to switch away from C++ to Java, which simply doesn't cut it yet.

    For fast prototyping, I'd stick to Python, but when performance really matters, C++ is still king!

  • by flakac ( 307921 ) on Monday October 11, 2004 @01:28PM (#10494897)
    Sorry, but there are still some major differences in the two. I've looked at the new features in Java 1.5 and agree that yes, they are definitely a plus.(Note: I code nowadays almost exclusively in Java):
    • No unsigned integer type in Java -- if you need an unsigned long, you're SOL. So it's pretty difficult to code certain numerical algorithms (compression and encryption, anyone?)
    • Java the language is inextricably tied to the JVM - C# is just another option for developing for .NET.

    For enterprise-grade work I still prefer J2EE over .NET, but that really more depends on what client I'm working for at the time. At the end of the day, both get the job done.
  • by Slime-dogg ( 120473 ) on Monday October 11, 2004 @01:31PM (#10494925) Journal

    I wouldn't give Java the credit for C#. If anything, it was Delphi that C# was built upon. The only thing that C# "borrowed" from Java is the idea of a VM, and even that functions in a different way than the Java one.

  • by Teckla ( 630646 ) on Monday October 11, 2004 @01:37PM (#10494960)

    # Neither are open source.

    How can you "open source" a language? Are you talking about compilers themselves being open source, or what? The language specifications for both Java and C# are trivially available for anyone that cares to look at them.

    # Both require virtual machines.

    This is simply not true. For example, there are at least two Java compilers that produce native executables.

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

    I work for a software company whose products target half a dozen operating systems, and based on ample experience, I can say using Java has simplified our life remarkably in terms of portability. Is it perfect? No. But just because it isn't perfect doesn't mean it's not a huge step forward in terms of making it easy to write portable code.

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

    We don't really "need" PHP/Perl/C++/Python either, now do we? This comment is just plain meaningless.

    # They're closely tied to their respective companies.

    With all due respect, this is about the only thing that makes sense in your entire post.

  • Welcome stranger! (Score:5, Insightful)

    by Oestergaard ( 3005 ) on Monday October 11, 2004 @01:40PM (#10494988) Homepage
    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?

  • by ultrabot ( 200914 ) on Monday October 11, 2004 @01:49PM (#10495089)
    C++ is a great language, but it's choosy about its friends.

    The same can be said for COBOL. I bet somewhere in the world there is a guy that likes COBOL.

    What I don't like about C++ standard, is the lack of a decent socket library that would be part of the i/o streams. There are non-portable classes for this of course, and everyone could roll their own, but it's not in the C++ standard (yet).

    Sockets, as an operating system specific issue, don't really have a place in the language standard. Especially for C++, which is used for embedded development etc.

    For fast prototyping, I'd stick to Python, but when performance really matters, C++ is still king!

    Make that "when performance really matters, and C++ can significantly improve the performance". C++ won't make your network interface or hard drive faster, for example.

    Often the smart thing to do is to first write everything in Python, and rewrite speed-critical parts in C/C++.
  • 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".
  • Re:I hope so. (Score:1, Insightful)

    by Anonymous Coward on Monday October 11, 2004 @01:59PM (#10495203)
    Actually I think Jeremy had it right (I'm SexyFingers, the one who wrote the grammatically incorrect news - but my idea was to get some points across) --- A coding standard is a requirement for any development team - you can't trust the developers to abide by it all the time, but they will most of the time. And for those times when they're not, there's the code review process.

    In the same light you're also correct - although idealistic - it would be nice to have a language out there that you wont need to to document, annotate, enforces coding style, etc. --- but that's an ideal (i think) - Knuth is making a stab at it with CWeb, his literate programming stuff (just google: Literate Programming), and in the meantime, the world keeps turning...

  • by killjoe ( 766577 ) on Monday October 11, 2004 @02:01PM (#10495230)
    "Really Good Ide. "

    Eclipse supports most languages including python, php, perl and ruby.

    "API."

    Perl, Python, Ruby and PHP have enourmous libraries to make whatever you are attempting easy.

    "Consistency. "

    The languages I have mentioned have been "pretty consistent". No language is completely static and each language is trying to improve the best way they know how but they have all kept backwards compatibility pretty good.

    "Open source. This is not an argument. In fact, for enterprise world, open source sounds much more problematic than any of good old microsoft solutions."

    Well this certainly explains why nobody is using mysql, linux, apache, bind, jboss or any other open source project in any enterprise whatsoever. By golly I think you have something here. Which leads me to.

    "They are GUARANTEED to receive support, "

    Gee only if there was one or two companies who provided support for open source projects. Too bad you can't buy support from companies like IBM, Novell, RedHat, Mysql etc. Wouldn't that be cool if you could buy support for open source projects.

    BTW I am happy that MS provides GUARANTEED support. All those people who bitch about the crappy MS support and documents are all probably liars or open source racist hippies who enjoy dirty jokes.

  • by fitten ( 521191 ) on Monday October 11, 2004 @02:04PM (#10495261)
    How exactly does it pale in comparison? What features does it have that make it better? What features does VS.NET lack?
  • by Corngood ( 736783 ) on Monday October 11, 2004 @02:05PM (#10495271)
    The can and do, he doesn't know what he's talking about. You don't need multiple inheritance to make circular inheritance.
  • by dpw2atox ( 627453 ) on Monday October 11, 2004 @02:05PM (#10495273) Homepage Journal
    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.
  • by deadlinegrunt ( 520160 ) on Monday October 11, 2004 @02:08PM (#10495313) Homepage Journal
    Wow. I am amazed at your opinion and wish to understand it but I have to admit I reserved to just think that you do not know what you are talking about.

    [snip]
    "This problem is the primary reason that C# exists. If the C++ committee had fixed their language, we wouldn't need C#."
    [snip]

    First, this is not why C# exists. For real reason as to why it is search the net. Enough info out there without me reiterating it.

    Second, there is "nothing really wrong with C++" and the reason the committee buys that is because it is true. The language specification spells out, as a single example, that if you index beyond the end of an array or dereference a null pointer BOOM! Undefined behavior, as in may work with some sort of reasonable expectation or may unleash flying monkey demons from your spouses nose with the sole purpose of ruining your computer career.

    Third, C++ is not an OOPL like Java or C#. It is a multi-paradigm langauge with support for any type of construct you want to throw at it - including shitty code regardless of paradigm.

    Again, I am trying to understand where you are coming from but I just do not see your point - or more directly that your point is valid.

    C++ as a language is not really lacking at this ponit. Now standardized libs, like the inclusion of the STL was to the standard, are welcome. Things like concurrency, threading, gc, GUI, etc. Yes there are plenty out there but none of them "officially" standard yet. I think this argument would support your point better, if I was understanding what you meant rather than what you typed.

  • by mrright ( 301778 ) <rudi.lambda-computing@com> on Monday October 11, 2004 @02:13PM (#10495386) Homepage
    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.
  • by rabtech ( 223758 ) on Monday October 11, 2004 @02:19PM (#10495454) Homepage
    Funny, I always thought having the ECMA control and adopt a standard was "more open" than Sun's "we're open, as long as you don't propose something we don't like" process.
  • by Fnkmaster ( 89084 ) on Monday October 11, 2004 @02:21PM (#10495476)
    Yes, but are you sure it's stepping you in the right direction?
  • by WebfishUK ( 249858 ) on Monday October 11, 2004 @02:33PM (#10495591)
    One of the reasons that Fortran has such reusability is because everything was an array. It was eaasy to use some elses function I just had to re-organise the elements in my array (you soon build a library of functions to do this that you use a lot). The problem with OO languages is that you get complete ability to define clever objects which you (and me) always assume will be the focus of everyones life. It becomes very difficult to reuse stuff not from a coding point of view but because the object you have to work with is never exactly what you wanted.
  • by shatfield ( 199969 ) * on Monday October 11, 2004 @02:52PM (#10495821)
    It becomes very difficult to reuse stuff not from a coding point of view but because the object you have to work with is never exactly what you wanted.

    This means that you just subclass the object that doesn't quite fit your needs and either extend or override the original functionality. That's the beauty of OOP -- plan well, and you're options are unlimited.
  • by slyckshoes ( 174544 ) on Monday October 11, 2004 @02:54PM (#10495847)
    "Java the language is inextricably tied to the JVM - C# is just another option for developing for .NET."

    Personally, I'd rather be tied to a JVM than an OS. There are JVMs for AIX, Linux, Windows, Mac, HP-UX, and others. Last I checked Windows was only available for IA32/64. Sure there's mono, but that's not yet a realistic option for enterprise development.
  • by swilver ( 617741 ) on Monday October 11, 2004 @02:55PM (#10495861)
    C's implementation of abstracting machine code is just a compiler hack, the underlying machine code has not changed. The only benefits are some compiler errors and warnings and not performance and storage efficiency that real machine code can offer.

    Seriously, I couldn't care less about better performance. I care about being able to avoid probably 75% of all casting that goes on in our 10.000+ source file project and being able to specify our API even tighter and catch more problems before it hits our customers.

    I just wish Sun had done this 3 years ago, but better late than never.

  • by spacecowboy420 ( 450426 ) * <rcasteen@NOsPam.gmail.com> on Monday October 11, 2004 @03:23PM (#10496137)
    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.
  • by scovetta ( 632629 ) on Monday October 11, 2004 @04:59PM (#10497054) Homepage
    As soon as people mention "enterprise-grade web applications" it's time to skip to the next thread. These people live in a little world that's been built for them by small minded project managers, clueless clients, and a university programming course that's been bought and paid for by a large corporation (usually Sun Microsystems).

    I take exception to that. Just because you can't do it doesn't mean that it can't be done. Maybe where you're from, Sun runs things, but here, it's the business-- how can you get the job done better and faster? And Java has proven to be a useful tool, when used by competant programmers (not Learn Java in 21 Days type).

    I'll try to make my case for "enterprise-grade web applications". Such an application needs the following features:
    1. Does what the customers want
    2. Secure
    3. Database-driven
    4. Clustered/clusterable
    5. ***Maintainable***
    6. Performs well
    7. Integrates with other systems
    8. Deliverable by the deadline
    It's #5 and #8 that are hard to come by. As for maintainability, I see Perl as a Write-Once language, with PHP only slightly better. Java/C# are much easier to maintain because (a) their syntax is not prone to being overly compact (read: unreadble), and (b) the number of people who can maintain Java applications is probably much larger than those who can modify your Perl app.

    You advocate Java and slam PHP in the same post? Both of these languages belong in the same beginners class.

    Where do you work that Java is considered "beginner"? Have your company actually produced applications?
  • by SnprBoB86 ( 576143 ) on Monday October 11, 2004 @05:17PM (#10497181) Homepage
    Out parameters are kind of neccesary if you have ref parameters. They are basically ref parameters that MUST return a value and because C# requires all variables be initalized, if you have ref, you must have out and you must force all ref params to be initalized before being passed in.

    Out parameters are mainly for use with API calls that return strings and such in reference paramters.

    As far as I know, nowhere does the base class library use out paramters (I am sure there is somewhere, but it is probably obscure or related to native interop).
  • by GCP ( 122438 ) on Monday October 11, 2004 @05:50PM (#10497508)
    And I was a member of one of the JCP expert groups that brought you Java 5.

    java doesn't have to do that much to "catch up" to it.

    Stated another way, Java 5 is still behind C#, to which I would agree.

    As to how far behind, that depends on what you value. Java's event handling/callback design is atrocious compared to the convenience of delegates. I would much rather pass a single method called OnAccountOverdrawn()to the event notifier than the Java style of making the whole class an instance of some interface, implementing stubs for all the useless methods of the interface, then implementing the one useful method--which will have a useless name like DoAction() that you can't change, then passing the object that contains the DoAction() method to the event notifier.

    And for many things such as generics, autoboxing, enums, etc. (I don't recall which ones specifically), there are actual semantic differences in the virtual machine for C#, whereas Java's knockoff versions are just syntactic sugar for the writing out the equivalent source code yourself. I AM in favor of syntactic sugar, but having the actual semantics available in the underlying runtime gives you additional advantages.

    Java's great advantage is its ubiquity, which is also an impediment to improvement. Sun's position was that it was pretty much finished with language improvements after Java 1.1 and would thereafter concentrate on libraries that would run on existing JVMs. New JVMs might run the code even better, but the old JVMs would still run it.

    Microsoft knew they had to do better, or nobody would switch. They did a lot of things better, and they seem committed to doing more, even if it means obsoleting their existing VMs. They have far more control over The (One) Platform and seem quite willing to make improvements to C# and the other .Net technologies that will require a VM upgrade.

    One catgegory of improvement they seem interested in is a way to make dynamic languages, like Python or Lisp, work REALLY well. Another is support for functional languages like Haskell or OCaml that have special needs of their own.

    And if they do it well, (my speculation now), they could even add some of the attractive features of those languages, languages I like more than C#, to C#, widening the gap with Java.

    Java might have a very hard time keeping up with C# improvements while anchored to existing runtimes, and letting go of the anchor would seriously impact its ubiquity, which is one way in which Java is vastly better than C#.

    I don't think it's a given that Java is going to catch up to C#. But if Mono and/or DotGnu don't succeed, it may not matter as Windows fades away (which I believe it will).
  • by p2sam ( 139950 ) on Monday October 11, 2004 @06:35PM (#10497907)
    I would had prefer Java 2000 over Java 2. The first one is clearly meant to be used for marketing purposes ( I think you Sun guys call it branding ). The later is ambiguous. I can't tell if it's a marketing name or an engineering version name.
  • Re:Ravioli Code (Score:5, Insightful)

    by metamatic ( 202216 ) on Monday October 11, 2004 @07:04PM (#10498190) Homepage Journal
    Similarly, object orientation should be used as a tool, not enforced as a religion. If an object-oriented API to some functionality is the cleanest and most useful, implement that way; otherwise, don't. If the best way to build something is using functional programming, do that; don't try and force the code into an object-oriented paradigm.
  • by ckaminski ( 82854 ) <slashdot-nospam.darthcoder@com> on Monday October 11, 2004 @09:03PM (#10499221) Homepage
    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.

  • Bias article? (Score:3, Insightful)

    by AstroDrabb ( 534369 ) on Monday October 11, 2004 @09:12PM (#10499286)
    I use both Java and C# professionally and this post smells of bias.
    in my NSHO, the Java API has become bloated...
    Huh? The Java 5 JRE download is 14 MB, while the .Net 1.1 runtime is 24MB. The Java 5 SDK download is 44MB while the .Net 1.1 SDK download is a whopping 109MB! Which one has bloat again? Java by far beats out C#/.Net as far as 3rd party modules goes. Anything you can think of programming, there is something available in Java. I cannot say the same yet about C#/.Net.
    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
    Does this guy know _anything_ about the Java community? The fortune 500 where I work had a few meetings trying to figure out which vendor we would use for our JAVA IDE. There was no choice with our C# IDE, it was just MS. For Java, we looked at IBM, Sun, BEA, JCreator, Eclipse, IntelliJ and Borland. If SUN died, we would still have _PLENTY_ of choice.

    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 [zdnet.com] 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.

  • by Anonymous Coward on Monday October 11, 2004 @11:02PM (#10499930)
    C# is better than Java in almost every way. Java has better enums and support for covariant and contravariant generic type parameters, but that's about it.

    I think that languages are pretty similar in so many ways that there's not much point in trying to claim one a clear winner. But personally I just find C# tries too hard to pack "just one more feature" in. There are things that definitely should have been left out; and in pretty much every case it's been one of mistakes C++ made. Operator overloading is specifically one such case. It's bad and evil, and not much better than multiple inheritance. The only reason to allow it is to make user types act like primitive numeric types. You can always come up with the bland old "but it's cool if I need complex numbers" argument, but otherwise it's just a complicated feature (to support by language) worth little.

    Now, one could claim that if operator overloading was limited to just the most useful cases (assignment, indexing, derefencing) it might add nice amount of syntactic sugar. Maybe, maybe not; I just prefer not having the whole mess at all. Infix notation works for numbers, since that's how mathematics notation is. It doesn't have to mean a thing for user types. And finally, while leaving operator overloading wouldn't by any stretch of imagination prevent bad code from being written, leaves open one more way to write it, without getting anything else out of it expect for allowing "clever" use of indexing over collection types. And even that feature could have been implemented using methods other languages (like Python) use, to make it somewhat useful, as it doesn't try to pretend you can fully redefine meaning of infix operators.

    Not surprisingly, I also thing ref types are silly, but at least it's consistent with "C++ subset" theme of C#. Also... whereas C# could have truly allowed efficient stack-based allocation, even transparently (or with just one keyword), they just screwed it up completely. Due to automatic copying etc., it's often useless for thing it should help with, performance improvements. Weird thing is Microsoft had done best research papers on subject (doing implementation in Java!), they completely failed to make anything useful out of their expertise for C#.

    There are couple of nifty things C# has that would be good additions to Java; specifically delegators /event handlers. And metadata is a nifty idea, but C# implementation shows that they didn't copy it from Java -- it's pretty much alpha quality, decent idea, not too stellar implementation (including defining API... which makes it hard to fix later on)

    I do agree in that returning tuples is one thing that languages in general should have... it's really strange it is not there, as adding that would be an obvious yet quite simple thing to do.

  • by kaffiene ( 38781 ) on Monday October 11, 2004 @11:09PM (#10499992)
    Properties are also good. Instead of identifying them through string matching ("get*", "set*"), language-level support for properties allows more accurate data type modelling. In the end, however, the CLR doesn't really have true support for properties.

    I disagree. Properties increase the number of entities you have to deal with - there used to be member values and member functions, now in C# you have memnber functions, member values and member properties. Many times in C# I find my code breaking because what I thought would be a property is implemented as a getter and setter or vice versa. This ends up wasting your time reading documentation to find which way getting the value is implemented. This is never a problem in java, it's always getMyVal();

    The other thing with properties is that they look like fields, but don't work that way, for example, if B and C are implemented as properties, then this will not compile under C#:

    A.B.C = someVal;

    I beleive it's because the A.B bit puts the B value on the stack and assigning a value to it doesn't get back into A. At any rate, it doesn't work and to me it's pretty obvious that it should.

    Function pointers and anonymous functions. This has got to be the biggest improvement over Java.

    Again, I disagree. Function pointers are not a good feature. Implementing an interface in Java (which is the equivallent process to function pointers in C#) is better because the interface expresses a contract and the naming of the functions involved reflect that contract. What I mean is that when I see this in Java:

    public void actionPerformed(ActionEvent ae)

    I know that I've found a method fullfilling the ActionListener contract - what's more, the class involved will say implements ActionListener so the existence of the contract is explicit. With C# I could find a function like so:

    public void myfunc(object sender)

    ...And that could be the end point for any old connection between classes. The good thing about OO is that the methods on classes represent the communication contract between entities. This is an important API and should be as explicit as possible, not virtually rendered anonymous as in C#

    And in the end, the obvious difference between Java and C# is that Java is everywhere and open and C# isn't. Yes, .NET has *parts* of it as an ECMA standard, but ECMA standards *DONT* exclude technology which is patent encumbered. Meanwhile there are dozens of open source Java implementations and Java exists on pretty much every machine under the sun.

  • Re:Only Microsoft (Score:2, Insightful)

    by mcc ( 14761 ) <amcclure@purdue.edu> on Tuesday October 12, 2004 @02:25AM (#10500961) Homepage
    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.
  • by dweeves ( 520351 ) on Tuesday October 12, 2004 @06:29AM (#10501657)

    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

    • Language Features/Libraries:
    • Server side Programming:
    • Defined server side technology paradigms, with lots of implementors to handle them (open source and free ones are competing with the best commercial ones).
    • Client Side Programming:
    • Applets (which aren't dead technology if you know how to use them)
    • Web Start
    • IDE/Tools
    • Eclipse (which is free and open)
    • Management aspects
    • Lots of available skilled developers
    • Can run on any platform with a compliant JVM (if well coded)
    • All big database vendors have JDBC drivers
    • Mature technology

    Java 1.5 Drawbacks

    • Server Side:
    • Web Service support are expensive to implement and non-standardized.
    • Very poor JSF controls
    • Client Side:
    • Swing (but SWT / Eclipse rocks)
    C# advantages
    • Language Features:
    • Benefits from the .Net Jitter.
    • Events/Delegates model
    • Client Side:
    • Future Windows Development preferred language (along with XAML which is more about powerful UI macro-scripting)
    • DirectX integration
    • Speed (on Windows)
    • Server Side
    • ASP.Net Controls model
    • IDE/Tools
    • VS .Net (most productivity boosting IDE IMHO)
    • Management aspects
    • Still time to have plenty of Microsoft support if you have a interesting project.
    C# drawbacks
    • Language Features
    • No Observable/Observer (but achievable through Events/Delegates)
    • Serialization limitations
    • Client Side
    • No Windows independent GUI framework. (WebForms are server-based controls)
    • No applets equivalent (don't event think about ActiveX)
    • Server Side
    • No detailed Infrastructural model, No best practices, No fine grained control.
    • IDE/Tools
    • No free IDEs compares to VS .Net and is really useable when you're used to commercial IDEs features. (Borland C# Builder CE is too restricted and not open source)
    • Management aspects
    • Young technology
    • Not that much real experts available out of Microsoft
    • Windows deployment only (Mono's out, but still work in progress ,can't be a professional choosen .NET deployment platform yet IMHO)

    So, 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!

  • by archeopterix ( 594938 ) * on Tuesday October 12, 2004 @09:14AM (#10502520) Journal
    This is why there is actually not anything fundamentally wrong with our C++.
    Except that you can actually program a GPF in C++. I call this fundamentally wrong.

"Ninety percent of baseball is half mental." -- Yogi Berra

Working...