C# is now a better language than Java
brizzled.clapper.org
brizzled.clapper.org
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.
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)
"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."
C++ --> Java --> C#
>>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"? :-)
J#[1]? J++[2]?
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...
http://en.wikipedia.org/wiki/Java_%28software_platform%29#Hi...
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).
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.
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)
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.
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.
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#.
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?
Maybe they don't want their coworkers to go nuts inventing new features and then be the ones that need to maintain them.
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
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...
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.
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 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 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.
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 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.
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.
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.]
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.
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.
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 ;)
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.
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.
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.
Then other decisions forced them to change the bytecode anyway, but they never fixed generics.
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.
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.
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 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#.
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)
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.
"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#...
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.
It is surprising that some of the apache projects have .NET equivalents (lucene, log4j, ant) but some others dont........
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.)
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.
And no, I am not kidding or making this up.
(No, I program mostly in C#)
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.
I actually had great hopes for the .NET Compact Framework until the Dalvik came along...
Thanks for the share fogus.
* arrays of arrays
* hashes of arrays
* arrays of hashes
* hashes of hashes
* more elaborate constructsThe 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
mono is damn portable.