Hacker News new | past | comments | ask | show | jobs | submit login
C# is now a better language than Java (clapper.org)
152 points by fogus on July 31, 2009 | hide | past | favorite | 133 comments



I guess I'll be the lone dissenting opinion and actually favor Java over C#.

Java has an extensive library of open source software, which makes it, as they say, more of a platform then a language. From hadoop, to tomcat, to jetty, to hibernate, to spring, to c3p0 (and many, many, many more), you have all the tools you'll ever need to do 95% of the coding work.

I definitely get the love around here for dynamically typed languages, but I've never been sufficiently motivated to switch to ruby. The whole philosophy of ruby, "convention over configuration" is applicable to ANY language, including Java. Java's EJB spec was monstrous and XML config file infested, but I've gone through many projects in Java without a single XML config file and following the philosophy of convention over configuration, and it's been great.

As to .NET, I would never use it. Never want to get in the business of paying for licenses, not just .NET, but it ties you to Windows server boxes and Windows development boxes.


The article made a point of distinguishing the comparison between Java and C# as languages, not between Java and .NET as platforms.


Be that as it may, that seems like an awfully artificial cop-out.

"Oracle's the best database ever!"

"It costs half a million dollars!"

"I made a specific point of distinguishing its technological merits as a relational database backend, not the dollars involved in purchasing it."


There's a lot of contexts where cost/benefit is not so much a cop-out as it is a more relevant point! (Not an Oracle advocate by any means!)


I agree. I meant that it is not an effective reply to its parent.


As regards your last sentence, MS licensing does definitely limit your ability to scale out (over multiple servers, see http://www.codinghorror.com/blog/archives/001279.html). Mono might just save MS from losing the server mindshare entirely if it can talk itself into letting go of the license more than even the community "promise."

I have been pleasantly surprised to find C#/.NET is quite good. Please do force MS' hand by supporting the alternatives. The more good alternatives there are to .NET including improvements to Java, Scala or what have you, the more likely MS will do the smart long-term thing and loosen its licensing restrictions.

(please do say why you might disagree - I'm genuinely curious)


They have completely misunderstood what Markus is trying to do there. He wants a big box so he can do big joins because what he cares about is being able to match people across arbitrary criteria not, at sharding fanboys would do, separating them into separate pools by surname or a hashing function and then you never meet your perfect match because her records are in a different shard to yours... A modern romcom could be written about that.


Not sure why you brought it up, but convention-over-configuration is characteristic of Rails, not Ruby.


I'd say the ideas were there before RoR. E.g. setup.rb (just to name a simple example) works with zero configuration but you have to put your files into the right directories.


It's fashionable to say that Java is painful to use, and there is truth to the statement. However, when I started with it I had come off of a few years of C++ and loved that it reduced my pain exponentially. Like the new lover's quirky laugh, the 'nuances' of Java became annoying. It almost seemed as if with Java there is a threshold of productivity that the language itself imposes. I have since moved on to Scala/Clojure and again feel renewed. Maybe that is the natural progression of programming languages?


I see C# as a linear improvement on Java. In my eyes, it looks like this:

C++ --> Java --> C#


Out of curiousity icey, where would these languages fall on your chart: ruby on rails? scala? python? I'm attempting to "download" web programming languages in an exceptionally short time but I'd prefer focusing on high end producers. I can see advantages and pains to various syntax and functionality, and have been fairly liberal in my choices so far to focus on existing libraries.


For me, they're different 'flavours' of programming and fit on a different chart. The C++/Java/C# line is for static programming with heavy reliance on a compiler -- the idea is that the compiler helps you find lots of errors. In all three languages, getting the program to compile rules out whole rafts of problems.

Python and Ruby move that responsibility onto tests -- you run the code to find errors.

I think C++/Java/C# fit onto a line, each taking away accidental complexity and adding higher level features. C# iterators and lambdas are a good example the OP mentions, of a high-level feature that makes possible styles not available in Java and C++. (we use C# iterators and lambdas to write in a more functional style than we could in Java)


My "daily drivers" are C# and Python. I'm picking up Clojure right now, but haven't really done much with it - I really like lisps in general, but for some reason always fall back to either C# or Python when I need to write something I'm going to maintain.

If I were in your shoes, I would start with Python and Django. It's a good framework on a good language, and most importantly, Django has a very good community and almost peerless documentation that's available for free online.

Ruby on Rails is also quite nice, I'm just not a big Ruby fan. There is no reason for this other than personal preference. Scala seems very interesting, but I personally don't see a gain in learning it (since I have C# in my toolbox). Your mileage may vary.

For whatever it's worth, everyone I've dealt with seems to have had a pretty painless transition from C++ to C#. I am not a Java person, so I can't really speak to that.


data types < data structures < design patterns


C++ has got nothing to do with neither Java nor C#.


The C# ECMA Standard ( http://www.ecma-international.org/publications/files/ECMA-ST... ) mentions it several times that one of the main design goals of the C# language was familiarity to C++ programmers. Indeed C# borrowed a considerable portion of its syntax and keywords from C and C++. I suppose the same is true for Java as well.


The C# standards only mentions C/C++ and not Java?!

>>Indeed C# borrowed a considerable portion of its syntax and keywords from C and C++. I suppose the same is true for Java as well.

It seems really weird to me when you sound like C# was an independent development? I'm not an expert on either, but...

Didn't Microsoft even try some (/a few?) Java-clone before C#? And then we have that "embrace and extend Java" thing Microsoft tried first.

Is the ... hrm, inspiration... from Java in C# "the love that dare not speak its name"? :-)


> Didn't Microsoft even try some (/a few?) Java-clone before C#?

J#[1]? J++[2]?

[1] http://en.wikipedia.org/wiki/J_Sharp

[2] http://en.wikipedia.org/wiki/Visual_J%2B%2B


Thanks! Next time I'll just check this document linked from the J++ 'pedia page myself before asking.

http://www.ecis.eu/documents/Finalversion_Consumerchoicepape...

Page 16: Kill cross-platform Java by grow[ing] the polluted Java market. (Microsoft internal document.)

Etc etc, with references.

This document could be posted as a story on HN, if anyone wants lots of karma. :-)

We can say one thing for certain -- the "love" here is criminal and violent...


ha, I think so berntb.


Java certainly evolved the OO parts of C++.

C++ being a multi-paradigm language it does however have more than the OO stuff, and that “more” wasn’t inherited by Java.

This “more” is things like operator overloading, templates, compile-time types (allowing implicit type construction and user type conversion operators), well-defined rules for automatic storage, etc.

I rely heavily on these things and so does the IMHO elegant standard template library. I rarely use the OO features of C++ (if we define OO as inheritance and polymorphism, I do of course use data abstraction).

I assume the parent is doing something similar, which is what makes him say that Java/C# has nothing to do with C++, as there was a crossroad a decade ago where a lot of C++ users moved away from object oriented programming and instead embraced generic programming.


I don't think you know your history very well:

http://en.wikipedia.org/wiki/Java_%28software_platform%29#Hi...


Being based on something doesn't mean it's like similar. Is C++ like Simula?

My statement was probably poorly phrased, but what I meant is that a modern C++ program is nothing like a modern Java program. The approach are radically different. I'm thinking about what the heavy usage of templates in C++ allows, what you can accomplish in terms of generic programming.

You can write in C++ like you would do in Java/C# but that would be pointless IMHO (complex hierarchy, virtual methods, etc. : exactly what I try to avoid).

It's like saying lizards an birds are similar because they share a common ancestor (dinosaurs).


The majority of Java/C# syntax was derived from C++. So I wouldn't say "nothing".


At least the OO parts. Of course the syntax was originally C.


The SLW in me thinks: "Don't choose a language for its features, choose a language for its feature building capabilities".

It reminds me of people who buy stackable shelves and drawers to store their crap and make some room. Sometime later, they buy vacuum-sealable bags to store things that they bought after they made some space. As time passes, they start digging for a new basement and add another floor as an attic to store more things.

Java vs C# programming sounds a lot like two hoarders of the kind described above, except one has enough room behind his La-Z Boy to recline to 120 degrees, while the other only gets to 100.


Indeed. Java and C# are some of the least flexible programming languages around. The problem, though, is that people like being told what to do. They don't want to wonder if they are implementing something correctly, they want to know that they are "following best practice". They don't want to invent their own features, they want to read a cool blog post about something "the experts" came up with and then try using that in their application.

This produces horrible code, of course, but since it sort of works and nobody knows any better, it's the norm. (Most programmers don't know programming. Why they want to be a programmer is beyond me, but it happens.)

The people that have a deep understanding of programming and know what they want to do and how to do it are not using Java or C#.


C#'s got lambdas, closures, generics, reflection, extension methods (weak form of monkey-patching), and anonymous types (I can't speak to Java, but it's got a lot of these as well). Can you please describe the flexible features C# is missing?

As for the programmers in those languages, I guess I'm one counterexample. My colleauges and I talk quite a bit about the "right way" to do things. We gripe a great deal about shortcomings in the .NET universe. I hate "best practices" (aside from trivialities like naming conventions), and prefer to evaluate practices on their merits. I've written frameworks of various sizes. I read cool blog posts to see what others are doing. Occasionally I'll try things to see if they'll work, not because some "expert" thought of it.

So, I'm at least one counter-example, and I know of numerous intelligent and erudite friends and bloggers who also fit this description. I wonder if you can perhaps provide some examples to support your claim that Java and C# programmers have no depth of understanding?


> They don't want to invent their own features

Maybe they don't want their coworkers to go nuts inventing new features and then be the ones that need to maintain them.


where's the purist that lives outside on a hammock?


You mean the guy who made this web site?


Java is painful after experiencing .NET. I'm not sure this is really news though.


I wouldn't describe it as painful myself. But, I would agree with sentiment. Having spent 3+yrs working with Java and then moving to C# (2yrs+ dev) has been a pleasant experience. C# is great language with features like delegates, Indexers, Pointers and Unsafe Code (executed in an unsafe context) and constraints on type parameters.

In contrast, I hate the msdn documentation for C# and still have a soft spot for java documentation.And yes, C# v Java is not the same as JVM v CLR


I hate the msdn documentation for C#

Not sure if this is addresses your complaint, but MSDN's low-bandwidth formatted site makes it easier to work with.

Example: http://msdn.microsoft.com/en-us/library/system.xml.xmlreader...

Here's a link to a bookmarklet you can use to turn loband on: http://weblogs.asp.net/jgalloway/archive/2008/08/30/msdn-low...


I think another thing I really hate about C# documentation is that it's merged with docs for other languages like VB.NET. It's a small thing but when I need to do something, I really don't want to be wasting time constantly filtering through stuff I don't need.


There is a language filter in order to display only language we want to see (in the standard version, not the low bandwidth one).


Thanks Rexxar - you've made my life easier. For some reason I've never noticed it before. Maybe it's because I use Firefox and the filter button looks really small on it.


In hindsight, hate was a bit strong. thanks for the bookmarklet. I too prefer the low-band version of the msdn. But I prefer java docs layout. It's a lot easier to use and navigate. With namespaces at the top, classes just below and method/class details as the main view. I think it's very elegant.


Delegates do it for me (even though VB.NET doesn't have delegate subs), especially their use with IEnumerable.


I should point out the obvious that C# was designed after Java was in the wild for some time; thus, Microsoft got to learn from the mistakes Java made when designing the language.


I disagree. Anders Hejlsberg was already an experienced language designer with the highly commercially successful Turbo Pascal and Delphi under his belt before he came to Microsoft and developed C#. James Gosling only had worked on Oak before Java, a language which never made it past the stage of an internal research project at Sun. It's disingenuous to say MS "copied" anyone in this case - they simply went out and found an experienced languages guru and hired him. Just like when they needed someone who knew about operating systems, they hired Dave Cutler from DEC.


Oak == Java 1.0. The first Java runtime beta that I installed on a Solaris box in 96 or so was called Oak.


I've been using Java on and off since around then (first paying gig in '96) and even at 0.9 it was called Java.


Java has made many design mistakes since C# was released. I keep thinking one day the Java folks are going to come out and say, "AHAHA, WE TROLLED YOU ALL BIG TIME", but sadly I doubt that is going to happen.


Some examples? I haven't used Java for a while now, so I'm asking in earnest.


Exactly. This is not news. C# has always been a step ahead of Java. They're both enterprise languages, good for large teams. But C# has always offered comparable features to Java as well as more higher level features. Add to this, albeit a subjective opinion, that VS is a superior IDE to Eclipse.


At my company about a year ago, we held a Java vs .NET seminar. The attendees were probably 10% .NET, 80% Java and 10% interested onlookers (like me). The main .NET guy stood up to speak. He said he'd done this project recently in Java and that project in C# and these were his experiences. He talked about the maturity of the tools, particularly VS vs Eclipse support for programming in the large, LINQ, he mentioned that in the Java world there were many competing frameworks whereas a C# developer could get up to speed on a project without having to learn a new one, a whole bunch of stuff. He was calm, articulate, prepared, and clearly had the attitude of "the right tool for the job" and "what's best for the company".

Then it was Java's turn. Their speaker hadn't prepared any examples, and he'd never used .NET. I scented blood in the water. This was going to be fun. It went something like this:

Him: Java is cross platform! Me: So what? We only use one platform for all Java, the Ops guys insist on it. Him: Java is used by lots of large companies including X, Y and Z Me: All of whom write their major products in C and C++ Him: You can use lots of languages on the JVM! Me: So the best thing about Java is that you don't have to use it? Is that all you got?

Then he prepared his killer blow:

Him: Java is not Microsoft! Me: Haha, OK you got me there. No wait, there's Mono...

IMHO right now Java should be considered a legacy language, and Java programmers either assigned to maintenance or those who are good, retrained (not necessarily in C#, there's Scala for example). The JVMs are generally good and if you need a VM language on Unix then worth considering (tho' there are other VMs out there). Personally, I would advise against starting a new project in Java.


IMHO right now Java should be considered a legacy language, and Java programmers either assigned to maintenance or those who are good, retrained

Why? If they are producing value where they are in a legacy language, why retrain them? If they are really good programmers, they will retrain themselves out of curiosity.

Good old computer languages are like comic book characters. They keep getting declared dead, but someone keeps bringing them back!

Now, whether Java is a good language is debatable. More relevant to the company is if it's a good project. If it is a good project producing quality output and value, leave it alone! There's no sense in changing languages just because it's a "new" technology. (In quotes because a lot of that stuff was developed in the 60's, and 70's by Bell, Xerox, and IBM R&D anyhow.)


There's no need to chuck away the old code if you stay on the JVM, remember. You can develop the new functionality in Scala, Groovy, Jython, Clojure, whatever you want. It's not about rewriting existing code, it's about getting a competitive advantage when writing new code.


Ouch.


When you move to Mono, many of the auxiliary arguments for C# fall apart. (no VS.NET on Linux, "enterprise support," yadda yadda)


Nothing new here. I've been working with both for years and I agree.

There is one thing that Java still has though, that I somehow doubt C# will have due to culture. Java has way more free or open source libraries. Yes, C# open source has gotten a little better over the years, but it's still not even close (it doesn't help that historically MS has been antagonistic towards open source even within its own products). What does this mean? With C# I have to keep re-inventing a ton of wheels, as opposed to Java where there are already thousands of existing well made ones for me to just grab and use.


I was a c# dev a year ago and whenever I looked for open source packages to address some requirement, I would always end up at codeproject. It always tended to be poor quality, never updated, etc.. Java has so much more but maybe things have changed over the last year.


I doubt the culture will change unless MS shifts its attitude towards open source even more (which is really doubtful). Until then, most people will only release quality stuff on a paid restricted commercial license.


So if the JVM beats CLR but C# beats Java, why isn't there a C# compiler for the JVM?

I suspect that all language features of C# should be expressible in Java bytecode, but I have not thought about the details yet. If you know of anything in C# that would be unimplementable in terms of Java bytecode it would be interesting to hear about that.


Java bytecode is Turing-complete, so there's nothing explicitly preventing you from implementing many of the advanced features of C# atop the JVM. As the OP stated, alternate languages running on the JVM (such as Scala) already do this.

The problem is simply that most Java shops use only the officially-blessed Java language. Because Sun has always forced "certified" implementations of the language and platform to conform to their standard, there has been little room for innovation in the source syntax and bytecode format since the release of the first JDK in 1996. In the meantime, programming languages (and the programmers who use them) have moved forward, and Java has failed to keep up.


My guess is that C# supports stuff that has no direct and fast implementation on the JVM. IIRC C# has unsigned primitive types, stack allocated objects etc. which JVM doesn't have.


These days I tend to think of Java as the new assembler; I need to read/understand it, occasionally write it, but I do most of my work in clojure and python, (or scala, whatever your preference)


That's the problem with the article. Author concluded that JVM is better than CLR without giving any details. As I wrote in my other comment, .NET platform implements various features in CLR and in the language (in this case C#), to make C# a superior language. I challenge anyone to come up with examples which shows that JVM is better than CLR.


I know it's doable in the other direction (http://www.ikvm.net/).

My assumption is that there's no real incentive to create such a beast though. Most people who like C# don't care enough about the JVM to want to deal with that kind of effort.


Yes C# is an improvement over Java. But, that isnt saying much with the plethora of cutting edge languages available today.

I still prefer Java, because C# is limited to the Windows environment,Mono isn't much help yet, and that is a huge limitation for me. Especially because Windows is not conducive to any serious systems programming - its ugly.

Another reason in favour of Java is the better open-source eco-system, more libraries and much more mature stuff.

C# has had the benefit that all new products/techs have - it leapfrogged.


Excellent writeup, and he nails the fact that C# vs. Java is not the same as CLR vs. JVM.


Interesting. I don't think it's right to discount the CLR and focus on the language whereas the fact is that C# can not do certain things without support from CLR. [In fact, for each C# feature, I like to know whether it's a compiler trick or CLR feature.]

The biggest example I can think of is 'generics'. Java 'generics' are implemented using the compiler and JVM has no clue about them whereas CLR actually understands them and you get full reflection support for generic classes. Read this detailed article on Generics in Java vs C#:

http://www.jprl.com/Blog/archive/development/2007/Aug-31.htm...

I also like the utility of AppDomains supported by CLR.

Overall, I love .NET platform precisely because how all the modules (CLR, languages) are integrated with each other to give you a powerful tool set.

Other than JVM being portable, I don't know of a single case where JVM is superior to CLR. [Performance wise there is not a measurable difference between the two.]


JVM apps (at least if they are running in a container) aren't just portable across OS' (which is what I assume you meant), they are just plain portable.

In other words, I can tar up a Java appserver, copy it to another machine, untar it, and run it. No GAC, no registry, no caspol, no mysterious .dlls. It's all right there. Usually ;)


There is no reason why you can't implement a C# compiler which uses the same compiler "tricks" as Java. In fact, someone has: http://www2.mainsoft.com/content/port-net-apps-java-ee (I've never used that software and can't say if it really works as promised, but I don't see why not)

Which side of the fence the compiler/runtime fence any given feature fails on is probably more a function of (human) resource pooling on the Microsoft managed languages teams than any technical constraints.


That's COMPLETELY incorrect. I have been following blogs of CLR team and C# compiler team members and they think very hard about whether a feature needs to be a compiler feature or in the runtime itself. If they are short on manpower, they don't implement a feature rather than implementing it at the wrong level.


Since you probably haven't been following my comments here on HN: I work at Microsoft on a very C#-centric team. I have good friends on, and direct working relationships with, the managed languages teams here at Microsoft.

The "wrong level" corresponds to the goals and direction of the greater managed languages team. If the C# team wanted to implement every feature without any regard for the Visual Basic or F# team, they could. Clearly, they aren't going to do this because it creates wasted effort, inconsistency between languages, and maintainence complexity. Moreover, implementing on the wrong level has impact on performance and the developer experience.

I didn't mean to imply that they do the wrong thing because they are short on man power. On the contrary, they do the right thing because they are short on manpower.

Everything could be a compiler trick, but that doesn't mean everything should be. The managed languages teams here at Microsoft absolutely kick ass; they know what they are doing.


Indeed - but there is the language, the VM and the class library. He separates the VM - but lumps the class library and language together (or at least, doesn't explicitly distinguish this).


You know... C# may be less painful than Java, but, still, it took me 8 years to go through learning C++ after I had learned OOP with Smalltalk and done some programming with Actor (kind of Smalltalk with an ALGOL-ish flavor). I closed my first book on C++ seconds after I saw the overloaded binary shift operator being used to output text.

I see my early contact with Smalltalk made me picky and spoiled. Today, it makes not much difference if it's C#, Java or C++, they are all painful well beyond my pain tolerance.

It's like smashing one's toes with hammers of different sizes - I am pretty sure even a small hammer is painful enough.


What do you mean, now ?

annotations (though C# calls them "attributes")

he means "Java added attributes, which C# had from day 1, but called them "annotations""

C# has many of the same features as Java ... generics

Again, C# had this first, and still does it better since the bytecode is aware of them.


Java being more widely deployed has to worry about source and binary compatibilities between all the supported versions and thus for them, changing the bytecode would have been a painful decision.

As opposed to that C# did not have to worry about these things due to their limited deploy base and could freely change the language and/or the VM without worrying about backward compatibility.

That does not mean java is a better language than C# - its just that when Sun woke up and started adding features to the language, it was not easy.


Actually it does mean that C# is a better language now. If you are developing new applications then all the compromises that were made to shoe horn in new features don't matter to you. You just want something that works well and is simple. I think that C# has that on Java in a lot of respects.


No arguments there. But the rate at which C# is changing, what is stopping Microsoft from adding yet new features and breaking compatibility with previous language/VMs?


That's why there are generally several different versions of .Net installed side-by side.


That's why they have different releases of the .Net run-time.


I belive that was the original reasoning, and thus led to the Java generics behaving a little weirdly.

Then other decisions forced them to change the bytecode anyway, but they never fixed generics.


I'm not really disagreeing with you - C# is later, has the benefit of Java being in its hindsight.

I don't know how Java does it, but .Net installs framework versions side by side (typically under C:\WINDOWS\Microsoft.NET\Framework) so changes to, say V3.0 don't affect apps that run on framework 2.0 at all. Thus breaking backward compatibility for anyone (small or large installed base, doesn't matter) is not an issue when rolling out a new framework version.


He's just now realizing that Java is painful to use? Even PHP had me dreading the tiny bits of Java work I had to do when I last touched it in 2005.


Language wise C# was than Java from day 1, but the C# toolset and build model are why I prefer C# over Java.

I have never had to spend ages trying track down a "class not found" error in C#. Nor have I had to deal with version clashes between libraries. And I might be biased because I develop mainly on Windows, but I think Visual Studio is a better IDE than Netbeans, Eclipse, IntelliJ or JDeveloper.


Really Visual studio is better than Intellij/Eclipse?!?

I can tell that you havent done enough programming in the Java world. Have you ever tried any serious refactoring or bothered analyzing your code. I didnt think so, you would have realized why visual studio sucks..

BTW, I program in both C# and Java all the time. Actually, I do about 70% C# and 30% Java. So your claims are crap.


I would not call all his claims crap. I disagree with his libraries statement but agree that visual studios is better than netbeans or eclipse.

I have used c# in vs.net for years up until a year ago and am stuck using eclipse now. I miss vs.net, not so much c#.


Hmm...try Intellij Idea and I think you might get over VS. Eclipse is a bit clumsy but really powerful. VS is basically a text editor with intellisense.


> BTW, I program in both C# and Java all the time.

So do I, so you can drop the holier than thou attitude. In case you didn't know, refactoring plugins for VS do exist, and I use them. But you're just comparing one aspect of the IDE. I use VS Team Suite, so I have built-in Unit Testing, collaboration, modelling (data and code), and multi-language projects in one solution (ie. I can write a COM object in C++ and a C# client in the same solution).

IMO, considering your objection, you are the one who hasn't done serious development in any language. (See? It's easy to drop pointless statements like that)


try it with resharper. brings it up to java ide level.


My preference is definitely visual studio over netbeans/eclipse simply due to response time and the ease of installation.


Where are these people come from? Installing Eclipse is as easy as unpacking ZIP file. Unlike VisualStudio, whose installer is just slow and buggy piece of crap, which constantly breaks so hard, that you have to download a special tool to reinstall it.


visual studio express 2008 took me less than 5 minutes total to get up and running.

netbeans or eclipse took me far longer to start building web apps (GAE or scala/lift)

plus the IDE itself has a very long load time and terribly slow response time.


How is NetBeans difficult to install? I would understand being confused as to what package to download from eclipse.org, but NetBeans?!


Setting up a scala/lift environment correctly took a bit. Read up about the proper JDK, SDK and I still have probs building inside the IDE (I just gave up and use maven on the command line)


And exactly how easy would that be under VisualStudio (object of the original complaint about NetBeans being too difficult to set up)?


A good article, but I think the last line is the most revealing...

"compared to C# and Scala, it (Java) is almost painful to use..."

I think most of the Java community realizes incremental improvements to Java are at the point of severely diminishing returns, and Scala seems to be the next phase (I've heard people jokingly refer to Scala as Java 1.9... of course, this really isn't accurate, but it does capture what's going on in the Java world right now).

So in the future, I'm going to be a lot more interested in hearing how Ruby and especally Scala stack up vs C#...


It's sad, but this isn't really an interesting argument any more these days. Even as a staunch java supporter, I wouldn't try to argue Java is in and of itself as good as C#. I'm more interested in how the 2nd generation JVM languages (Scala, Groovy, etc) compare with C# or the other options on .NET, and on the pros and cons of the whole platform and ecosystem.

For my money, no matter how good C# is, I'm not willing to be tied to an environment where the only full, modern implementation is tied to a single platform.


A thing that I have wondered about: Although Java and C# are similar languages with very similar libraries and features, Java has migrated towards being used for server side and middleware programming. C# however has not gone in this direction even on Windows platforms. What is the reason? Wouldn't it be easy to write the equivalent of Tomcat, JBoss, EJB's etc. in pure C#?

It is surprising that some of the apache projects have .NET equivalents (lucene, log4j, ant) but some others dont........


Windows shops are vary of writing functionality, that might one day compete with Microsoft. Writing net Tomcat/JBoss could clash with IIS and future frameworks. Something like this happened with nant/msbuild and nunit/mstest. Commercial companies find it difficult to justify development of tools with high risk of being obsolete soon (something competing with MS product does not stand a chance in most Windows shops). Apache projects do not care about this risk.


C# is awesome because in a situation where you are using C#, there's a good chance you could use F# instead.


I've always preferred Java to several languages (could be JVM influenced). I would still rather hack up an idea using Java vs C# or many other languages.


What are the other languages that you prefer Java over?


One example is COBOL which was (and is still being) largely replaced by Java in the business application market and rightly so. Even if you don't like Java, you have to agree that it's a great replacement for COBOL.


Verbose... favored by mediocre programmers... loved by business types... you're right, Java is the new COBOL!


I think you're being harsh on COBOL. Clearly, it is a thriving language that's being kept up-to-date according to the latest trends. Check the out the COBOL Ruby on Rails equivalent, COBOL ON COGS if you don't believe me: http://www.coboloncogs.org/INDEX.HTM


I've never really understood why verbosity was that big a deal. I could very easily type the code that I write per month in a single day. A bit of extra time typing for a more verbose language has very little effect on my output. I don't know if that's an artifact of the type of code I write (quite algorithmic, so large periods of sitting and thinking followed by a bit of writing), but it's just never seemed much of an issue to me on a practical level.


I care more about the drag verbosity imposes on reading more than the difficulties it causes in writing.


You're right of course that typing speed is largely irrelevant... But there's quite a bit more to managing a large code base than how fast you can type. ;)


Typing does matter to me, but it's only one of the many reasons I favor expressiveness and terseness.


I'm in favor of expressiveness. I'm against terseness.

Why in heck are we all still programming in GD text? Why not program in some sort of hypertext? IDEs have become so automagical and serious text editors so often have features like code folding, we're a good deal of the way there anyhow! Why not have a suitable hypertext format paired with a language, such that it's straightforward to do things like toggle between viewing the code with and without type annotations? Then we could have languages/environments that feel like Ruby/Python but which have all of the type annotations if you want them. (And they are useful for maintenance programming.)


RPG III, Fortran, Cobol, assembler, VB, VBA, ASP.

And no, I am not kidding or making this up.


Pascal. Fortran. Cobol. GW-Basic. Powerbuilder. Befunge.


C#, Visual Basic, Ruby to name a few...


I guess I can understand the first two, but you'd take Java over Ruby? Really?


I agree about Ruby not belonging on that list. If anything my learning of Ruby (and then Rails) soured any remaining interest I had in Java development.

I'd really be interested to know why ramoq thinks Ruby is less suitable than Java.

I'll tell you one thing that absolutely stinks about Java: no collection literals. For all the time one spends in Java (and most other languages) dealing with arrays, lists, and maps, I always have to instantiate an object and manually add the elements to the collection. Heaven forbid you decide to nest one collection in another.


The real question should be, "Why?" Why do you prefer Java over these.


I could tell the tipping point when I did a recent search for jobs. Even NYC which is still heavily Java is shifting to C#/WPF for client front ends.


And on the backend?


C\C++\Java backends mostly.


The problem with language features is that people will actually use them. Much better for maintenance to have consistent code. Except for inner-classes, you always know what to expect when opening a Java file. Java's not as elegant as Eiffel or some of the functional languages, but its simplicity has value.

(No, I program mostly in C#)


I am not sure if I feel it is better, but I do like them both quite a bit.

Sometimes I just feel like C# is just a little bit more pliable in a lot of ways compared to Java, just a little easier to make it do what you want it to do.


Windows usually undoes that benefit really fast...


you could use mono....?


I wish Mono would be even half as good as the .NET, I really do!!

I actually had great hopes for the .NET Compact Framework until the Dalvik came along...


how so?


This is not new, of course C# is the better language. What is the better environment is up for debate, but the C# language is better designed, friendlier, and more feature-packed leading to more concise code.


The author has some pretty wide ranging experience. The value I got from the read is that his preferred coding languages are scala and c# for features he describes.

Thanks for the share fogus.


Perl have http://perldoc.perl.org/perldsc.html

    * arrays of arrays
    * hashes of arrays
    * arrays of hashes
    * hashes of hashes
    * more elaborate constructs


Mono notwithstanding, getting into C# culture and ecosystem isn't really feasible for pure-UNIX developers like me. Java takes the cake there.


why not withstand mono? I've worked on two open source projects that used mono and we've had a great time with it. It's portable, FOSS, runs fast, compiles (almost) everything, and has a strong and vibrant community.

The JVM is closed source, which is a non-starter for me. Why should I invest in a proprietary platform that is lagging in features and support?

MS won this battle, get over it


The JVM is GPLed.


Ook is a better language than Java.


now that's just mean.


If he said "Oak", instead, I would vote him for being a predecessorist; usually, a bunch of people with better judgment than fadists.


I dunno. What's it do that my turning machine with infinitely long tape doesn't do?


"The JVM is robust, mature, fast, and (above all) portable."

mono is damn portable.


Two dinosaurs stepping on each others' eggs.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: