News for hackers. Stuff that matters.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by jimmaswell on Wednesday October 09, 2013 @08:05PM (#6524795)
You can get all of that and clearer writing in c#, with Intellisense.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by jorgecastillo on Wednesday October 09, 2013 @09:10PM (#6525078)
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.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by LukeShu on Thursday October 10, 2013 @12:20AM (#6525611)
To be fair, Mono exists, and contains a free implementation of C#.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by KevinEldon on Thursday October 10, 2013 @12:39AM (#6525669)
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.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by stormbrew on Thursday October 10, 2013 @12:59AM (#6525731)
Unity is probably the biggest commercial use of Mono: http://en.wikipedia.org/wiki/Unity_(game_engine)
Re:If Java Is Dying, It Sure Looks Awfully Healthy by CmonDev on Thursday October 10, 2013 @09:59AM (#6527700)
Xamarin is more likely.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by 300bps on Thursday October 10, 2013 @07:32AM (#6526841)
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?

Re:If Java Is Dying, It Sure Looks Awfully Healthy by peeters on Thursday October 10, 2013 @10:55AM (#6528045)
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.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by zmmmmm on Thursday October 10, 2013 @01:20AM (#6525783)
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.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by balakk on Thursday October 10, 2013 @04:30AM (#6526356)
Xamarin is wonderful. There's a huge .NET OSS ecosystem out there. You might be surprised with what can be done with it.

http://xamarin.com

Re:If Java Is Dying, It Sure Looks Awfully Healthy by boothead on Thursday October 10, 2013 @06:35AM (#6526690)
Unfortunately it looks like xamarin has completely abandoned linux as a platform.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by profquail on Thursday October 10, 2013 @08:27AM (#6527049)
Citation please?
Re:If Java Is Dying, It Sure Looks Awfully Healthy by riffraff on Thursday October 10, 2013 @03:19AM (#6526160)
OT:, pardon this non-native, what does "spruik" mean? I can only find this[0] but it seems an intransitive verb compared to what you used

[0] http://dictionary.reference.com/browse/spruik

Re:If Java Is Dying, It Sure Looks Awfully Healthy by zmmmmm on Thursday October 10, 2013 @05:07AM (#6526451)
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.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by Tloewald on Thursday October 10, 2013 @06:43AM (#6526707)
English. spruikers are the guys at open air markets screaming out the virtues of their wares.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by darklajid on Thursday October 10, 2013 @04:08AM (#6526296)
MonoDevelop is far from bad, actually. And cross-platform.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by pjmlp on Thursday October 10, 2013 @01:46AM (#6525859)
Of the language, not the libraries or tooling.

A language is much more than just syntax.

With mono, one ends up writing C# code similar to C and C++, with #ifdefs, or having to search for .NET libraries that are cross platform.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by cmircea on Thursday October 10, 2013 @07:37AM (#6526853)
Those cases are inherently platform specific and are impossible to abstract completely.

UI for example. Pure Java UIs plain suck; you can use Gtk# in C# for the same thing, but none will be up to the platform's UI standards.

Besides, the JVM isn't available on iOS and Android, so it isn't universally available either.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by LukeShu on Thursday October 10, 2013 @09:59AM (#6527702)
Java is actually used heavily on Android.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by CmonDev on Thursday October 10, 2013 @12:50PM (#6528684)
On Dalvik not JVM.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by goldeneye on Thursday October 10, 2013 @08:40AM (#6527102)
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
Re:If Java Is Dying, It Sure Looks Awfully Healthy by snarfy on Thursday October 10, 2013 @09:54AM (#6527656)
What do you mean it doesn't work on linux? It works fine. It helps to use the distro (opensuse) the mono developers use.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by camus on Thursday October 10, 2013 @12:45AM (#6525688)
MSFT could shut down Mono anytime it wants.How many business use mono (to build web apps) in production?

Scala,Groovy,Xtend,etc... there is enough languages on the jvm one doesnt have to use any MS related tech.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by EpicEng on Thursday October 10, 2013 @03:43AM (#6526212)
How so? C# is a standardized language.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by pjmlp on Thursday October 10, 2013 @07:42AM (#6526869)
Only partially. Microsoft has stopped submitting language updates to ECMA.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by joshrivers on Thursday October 10, 2013 @02:03AM (#6525919)
Source citation please?
Re:If Java Is Dying, It Sure Looks Awfully Healthy by cmircea on Thursday October 10, 2013 @07:40AM (#6526863)
On what grounds?
Re:If Java Is Dying, It Sure Looks Awfully Healthy by Theriac25 on Thursday October 10, 2013 @02:31AM (#6526013)
Doesn't C# have "magic" getters and setters, where code like "foo.bar = quux;" might mean a function call? To me, that's not clearer at all.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by russellsprouts on Thursday October 10, 2013 @03:06AM (#6526121)
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.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by Someone on Thursday October 10, 2013 @04:07AM (#6526293)
"However, C# uses the convention that capitalized "fields" are actually properties, and lowercase ones are true fields."

If only. In http://msdn.microsoft.com/en-us/library/vstudio/ms229043%28v..., Microsoft advocates:

"The PascalCasing convention, used for all identifiers except parameter names, capitalizes the first character of each word"

Re:If Java Is Dying, It Sure Looks Awfully Healthy by cmircea on Thursday October 10, 2013 @07:42AM (#6526872)
The UI in MonoDevelop / Visual Studio will show the differences during autocomplete. Also, fields should NEVER be public in a class.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by EpicEng on Thursday October 10, 2013 @03:42AM (#6526210)
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.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by prawks on Thursday October 10, 2013 @09:11AM (#6527364)
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.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by Tloewald on Thursday October 10, 2013 @06:46AM (#6526714)
Isn't not needing to know whether an object property is real or synthetic a feature?
Re:If Java Is Dying, It Sure Looks Awfully Healthy by Theriac25 on Thursday October 10, 2013 @06:58AM (#6526745)
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.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by Tloewald on Thursday October 10, 2013 @07:54AM (#6526910)
So you're against pretty much all encapsulation then?
Re:If Java Is Dying, It Sure Looks Awfully Healthy by xerophtye on Thursday October 10, 2013 @05:14AM (#6526473)
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.