There's a lot wrong with Java, but even while having moved on and learned / used professionally many other languages I keep coming back to it and its ecosystem. There is still not another language / platform that provides the same level of a variety of things that are important to me:
* platform independence
* performance
* low level features
* simplicity and clarity (for reading, writing not so much)
* infrastructure/tools (IDE, visualvm, etc)
Admittedly, I lean more and more into JVM languages like Groovy and Scala these days. But even then I still drop into Java to write parts of the code that I want to be as fast as possible.
I hope I get no down votes from the following comment. This is not true, C# can be thought as superior to Java, only if you intend to be completely immersed in the Microsoft stack and this assertion is still debatable. I personally like Java more than C# just because Java is truly platform independent and fully open source. When you have two similar software products the one which is open source will always be a better choice. I think Java has a bright future.
I have done less than 10 hours of .NET programming in my life so I have no idea here... but my impression is that MONO substantially less accepted than a standard Java port... not trying to bash, just explaining my view. I'm moving a significant production Java app from a Linux box to Windows in the next 3 months. My expected work is about 2-days, and frankly my management wouldn't expect more, and I'd have a hard time justifying more (it's probably padded already... don't tell). The portability of Java apps is wonderful. I'd guess MONO could do the same thing, Windows to Linux, but just explaining the run-time to my management or Change Management would require testing, which is cost, which is probably waste, but is also necessary... a Oracle JVM on Linux or Windows, doesn't require the same due diligence.
I have done less than 10 hours of .NET programming in my life so I have no idea here... but
Then don't comment. Your comment is comparing something you know to something you have no idea about. How can anyone legitimately make such a comparison?
I can tell you I've done 10 minutes of C# programming in my life, while addressing a StackOverflow comment, and in that 10 minutes I found something that worked on Microsoft's .NET runtime but not on Mono. You don't need experience to find evidence.
True, but you can't spruik that and then tell us in the next breath about the wonderful developer tools and Intellisense, etc., because most of that doesn't exist outside Windows. With Java it's not just the JVM that is cross platform - the whole developer ecosystem and culture is from the ground up. Every IDE, every compiler, every tool, all runs on every platform. It has it's holes, but largely Java actually achieves this, which when you need it, is a huge win.
Heh, I didn't even realise it was Australian slang. The meaning from your link is correct - to sell, extoll the virtues of or try to convince other people to buy something.
Infrastructure of Mono is not in any way comparable to proper c#. Also how come MonoDevelop's latest version doesn't work on Linux? On Windows it became Xamarian and it is ok ish, but I would not use it for a major project, refactoring tools are more or less non existant. On Linux they are stuck with the old version of MonoDevelop
Yes. However, C# uses the convention that capitalized "fields" are actually properties, and lowercase ones are true fields.
For example,
Foo.X might be an x position, returned from a getter method, and set with a setter method. Internally, the class make use the Foo.x field to store it, in which case the getter and setter are trivial. In fact, C# will write them for you
The property could look like:
int X{
get;
set;
}
(Though my syntax might not be completely correct, I haven't used C# in a while). C# will automatically create a private field to store the value for x, and the getter and setter will work as expected.
Classes should, as a general rule, only expose properties and methods to the outside world. All fields should be private. Yes, accessing a property calls a method, but so does a Java getX().
Java uses the same rule, except getters and setters are implemented using setX(int) and getX(). C# properties are the equivalent. The client of a class should not care how the class stores values, but that the getters and setters work.
I've written a lot of C# and Java (and others of course). It's really not an issue. If you're doing something expensive in a property getter or setter you're doing it wrong. If the function call doesn't get inlined and becomes a bottleneck in some tight loop you can just change it. Anecdotally, I have yet to see this occur in practice.
Also, as the guy below me pointed out, by convention you know that Foo is a property.
Exactly. It's (at least from what I've seen/read) common convention to make sure that getters/setters should be quick and have minimal side effects.
Your application shouldn't hang from a database call when you pull a property from an object. And obviously, methods doing such things should be documented appropriately.
Huh? Of course it is a feature. My point is that if something as innocent looking as property access can be an arbitrary method call, it may make understanding a piece of code more difficult. From the point of view of debugging existing code, which I've done a lot lately, hiding details that may matter in corner cases is not something that I want the language to encourage.
Umm... Isn't that just an IDE feature and not a language thing? IntelliJ IDEA 12 has pretty amazing IntelliSense features. 90% of the time it knows exactly what i want to type from the first few Letters (even though this Enterprise Level Software has tons of similarly named classes/objects etc) Apparently it observes patterns to know which classes are used with which classes most often.