Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
Java Programming

Advantages Of .NET Over Java 125

ansonyumo writes "ZDNet is carrying an article written by one John Carroll that outlines specific advantages of .NET over Java. It's written from the point of view of a Java advocate who has 'seen the light.' First of all, comparing .NET and Java isn't very fair; you have to compare .NET and J2EE. When you level the playing field, most of his arguments readily fall apart."
This discussion has been archived. No new comments can be posted.

Advantages Of .NET Over Java

Comments Filter:
  • by rumpledstiltskin ( 528544 ) on Wednesday May 07, 2003 @04:06PM (#5905110) Homepage Journal
    when you compare to the correct language structure, so what? What's important is PHB's will probably be reading articles like that, and will point to said articles in justifying going with a microsoft centric language (along with IEEE, ECMA standardization, etc.) The article simply underscores that a wide and varied skillset is what's going to keep a developer alive in today's environment. Sun's not exhibiting the best of business decisions lately, and if they want to stay afloat, they need to come up with someone to answer .Net effectively in popular media. Posting articles on slashdot saying "look at this! it's not accurate!" isn't a great way to promulgate usage of your favorite language either...
  • by L. VeGas ( 580015 ) on Wednesday May 07, 2003 @04:06PM (#5905114) Homepage Journal
    Not surprisingly, ZDJava has an article that praises Java over .NET
    • .Net is just a knockoff of Java and Java is an attempt to improve C++. Is it any wonder that 6+ years later C++ is still standard for system programming? C is standard for many open source projects and after 6+ years no one has managed to find a replacement for C++. Platform independence is hogwash. Java could supplant C++ but instead Sun has loaded it down with a bloated Class library and poor native support and JIT bytecode. Sun forces you to program a certain way and criticizes any alternatives. Enu
      • Your post really demonstrates absolutely that you are completely ill informed and unable to prepare any sort of real argument against Java for C++. I am sick and tired of people crying "Java is to slow" as this viewpoint just personifies the inability of people like yourself to think no further ahead then tomorrow. Firstly, the concession must be made that Java GUIs, particularly those with a great deal going on are slow and simply can not compete with their natively compiled competitors. That said, Java fo
        • This is the first time I have posted at slash dot and I made the mistake of posting as HTML without including any
          's I apologise if this makes my response difficult to read.
  • "Of course, .Net is still a mostly Windows party, while Java offers the chance to work on a large number of platforms. As I've noted, however, Mono offers a complete implementation of the .Net Framework for Linux, and there are companies already who promote their .Net product's support for non-Microsoft systems."

    is mono really comparable to the microsoft windows .net implementation? as in everything that goes around the shisbang too?

    mostly the article just goes on through javas features and glorifying the
    • Mono is not complete. It is not even yet comparable to the "Shared Source" version, which is less complete than the windows verison.

      Though I've had limited experience with .NET, and only then with C# on BSD, it's pretty obvious that a lot of the standard library was designed around COM and Windows in general. Many parts of the standard library are crippled to the least-common denominator of the .NET platform: visual basic. What does this mean? No interoperability with unsigned data types, for one.

      Incid
    • is mono really comparable to the microsoft windows .net implementation?

      Not even close at this point, AFAIK.

      Mono also has the threat of MS patent enforcement hanging over it. Use it at your own risk.

      Java is far more cross-platform, and performs roughly as well on the same hardware (server stuff). The client side is also getting better with improved Swing (on Mac for instance) and SWT for even better "native look and feel".

      Download Eclipse at www.eclipse.org to see a first-class modern Java applicatio

    • (i'm not aware of implementation for my other computer running beos.) I know of two tentative ones: the BeKaffe project (attempting to port Kaffe to to BeOS) at http://bekaffe.sourceforge.net/ [sourceforge.net] and the Guavac project at http://www.bebits.com/app/1195 [bebits.com]. The first is having development problems (that is, capacity problems with respect to people) and the second is at the 1.1-level, unfortunately. But you can check them out, I suppose. Of course, I wouldn't expect too much in future any more. BeOS seems to have
  • by Dr. Bent ( 533421 ) <ben@nosPam.int.com> on Wednesday May 07, 2003 @04:32PM (#5905354) Homepage
    So, according to this guy, the advantages are:
    1. XML property files
    2. Better reflection support
    3. No individual class files, only improved class bundles called "Assemblies" (this is a good thing)?!?
    4. ".Net Remoting" - basically RMI with support for any .NET language

    First off, I have to give him some credit. This is the first time I've ever seen a specific breakdown of exactly what .NET is good at that Java isn't. And he's right, these things are pretty cool (except maybe for #3).

    But would I trade J2EE for this? Not on your life. All of this stuff can be done in one way or another with Java, and Java is still way more mature in most respects. I mean, I'm assuming that since he chose to highlight these features, they're probably the most significant, and if this is the best that .NET has to offer over Java, the choice is clear for me.

    If I was going to develop a new Windows app, I'd be doing it in .NET, no question. But when it comes to cross-platform or enterprise level development, .NET is not ready for prime time.
    • for point #3 java has jar files which is a simpler version of an assembly. so bundling itself is not the real attraction.
      What is really cool about assemblies is that you can dynamically generate them using classes exposed in the core framework.
      i just wrote a sophisticated Database layer making my database object oriented. it took me 2 weeks and works perfectly.
    • by bwt ( 68845 )
      I don't find #1 persuasive. If you want XML in Java, you use XML tools. Properties aren't XML, they are properties. They SHOULD be simple as in my.properties.property2="bingo" . If you want XML, just use XML. Java has the best XML tools of any language there is.

      #2 is OK, but if you can find the methods, you can find anything, so what is the advantage?

      #3 is just odd. Java has jar, war, ejb-jar, etc... archives and also has classes by their lonesome. .Net has only archives. How is this better?

      #4 is a joke.
      • by MobyDisk ( 75490 ) on Wednesday May 07, 2003 @08:48PM (#5907132) Homepage
        I don't think you read the article.

        #1: You referred to property get/sets, but that isn't what the author was talking about. He was talking about external configuration files, environment configuration files, an serialization.

        #2: The author explicitly lists what information, beyond the methods, you can get from .NET. To briefly reiterate, he listed meta-information about methods which is necessary to make it truly useful. Knowing a method name and parameters isn't the whole deal.

        #3: You ask "how is this better?" which is exactly what page 3 of the article describers. The author explicitly lists advantages of archives over JAR files. He points out that it isn't a magnanimous difference, but he certainly answers your question.

        #4: You've obviously never done cross-language RMI. One of the running Jokes about Java is that Java is great at communicating with other languages: so long as the other langauge is Java. Microsoft has taken cross-language support to a new level - which is one of the things that really attracts VB, Java, and C++ developers to .NET.
        • You referred to property get/sets, but that isn't what the author was talking about. He was talking about external configuration files, environment configuration files, an serialization.

          Pardon me if I'm wrong, but doesn't the Torque project do this? Same for Maverick, if I may point out.

        • #1 Java also has XML serialization.

          #2 You can also introspect bytecode. Admittedly,
          it is not as well-developed as .NET in this respect,
          but there are no inherent limits.

          #3 I could not care less about, so no comment.

          #4 For cross-language, use CORBA. Java makes it
          trivial.
        • You've obviously never done cross-language RMI. One of the running Jokes about Java is that Java is great at communicating with other languages: so long as the other langauge is Java.

          A running joke that I've not encountered in six years of professional Java programming. CORBA make cross platform, language independent programming a breeze. My current employers hand crafted database (written in C and running on various Unix flavours), communicates very elegantly with a Java frontend via CORBA. For embedde


        • #1 There are probably 15000 Java projects in existence today that use XML heavily for all the things you listed.

          #2 If you know the method names and parameters, you know enough to get whatever information the class designer thinks you need to have to use the class. I have never once been in a situation where I needed more. This is a "so what" improvement.

          #3 The two supposed advantages ("unique identities" and "reflection") seem harmful to me. It's like the language designers forgot everything about OO prog
    • So, according to this guy, the advantages are: 1. XML property files

      Guess the guy doesn't know about java.util.prefs.Preferences [sun.com].

    • If I was going to develop a new Windows app, I'd be doing it in .NET, no question. But when it comes to cross-platform or enterprise level development, .NET is not ready for prime time.

      why go that far? That's why we have SWT from IBM. Think AWT, but not crap. It's native windows/gtk2/cocoa/motif, and it's cross platform. It's by far the best windowing toolkit i've seen. If you haven't seen it before, download eclipse [eclisep.org] to see what i mean.
  • Will system designers go after M$'s stuff after what M$'s attitude and history in the past 10-15 years been. I mean M$ proved that it does not seek best performance, is not after user's intrest, does not care for for service. It cares for the greens. In the past few years they did a lot of stuff that made it clear now that they were putting us in a box that can stick us to use there products only(with no respect to its quality)

    so the real question is are you willing to go through this again?

    /*Why is ther
    • by Slarty ( 11126 ) on Wednesday May 07, 2003 @06:53PM (#5906471) Homepage
      Yes, of course they will. You read Slashdot, so while you may not necessarily USE competing systems (Java or open source OS's), you're undoubtedly aware of them, and that Microsoft doesn't always make the best software or decisions.

      I work for a company that works solely on Windows software, and I can tell you, our system designers don't have the benefit of such knowledge. They are totally buying in to the .NET hype, and not without reason... .NET may not be the savior of the software world, but it IS a heckuva lot better than the old method of MFC or Win32 development. By far.

      Our designers are not stupid; they just seem incapable of thinking outside the Windows world. You don't know what "mindshare" means until you've seen this in action... Microsoft products have a total lock on their way of thinking. They just won't consider any alternatives, they use Microsoft stuff, and they LIKE it. A friend and I are gradually introducing open source stuff (an internal web app I wrote uses PHP and MySQL as opposed to ASP/SQL Server... and I had to fight for it!) but mostly, Microsoft is ALL THERE IS to them. That's why .NET will succeed, at least partially. You don't notice any problems with performance or security or service if you've never used an alternative (and be honest, many of the alternatives aren't that hot either).

      Unrelated rant... after all these years, why do people still think it's cool to refer to Microsoft as M$? I'm not defending Microsoft software or business practices, but come on. That's just childish. It's not like you're going to gain any real karma or respect by doing that, and it's not like you can't find enough to be mad at Microsoft about without resorting to petty name calling. It's not even original anymore.
      • after all these years, why do people still think it's cool to refer to Microsoft as M$?

        <tongue-in-cheek>
        Because MS stands for Multiple Sclerosis.
        </tongue-in-cheek>
      • by MeanMF ( 631837 ) * on Wednesday May 07, 2003 @09:52PM (#5907469) Homepage
        Our designers are not stupid; they just seem incapable of thinking outside the Windows world. You don't know what "mindshare" means until you've seen this in action... Microsoft products have a total lock on their way of thinking. They just won't consider any alternatives, they use Microsoft stuff, and they LIKE it. A friend and I are gradually introducing open source stuff (an internal web app I wrote uses PHP and MySQL as opposed to ASP/SQL Server... and I had to fight for it!) but mostly, Microsoft is ALL THERE IS to them.

        I'm the lead architect at a shop that also uses mostly Microsoft tools for internal development. Our development staff would not be considered to be great programmers, but they do have an excellent background in the industry we work in. VB is the perfect tool for this type of programmer (even VB.Net has a ways to go). I understand that you're talking about the designers in your company, but here's the reason I'm bringing this up. I have had to deal with consultants and one new hire in the past couple of years who have recommended bringing in or converting to open source software, and one who even went over my head to try to sell the idea to upper management (spectacularly unsuccessfully - he didn't make it past his probationary period, and it wasn't my decision). It may seem to them like I am brainwashed by Microsoft or that I am being closed-minded by asking them to write VB or ASP code that runs against SQL server - which is what they were hired to do in the first place - but in fact we are currently using the best tools for our particular environment. I don't know if this is the case in your organization, but it may not be Microsoft's "brain lock" abilities - it may just be that the designers have heard it all before and just aren't really interested in rehashing the same old debates. In our case if we completely eliminated all of the licensing costs for Microsoft development tools and SQL Server, I doubt that anybody would even notice the change in our IS budget. The money spent is well worth it to us.
        • A voice of reason from the dark/other side. I'd like to build on your point.

          As a programmer/developer you will, or at least should, go through a larval stage of trying every new language and taking pride in the breadth of your knowledge. This is extremely healthy for a long and happy career. However at a certain point you might want to start pulling the strings and move up to principal/architect, whatever it's called at your company. If you think you're going to get there by knowing a bunch of language
          • It's like dating. You spend a while finding out what you want. Eventually you find it, or find something you're reasonably sure is it. Stick with it for a while. Things going good? Stick with it for a long while.

            That's a great analogy, and I think you can extend it to organizations as well as individuals. For most companies, and I'm talking about companies not in the software business, it doesn't make sense to constantly change platforms to keep up with the latest trends. Even if a new platform is techn
          • Horses for courses. I have a friend currently programming something in VB5, and while I loathe VB in all its forms, I do support the fact that for his given program, he can accomplish his goals far quicker and easier in VB, for his course, VB is the horse.
        • Even if you used Delphi you would be better off than VB...not an OSS thing but a general usability and code speed, reliability, quality dev environment thing.

          SQL Server is a load of crap as well. I cannot imagine justifying it on any basis but you didn't know any better. It has some clustering capabilities that the freebies don't have, but other than that it's not worth much.

          Incidentally, did you apply the Slammer patch? (otherwise known as SQL Server 2K SP3?)
          • Even if you used Delphi you would be better off than VB...not an OSS thing but a general usability and code speed, reliability, quality dev environment thing.

            Not all decisions are made on which technology is better. There are other factors such as the availability of programmers, third party tools, and technical support. VB beats Delphi hands-down in all three cases. Usability, speed, and reliability are more than adequate with VB to make them non-issues for us.

            SQL Server is a load of crap as well.
            • I suppose given the choice of Oracle or MSSQL I would probably take the latter. I have SQL servers running here so I can't fault you much really, sorry for making you feel bad.

              Glad you patched - that vulnerability is rotten. I know a lot of dev servers didn't get it though.

              In regards Delphi - I use it personally but getting others to do so is rough. I suggest that 3rd party tools for VB are hacks to get it up to snuff, and contribute to significant instability. Also, Delphi will use OCX, etc. Still,
            • As far as SQL Server goes, we rely heavily on stored procedures so the availability of freebies is moot for the time being.

              Just an FYI: PostgreSQL [postgresql.org] has stored procedures with many available languages.

      • Slarty, I know exactly where you are coming from. And this mind-share is only going to get worse. Microsoft is going after the CS curriculum itself. In a few years I wonder if J2EE will be a dirty word! Check out this article( Robbing The Cradle [sulekha.com] )to see what I mean. peace out.
  • by zulux ( 112259 ) on Wednesday May 07, 2003 @04:38PM (#5905404) Homepage Journal


    I don't do a lick of Java or .NET programming - but I can tell you that .NET is usless for real work, on real computers.

    It's only available for x86 computers that run Windows.

    No mainframe support.
    No cluster support.
    No Solaris,Unix,*BSD,OS/2, Win95, Mac 9, Mac X, AIX, IRIX support.
    No Aplha, SPARC, PowerPC, Motoroal 68xxx suport.

    So sure, .NET may trounce Java if you want to make a Recipe-Card manager for Grandma - but if you have any heavy lifing infolved, forget it.

    * parts of the .NET language support facilities do run on other computers (C# looks like a good versoin of C for people who can't handle pointers) - but Microsoft keeps the .NET libraries close to their hearts.

    • Microsoft released [microsoft.com] the source to an implementation that compiles and runs on Windows, FreeBSD and MacOS 10.2.

      Mono [go-mono.org] is a clean-room implementation that runs natively on x86 Linux and interpreted on PPC, S390 and StrongARM.

      I realize you don't do a lick of Java or .Net programming, but, just like the press, that doesn't excuse you from checking the facts first.
      • by zulux ( 112259 ) on Wednesday May 07, 2003 @06:07PM (#5906133) Homepage Journal

        Mono [go-mono.org] is a clean-room implementation that runs natively on x86 Linux and interpreted on PPC, S390 and StrongARM.


        Mono is not .NET - it will not have Microsoft's .NET libraries.

        99.99% of all .NET applications won't run on Mono.

        Some C# programs can run on .NET and Mono - but not any appplication that uses the Microsoft .NET libraries (99.99% of them)

        Microsoft released [microsoft.com] the source to an implementation that compiles and runs on Windows, FreeBSD and MacOS 10.2.

        As per Microsoft license for this release, you can't do any comercial work with it. You can't modify it and distribute for comercial use.

        It's useless.

        Microsoft has horrible support for it's languages - they left their Pascal, Fortran, VB users without any support. FoxPRO will probably be next.

        I woulden't bet my future on .NET - not even Microsoft is releasing the next version of MS Office on .NET.

        • Portability never follows if you code to platform features. Ask WebSphere developers about that.
          In any case, to be considered a compliant implementation, it need only meet the standard set out by ECMA for the CLI. Sun could do worse than to submit Java(tm) to a standards body for ratification.
        • Mono is not .NET - it will not have Microsoft's .NET libraries.

          This is not entirely correct.

          While it is not ximian's goal to produce a fully .NET-compatible runtime, there is definitely work being done as part of the mono project to support almost all of the non-EMA managed .NET runtime libraries, including ADO.NET, ASP.NET, WebForms, WinForms, Remoting, XML, SOAP, WebServices, EnterpriseServces, etc...

    • Have you considered looking into a different career?

      You might want to keep your options open if you're going to bet against successful technologies.
    • So sure, .NET may trounce Java if you want to make a Recipe-Card manager for Grandma - but if you have any heavy lifing infolved, forget it.

      Heavy lifting eh? You might want to take a quick little trip over to the Transaction Processing Performance Council [tcp.org]. Take a look around! Windows and .Net are kicking in the other vendors' teeth in both clustered and unclustered modes in terms of performance and cost/transaction.

      Now if I could just get someone to give me a Superdome to play with....

  • J2EE response (Score:5, Insightful)

    by wickedhobo ( 461297 ) on Wednesday May 07, 2003 @04:46PM (#5905485)
    A lot of this is basically a load of crap. Plenty of people use XML for configuration issues. I personally still use text for most of my config files, just because it requires simpler and easier code.

    And all of the default configuration files in J2EE ARE xml. web.xml,ejb-jar.xml, whatever.

    Also, what's so great about having your "system wide " xml parser? In my world, you specifically don't create environment variables for your XML jar's because that makes it a common resource and creates conflicts. What if you want to use a different parser and both parsers have a class called XMLParser? How does MS deal with knowledge of which is which. J2EE servers (for the most part) simply provide application level resources (WEB-INF/lib and WEB-INF/classes) and server-level resources (app-server/lib).

    Next: Metadata: XDoclet provides this ability and a lot of people use it. More importantly, it's not tied. You can use your own system.

    Next: I honestly don't know enough about assemblies, but it does look like there are some cool things in there. I have to admit, CLASSPATH for Java can be clunky. However, JAR/EAR/WAR is pretty good stuff, and does most of what people need.

    Next: The remoting issue is a non-starter. The protocol is really up to the vendor, and some vendors provide proprietary, somy RMI/JRMP, some strict RMI-IIOP. SOAP also changes some of this (no advatages to either side).

    So blah, for the most part.
  • No they don't (Score:5, Insightful)

    by The Bungi ( 221687 ) <thebungi@gmail.com> on Wednesday May 07, 2003 @04:49PM (#5905511) Homepage
    First of all, comparing .NET and Java isn't very fair; you have to compare .NET and J2EE. When you level the playing field, most of his arguments readily fall apart."

    .NET is not a specification for a distributed application server, J2EE is [sun.com]. The advantages or disadvantages quoted in the article in regards to .NET exist whether you're building a simple console application, a desktop forms-based client, a simple web app or a massively distributed, multi-tier one.

    I don't necessarily agree with the article itself in some points, but I can't see how the comparison is "unfair" because it's not being made to J2EE but the Java 'platform' (Sun's words, not mine) itself. C# vs. Java would be a completely different thing, but that would be based on the features of the language and the runtime library. J2EE is just an extension of that.

  • For more info, check this Register article:
    http://www.theregister.co.uk/content/4/2 7833.html

    Its got some good benchmarks of real-world, optimized J2EE vs. .NET implementations of a Pet Store web store.

    Very informative (though obviously, benchmarks should be taken with a grain of salt).
  • by fm6 ( 162816 ) on Wednesday May 07, 2003 @05:00PM (#5905600) Homepage Journal
    The meaningful comparisons I've seen come out in .NET's favor. The .NET VM is rather more robust. The libraries are more carefully thought out. (Can anyone consider AWT without nausea?) And C# is much more expressive than Java, without falling into the feature pit of C++.

    Still, I think .NET is going to be a disaster. Microsoft is trying to make it do too many things at once. To them, it's not just a new enterprise software platform. It's a fix for all the shortcomings of the NT API. It introduces all the new programming features they never tire of dreaming up. And it does all this while retaining support for legacy languages, such as C++. AND .NET is supposed to maintain an easy migration path for Java programmers -- one that will make it impossible for them not to switch.

    It just won't fly. They're trying to do too much, and they're making the same mistakes they made with NT and Win16. And even if they went at it right, .NET could never hope to make more than modest inroads into the Java marketplace. Too much investment in an established technology. (Microsoft ought to know better, given the way they've benefited from that same principle.) The best they can really hope for is to find a niche where .NET excels, such as Web Services. This would parallel the career of other technologies (Cobol, PL/1, SQL, and of course Java itself) that were supposed to take over the world, and ended up just finding their own place in it.

    • "feature pit of C++"

      That's no pit. That's fauna and flora. As a multiparadigmed language, you are not expected to need or want every "feature".

      But has the OOP purity of the 80's, in the spirit of which both these technologies are designed, really proven itself... ever?

      personally, I believe in pragmatic OOP... i.e., the kind in C++.

      "To many options are bad" == "please think for me, choice hurts my brain".

      End of Reflexive C++-defense.

      (where is the C++ Troll when you need her?)
    • I think you need to back youself up a bit more...

      Why is the VM more robust?
      Why is it more expressive? If you're going to refer to variable/properties access that's bs. What happens when you want to synchronize access to the variable hmmm?
    • Can anyone consider AWT without nausea?

      That's like saying "can anyone consider Xlib programming without nausea" and then implying that therefore all X Window programming is a nightmare. AWT hasn't been the preferred GUI API since the days of JDK 1.1. Look up a book on Swing some time, and discover how easy GUI programming can be.

      Chris

      • Well, OK, the AWT thing was a cheap shot. Still, you have to admit that Sun cut a lot of corners in early versions of the JDK, and that this still haunts Java developent Even serious Java programmers have many issues with the libraries.

        But that's all beside the point. Which is that Java is too well-entrenched to be displaced by .NET. The same Java programmers who complain about its shortcomings are very reluctant to switch over. Not the mention management, which will not easily abandon its huge investment

        • Well, OK, the AWT thing was a cheap shot. Still, you have to admit that Sun cut a lot of corners in early versions of the JDK

          Very true, some of the original classes were a bit inconsistent in their naming of accessors and AWT was fundamentally flawed thanks to the way it propagates events. The "standard" SDK could do with slimming down, as noted by a recent internal report from Sun, so it would be nice if 1.5 did away with the redundant, deprecated or downright useless stuff ... while still adding enums

  • by GCP ( 122438 ) on Wednesday May 07, 2003 @05:15PM (#5905741)
    I've used Java longer than the reviewer -- since it was an alpha. I still use it and am an official participant in the JCP. I plan to continue using Java, probably for years to come.

    That being said, I find the C# language to be significantly better designed than the Java language. Things like delegates are a great improvement over interfaces. When Anders Hejlsberg was still at Borland, he tried to persuade Sun to use them in Java instead of the interface approach and they just blew him off. "Syntactic sugar" they called it, and then they went ahead and implemented their own syntactic vinegar. I'll take the sugar, thank you.

    Using "properties" in an OO language is a natural.

    a.b.c++ calls a set() method instead of directly accessing a member var named c. (The c property may not even be backed by a variable. It may be calculated on demand.) In Java, to use OO methods instead of exposing private variables, you would do something like

    a.getB().setC(a.getB().getC()+1);

    although usually it would be broken into several simpler steps with temp variables for ease of reading.

    C# makes it a breeze to create visual interfaces to object properties without losing the encapsulation of the implementation of those properties.

    There are so many other improvements in C# relative to Java that it really annoys me to hear the political refrain "C# is just a knock off of Java". It's such a superior "knockoff" that, for the first time in years, Sun has gotten back in the mode of making language improvements (all of which make it more like the "knockoff") instead of their knee-jerk "you're not language designers so, trust us, you don't need that" reaction of the past.

    The Java class libraries are far more complete than those of .Net, though .Net's have the benefit of learning from Java's mistakes. (A nice, consistent way of converting between fundamental data types, well-designed containers, etc.)

    I now find myself in the position of using C# when I can (mostly for personal utilities) and Java when I must (for professional production). Since I strongly prefer to use Linux servers and strongly prefer to avoid the MS license ball-and-chain, I anticipate having to continue using Java for years.

    While doing so, though, I will continue rooting for Mono [go-mono.org] and working thru the JCP to try to steer the Java language to embrace and extend what I consider the significant advantages C# (and to some extent the .Net classes) have over Java. All the anti-MS bigots don't make that easy, though.

    • by Alomex ( 148003 ) on Wednesday May 07, 2003 @06:22PM (#5906260) Homepage
      Not long after the Cobol disaster (too many syntactic niceties), the programming language community swung the other way and since the 1970s has opposed most niceties in a language as "syntactic sugar". Sure enough, the C code:

      x = y + z;

      is nothing but the syntactic sugared version of

      LDA Y
      ADD Z
      MV X

      SO?? Isn't the C version far superior nonetheless?
      • by GCP ( 122438 ) on Wednesday May 07, 2003 @07:56PM (#5906823)
        I understand the aversion the Java designers felt for "syntactic sugar". They equated it with the spiral of Perl into syntactic chaos.

        I understand it, but don't accept it. I think that the best programming language is the one that makes you tell the computer the fewest number of things to get it to do exactly what you want it to do.

        I think the Java designers were way too conservative about syntax and way too conservative about incorporating popular, proven features from other languages. They should have had smarter enums than C++, not no enums. Smarter function pointers than C++ (delegates, for example) instead of no way to pass a single function as an argument, etc.

        And more syntactic sugar of the sort you see in Python and Ruby.

        Java is a very solid, valuable production platform as it is, but I think Java would be a better *language* if it were a little more like Python and less like a simplified C++.

        Of course, I could say the same about C#, which obviously didn't want to venture too far from the familiar features of Java, C++, and VB. My understanding, though, is that the designers of the underlying .Net runtime made a lot more effort to include features in the bytecode system that will enable languages to use generics, multiple dispatch, multiple inheritance, tail calls, and others, which could support more interesting languages (or new C# features) in the future than may be practical with the JVM. (I'm not an expert on that last point, so consider it a *rumor*).

      • Re:Syntactic sugar (Score:5, Interesting)

        by fm6 ( 162816 ) on Wednesday May 07, 2003 @09:04PM (#5907220) Homepage Journal
        I think you're really distorting the SS debate and the role of Cobol and C in that debate.

        The big mistake with Cobol is not that its syntax is too complex. Most early languages had that problem. But in Cobol's case, they made the silly assumption that a language with a superficial resemblance to ordinary English is somehow easier to learn. Thus in Cobol you can write:

        DIVIDE TOTAL BY NUMBER GIVING PRO-RATA REMAINDER RESIDUE.
        The problem is that Cobol is not a subset of English, it just looks like one. Cobol uses ordinary human constructs, but doesn't save the human from having to learn any abstractions.

        Detractors of C are fond of calling it "high level assembly language". I think that mostly comes from the use in C of pointers, which seem much too similar to machine language memory pointers. Now it's true that C pointers are not as sophisticated or foolproof as object references (Java and most other OOP languages), but they're still more than memory values. Consider,

        BIGDUDEDATASTRUCTURE d[DSIZE];
        for (i := 0; i < DSIZE; i++) chompchompchomp(d[i]);
        If you translate that to assembly, you'll see a difference that's a lot more than syntactic sugar.

        The basic issue between C++ and Java is not SS, but general complexity. So Java leaves out default parameters, operator overloads, and multiple inheritance, some other stuff.

        • Re:Syntactic sugar (Score:3, Interesting)

          by Alomex ( 148003 )
          Huh? I'm not saying that the only difference between C and assembly is syntactic sugar. Far from it.

          What I was pointing out that is that judicious amounts of syntactic sugar are extremely convenient to programmers, and hence simply being SS is not enough to dismiss a language feature. Yet this is routinely done in the programming language community, as illustrated by the real life example in the first message (not mine) of this thread.

          • Re:Syntactic sugar (Score:3, Interesting)

            by fm6 ( 162816 )
            The original message didn't characterize anything as syntactic sugar. It only said that C#-style delegates never got into Java because JavaSoft thought they were "syntactic sugar". And it sounds like this version of history comes from Anders Hejlsberg, the inventor of delegates. Given the long standing feud betwee Hejlsberg and JavaSoft both when he was at Borland and later at Microsoft, I doubt if the argument was as simple as that.

            • I've been around long enough in the programming language community, and have heard the "syntactic sugar" red-herring so often that I'm inclined to believe Hejlsberg's side of things in this case.
              • Actually, it turns out you're completely right. Did some browsing and found a bunch of JavaSoft documents where they attack delegates as "syntactic sugar". But as you yourself point out, this is just a red herring. There's more to delegates than syntax! So this isn't an argument about syntactic sugar. Sun's spin artists are just trying to cast it as one.
      • float x = 3.14159;
        float y = 1.0/2.0 * x;

        Value of y = 1.570795

      • Sheesh, lets at least use a "real" computer:

        save %sp, -0x70, %sp
        mov 0x1, %o1
        st %o1, [%fp - 0xc]
        mov 0x2, %o0
        st %o0, [%fp - 0x10]
        add %o1, %o0, %o0
        st %o0, [%fp - 0x8]
        st %o0, [%fp - 0x4]
        or %o0, %g0, %i0
        ret
        restore
    • I'm interested to read your comments GCP as I'm a longtime Java programmer as well. When I read the C# spec I found that the vast majority of the language additions over Java were the classic Microsoft shortcuts that cloud a language and reduce clarity. This is of course with the one great exception of delegates, which I am totally in favour of.

      It seems there is a danger as we get more experienced with programming to want to get fancy with our syntax and so on, but I think Java neatly constrains this des
      • I don't agree, but as you said, language features are a matter of personal preference.

        You agree with delegates for wrapping a single method with a name of your choice instead of implementing a full set of method stubs the Java way.

        For properties, I find a.b.c = foo to be much cleaner and easier to read than the Java way of
        a.getB().setC(foo). I wouldn't call that "getting fancy with syntax".

        The Java way of handling enums (static member vars) was really clunky. C# just has clean, simple enums. After years
        • Don't use enumerators, use Iterators. (This goes along with using the Collections framework instead of those hacks Vector, and Hashtable)

          for (Iterator i=collection.iterator(); i.hasNext();) {
          ObjectType o = (ObjectType)i.next(); ...
          }

          This has te added benefit of being much more flexible, such as using more than one next() call per iteration, or backing up in the iteration (iterators have reverse iteration too).
    • It is absolutely true that C# has advantages over Java. It's the classic "learning from the other guy's mistakes." It's also classic MS strategy. But C# has a large number of disadvantages over Java.

      I have been a Java programmer since 98. Last year I took a job at an MS shop, working in C# (damn Silicon Valley economy!) I loved C# at first. One of my favorite things was the aforementioned delegates. But instead of them being another tool for programmers to use, C# often forces you to use them when there
  • by WasterDave ( 20047 ) <<moc.pekdez> <ta> <pevad>> on Wednesday May 07, 2003 @06:25PM (#5906285)
    Fabulous.

    "In contrast, XML permeates every corner of .Net."

    Last year all configuration was being held in Active Directory. The year before that all configuration was being held in the registry (I can't remember the name of the IIS specific registry thing to rant about it). The year before that we were all supposed to be using .ini files and on each occasion the Microsoft developer wankfest assured us that "THIS IS IT!!!".

    What is wrong with the world? It's almost like there's a constant torrent of naive Microsoft fanboys dropping into the workforce under the impression they're software engineers.

    Dave
    • The IIS "registry-like-thing-that-is-not-the-registry" is the IIS Metabase. Most people who know about it do so because it has become corrupt on them. COM+ has a similar "registry-like-thing-that-is-not-the-registry" called the COM+ catalog.
      • Yeah, that was it. I never had it corrupt on me, but I did have to write a com component that used it for something once. It struck me as actually being far more sensible than the registry - supporting inheritance, for instance, and being a damn slight faster.

        I managed to avoid the com+ thing entirely, and similarly fancy my chances of avoiding .net. If I have to code for windows these days I try to avoid going further than the API - down to the metal baby, yeah!

        Dave
      • I've been working with IIS now for about 6 years and I've never seen the Metabase become corrupted. I imagine it could happen if your machine crashed while updating the metabase, but how common is that?

        No, the main reason people are familiar with the Metabase is that's where the IIS configuration settings are located and it's far easier to write a script to modify them in the metabase than to use the UI. Especially when you're doing this to hundreds of web servers.
    • Last year all configuration was being held in Active Directory. The year before that all configuration was being held in the registry (I can't remember the name of the IIS specific registry thing to rant about it). The year before that we were all supposed to be using .ini files and on each occasion the Microsoft developer wankfest assured us that "THIS IS IT!!!".

      I bet the Next Great MS OS will use INI files again, but simply call it something completely different, like "angle-bracket-free XML" or somet
      • Actually the previous one already did, quote:

        Windows 2000 also introduces a significant change in the overall role of the registry. It's no longer the preferred place to store an application's configuration data. Storing large chunks of data in the registry can take up a lot of room, especially on shared computers. Applications now must use special system folders to save user settings, application data, and temporary files.

        from MS article from 1999 here [microsoft.com].

        Not that MS giving up on it seems to have stopped

    • I refer to them as WizardBoys.
  • by Joe the Lesser ( 533425 ) on Wednesday May 07, 2003 @07:52PM (#5906795) Homepage Journal
    It's owned/created by Microsoft.
    It's new and costs money/time/pain to switch, for hard to see benefits.

    (Justified in my opinion.)
    • It's owned/created by Microsoft.

      Exactly. Once mono [go-mono.org] is more complete and I'm convinced MS won't try to kill it, then I'll take a look at .Net.
  • Hi,

    Even Sun admits that Java has a problem using to many resources for small tasks.
    I don't know if that is better than .NET ;)

    The Java Problem
    Author: Julian S. Taylor
    Reviewed by: Steve Talley, Mark Carlson, Henry Knapp, Willy (Waikwan) Hui, Eugene Krivopaltsev, Peter Madany, Michael Boucher

    Executive Summary

    While the Java language provides many advantages over C and C++, its implementation on Solaris presents barriers to the delivery of reliable applications. These barriers prevent general accept
  • by Anonymous Coward
    There are workarounds, of course. You can do as I did and write a custom Java classloader that isolates a third-party product from the libraries loaded by the parent Web application. That, however, is a non-standard solution, and a standard solution included as part of the base runtime would be a vast improvement. .Net offers such a solution in its ability to run multiple versions of an assembly simultaneously within the same AppDomain.

    One statement in the article stands out as inaccurate or misleading. Y

  • It's already ported to a slew of platforms so you're never locked into one operating system (Windows). It's proven, and reliable, and has a huge backing already. Anything that can be done in .NET can already be done in Java (Web Services, Programs, Applets).
  • C#.NET vs Java (Score:2, Interesting)

    by Tim12s ( 209786 )
    C#.NET advantages come
    1) from taking everything good in java
    2) adding cleaner COM+ integration and windows integration.

    Thats it.

    Now Java 1.5 will fix alot of issues i have with java and it removes one of the reasons (1) for moving to C#.NET.
    (2) is going to be difficult for java to level. Having said that, (2) is the reason why .NET will last forever in general application development. App development with ATL, Win32, x,y,z is a nightmare in some respects. .Net will do for windows what Java has done for

The one day you'd sell your soul for something, souls are a glut.

Working...