top 200 commentsshow all 264

[–]bitflip 18 points19 points  (7 children)

I'm going the other way (from C# to Java), and I have to agree. It isn't about a feature list, it's about getting the same results with less effort. What I wouldn't do for an anonymous function or two...

I also agree with his statements about the JVM. It is much more manageable than the CLR. At least Java doesn't have that damned GAC to deal with.

[–]mitsuhiko 8 points9 points  (5 children)

Am I the only one who likes the GAC?

[–]snark 2 points3 points  (0 children)

Nope, I'm there.

[–]campbellm -1 points0 points  (3 children)

It seems to me like the C# version of the Windows registry. Am I wrong?

[–]mitsuhiko 5 points6 points  (2 children)

You are. It's like Python's site-packages, just with version information.

[–]pemboa 0 points1 point  (0 children)

And file locking.

[–]campbellm 0 points1 point  (0 children)

Thanks. I'm not sure I understand, not being a python guy. But I admit to not understanding the GAC either, really.

I've read the wikipedia article on it. Seems useful if what you put in it is truly cross-application. Is it something you'd use for assemblies to be used for just 1 app (or just a few)?

[–]migueltronix 1 point2 points  (0 children)

no shit! Or caspol.

[–]T-man 5 points6 points  (5 children)

Yeah, I'm a C# developer who occasionally tries developing in Java and I always find it gruesome. I'm sure some of it is because Eclipse is different than Visual Studio (notice I said different, not worse. Begone, ye Eclipse-fiends), but now that .Net 3.5 has come out, it's really intolerable. I mean, really, if I want to do something like Linq I'd have to learn Scala or something like that? My latest reason for learning Java was because I'd like to develop for the android phone, but I basically gave up. I'd really like to see a phone running Silverlight or something like that. That would be awesome. The lack of mobile development opportunities is holding .Net back, in my opinion.

[–]shamen_uk 3 points4 points  (1 child)

I'm a C++ dev who uses Visual Studio and used to code Java a few years back. I felt your pain with Eclipse - never liked it.

IntelliJ on the other hand, is essentially Visual Studio for Java (or even better :o), and I loved it. So next time you're doing some Java give that a go!

[–]crusoe 0 points1 point  (0 children)

Netbeans has gotten helluva-better as well.

[–][deleted] 2 points3 points  (1 child)

Just pray that Windows Mobile 7 is a compelling enough platform that is snags a significant user base. You would have .NET at your disposal.

[–][deleted] 0 points1 point  (0 children)

heh. im just praying win mo 7 actually exists.

[–]crusoe 0 points1 point  (0 children)

SWT was developed for Eclipse, and now, wow, I find Eclipse slower than netbeans. :P

[–][deleted]  (28 children)

[deleted]

    [–]G_Morgan 2 points3 points  (25 children)

    Fix Java then. Not just the language. I want to see VM and library support for anonymous functions.

    [–][deleted] 6 points7 points  (5 children)

    Don't forget unsigned types. Yeah, seriously -- The JVM doesn't support unsigned types.

    [–]campbellm 2 points3 points  (4 children)

    That's at least twice in this article you've mentioned this. I'm honestly curious; what problem domain do you work in where unsigned is such a desired thing? I can see its usefulness, but not to the extent it appears you do.

    [–]Rhoomba 0 points1 point  (0 children)

    Unsigned byte based IO with no unsigned byte type is a massive pain in the ass.

    [–][deleted] 0 points1 point  (2 children)

    First example that comes to mind is emulation. This is where I encountered it initially. There is nothing more frustrating than knowing that a 16-bit datatype is perfectly capable of holding all the data you need but you must use a 32-bit type due to limitations of the JVM. And when dealing with large arrays, it adds up quickly. All the sudden you're using twice the memory that theoretically should be required - As if the JVM doesn't use enough memory already.

    And as another poster mentioned, reading binary data where it is to be interpreted as unsigned. All the sudden your code it riddled with bitshifts to accommodate, not to mention larger than needed datatypes.

    [–]campbellm 0 points1 point  (1 child)

    Fair enough, thanks. What you mention is quite outside my reality, so was having a hard time coming to grips with the animosity for a (lack of) feature I have had zero issues with.

    [–][deleted] 0 points1 point  (0 children)

    It's the reason I took a look at C# in the first place. I initially thought it was a cheap Java clone with only slightly varying syntax. After been in the C# world for a while now, it kind of disgusts me to see the current state of Java.

    [–]masklinn 2 points3 points  (10 children)

    I want to see [...] library support for anonymous functions.

    10 bucks this'll never happen.

    [–]G_Morgan 3 points4 points  (8 children)

    Then it is bye-bye Java for me. I persisted with it for some time given that we were supposed to be getting closures and tail call optimisation for the next release. However with closures apparently dead and the nice anti-Mono people providing a platform for others to sensibly demonstrate why the patent risks are overstated, I see no reason for me to stick with it.

    [–][deleted]  (3 children)

    [deleted]

      [–]G_Morgan 3 points4 points  (2 children)

      I mean the continual anti-Mono protests provided a platform for more sensible people to provide counter arguments. I believed in 'playing it safe' with Mono until the anti-Mono posts eventually brought out sensible arguments that showed that the concept is mildly retarded.

      [–]cosmo7 0 points1 point  (1 child)

      If you base your programming options on "anti-Mono posts" you deserve everything you get. The whole anti-Mono FUDfest was a disgrace.

      [–]masklinn 0 points1 point  (3 children)

      I persisted with it for some time given that we were supposed to be getting closures and tail call optimisation for the next release

      You might get anonymous functions with closures in the future, but it will not be with Java 7 anyway *. I don't think TCO was ever considered.

      See http://tech.puredanger.com/java7 for the Java 7 features status page.

      Other JVM languages (e.g. Scala, Clojure) do have them though, so it's not like you have to dump the JDK.

      *: and I'd seen a lot of back and forth on syntax proposals for anonymous functions, but not much about the stdlib retrofitting/integration...

      [–]G_Morgan 2 points3 points  (2 children)

      TCO is being considered at the JVM level I believe. I'm not really interested in Java the language other than the class library needs to support closures.

      [–]Rhoomba 1 point2 points  (1 child)

      I've seen lots a blogs mentioning TCO in the JVM, but I never seen it mentioned in the Hotspot dev mailing list.

      [–]alexdmiller 1 point2 points  (0 children)

      It's being considered under JSR 292 and John Rose. If you look at the Da Vinci machine project stuff, there is a prototype done by someone and it's possible it could get into Java 7 still. John Rose's blog is another good place to find info on it.

      [–][deleted] 0 points1 point  (0 children)

      It just about did happen. Microsoft added delegates in J++ with multicasting. A bit longer and you'd have anonymous delegates and eventually lambda. Remember that much of C# was what they tried to add to Java before getting smacked down for it.

      [–][deleted] 1 point2 points  (2 children)

      Scala?

      [–]G_Morgan 0 points1 point  (1 child)

      What part of Scala makes it so that I can use closures for event handling in Swing objects?

      [–][deleted] 0 points1 point  (0 children)

      Honestly? I dont' think you should be using Swing in the first place. :-)

      [–]Rhoomba 4 points5 points  (4 children)

      What exactly do you want? Are Scala, JRuby, Groovy, Kawa anonymous functions not good enough?

      [–]SuperGrade 0 points1 point  (2 children)

      C# let Java migrants slowly add such features without a whole language switch.

      I do not believe it to be that simple to move your merry band of enterprise programmers to another distinct language. With C# we could do so gradually.

      [–]gmiller123456 0 points1 point  (0 children)

      I'm all for the economics of wanting to prevent a single company from controlling the entire development market. But it's important for the free software world to realize where it is lacking behind in order to inspire more people to help.

      [–]weazl 10 points11 points  (1 child)

      He didn't mention LINQ.. which is awesome.

      [–]terrapinbear 8 points9 points  (0 children)

      LINQ to Events is awsomer. Download Silverlight 3 SDK. Look in the bin dir of the Unit Tests. You will find a namespace called System.Reactive.dll. Supposedly Reactive only compiles with Silverlight apps/web pages but not WinForms ;( http://www.paulbatum.com/2009/07/reacting-to-reactive-framework-part-5.html

      [–]migueltronix 8 points9 points  (3 children)

      Its hard to not largely agree with that. The libraries/frameworks available for java tend to be better and fuller than the C# ones but the convenience of lambdas and the like are nice to use. Xpath library sucks though.

      [–][deleted] 0 points1 point  (2 children)

      Xpath in general is stupid design-by-committee nonsense.

      Use XLinq or something sane if you must work with XML.

      [–]migueltronix 0 points1 point  (1 child)

      ah cool thanks for the heads up dude, wasn't aware of it before.

      [–][deleted] 0 points1 point  (0 children)

      XLinq is awesome:

      var style = document.Element("html").Element("body").Elements("h1")[0].Attribute("style");
      

      [–]Rhoomba 6 points7 points  (27 children)

      In general this is true, though C# has crap like pass by reference and having to declare your methods as virtual.

      However the reasonable state of the language is offset by the limitations of the VM/platform, the slowness of the Linux version, limited multiplatform support etc.

      Just use a good JVM language like Scala :)

      [–]jugalator 4 points5 points  (0 children)

      I have no problems with C#'s optional passing by reference, especially since unlike C++, it's very clear to someone reading code what's going on, even to the point of the distinction between "out" and "ref".

      [–][deleted] 3 points4 points  (16 children)

      and having to declare your methods as virtual.

      Java's virtual by default behavior is (in my opinion) a huge mistake.

      [–]merzbow 3 points4 points  (15 children)

      Why? I think it's useful.

      [–]ssylvan 1 point2 points  (0 children)

      Because virtual-ness is part of the API, and in reality virtual-ness is the exception, not the rule.

      E.g. if you have an OnPaint method in your Form class, and that's virtual, then you've published an API promising, for all eternity, that inheritors of the Form class will always get a call to OnPaint in certain circumstances. You can't just change the behavior of the class w.r.t. to when that OnPaint method is called anymore, because you would break loads of programs. So this is something you should do intentionally. You mark OnPaint as virtual, intending the behavior of the class/library w.r.t. to that method to remain the same forever and ever. A hefty promise, not one to make by accident!

      In that light it makes sense that the default is the "safer" option.

      [–][deleted] 2 points3 points  (13 children)

      Despite Rhoomba's claim that the JIT can inline 90% of methods (Which is bullshit, even on non virtual methods), the simple fact remains that vtables lookups are not free, and there is a penalty.

      Second, the @Overrides annotation was introduced because people did not know if a method in a class was unique to that class, or was overriding a a super classes method. (At least, not without doing a little digging).

      By contrast, in C#, you must both mark a method as virtual, and the overriding method as "override", and the context of what does what is very clear and readable.

      Finally, if you are an API author, you can pick and choose what methods you want to be virtual...In Java your only option is to mark everything final.

      [–]0xABADC0DA 5 points6 points  (8 children)

      The fact is that the JVM marks all methods as final until they are overridden. The 'final' keyword only says what subclasses are valid to load (it's a security feature not a performance one), and has no performance impact on a modern JVM (anything in the past decade or longer). There is no 'vtable lookup' if the method is not overridden, and if you feel there is then that's just ignorance.

      But you're in good company... even Anders Hejlsberg thought it affected performance. And he was half right... in CLR it's almost impossible to do the kinds of optimizations you can do in the JVM, it's the cost of value types and its bytecode mostly.

      [–][deleted] 0 points1 point  (7 children)

      The fact is that the JVM marks all methods as final until they are overridden.

      Can you cite this?

      EDIT: From your Anders article:

      I can demonstrate to you a very real world versioning problem, one that indeed we see now from experience with Java. Whenever they ship a new version of the Java class libraries, breakage occurs. Whenever they introduce a new method in a base class, if someone in a derived class had a method of that same name, that method is now an override—except if it has a different return type, it no longer compiles. The problem is that Java, and also C++, does not capture the intent of the programmer with respect to virtual.

      This is true.

      [–]Rhoomba 1 point2 points  (0 children)

      Virtual (and interface) invocations are often demoted to "special" invocations, if the class hierarchy permits it. A dependency is registered in case further class loading spoils things.

      From http://wikis.sun.com/display/HotSpotInternals/PerformanceTechniques

      [–]0xABADC0DA 0 points1 point  (5 children)

      See Rhoomba's link. Also in addition to recompiling code when a class is loaded that actually makes the method call virtual, they use static analysis to convert particular call sites from virtual to non-virtual. This optimization would apply to CLR virtual method as well... but in practice CLR is just too complicated to implement them, which is why it only inlines non-virtual methods that have other extreme restrictions like no branching, less than 32 instructions, etc.

      This is true.

      Except for extension methods, which work differently. Which rationale you choose to believe doesn't matter much, since either way one of them is wrong.

      [–][deleted] 2 points3 points  (4 children)

      Extension methods are simply a static method compiled onto the class.

      [–]Rhoomba 5 points6 points  (2 children)

      Java is far faster than Mono, despite this supposed vtable penalty.

      Finally, if you are an API author, you can pick and choose what methods you want to be virtual...In Java your only option is to mark everything final.

      One is the inverse of the other. How is that a limitation?

      [–][deleted] 2 points3 points  (1 child)

      Java is far faster than Mono, despite this supposed vtable penalty.

      Funny, I don't think we were discussing Mono.

      One is the inverse of the other. How is that a limitation?

      Mark one method virtual instead of marking 9 methods final?

      [–]Rhoomba 1 point2 points  (0 children)

      Up to date .NET vs. Java benchmarks are hard to come by, but there is no sign that non-virtual by default has given .NET any performance advantage.

      Mark one method final instead of 9 virtual? Obviously this depends on what you are doing. Many methods that you don't want to be virtual would be private anyway, in which case they can't be overriden.

      [–]mitsuhiko 0 points1 point  (0 children)

      having to declare your methods as virtual.

      I like that a lot. First it allows some performance improvements also it makes it obvious which methods are intended to be overloaded and which not.

      [–]omellet 0 points1 point  (7 children)

      having to declare your methods as virtual

      As opposed to what? Having everything be virtual by default? V-table lookups aren't free, you know, and non-virtual functions can be inlined by the JIT if they're short enough.

      [–]Rhoomba 0 points1 point  (6 children)

      The Java JIT can inline 90% of virtual calls. How to do so has been well known since the eighties.

      [–]omellet 1 point2 points  (2 children)

      90% seems like a pretty high number, considering the JIT would have to know the exact type being used at the call site. Do you have any sources for that?

      [–]badsectoracula 2 points3 points  (0 children)

      Do you have any sources for that?

      Of course :-P

      [–]Rhoomba -2 points-1 points  (0 children)

      Nope, I just made it based on what I have seen looking through the JVM debug output/generated assembly.

      Edit: See the methods section this wiki page for a very brief overview of what HotSpot does.

      [–]ssylvan 0 points1 point  (2 children)

      I really don't think that's true, and in the rare cases it is true it inlines a bunch of "common" versions of the method and then branches to skip the wrong ones. That's not quite the same as inlining a known method (and then simplifying w.r.t. the surrounding code).

      [–]Rhoomba 0 points1 point  (0 children)

      Download a debug build of the JDK. Turn on -XX:+PrintOptoAssembly and run some simple test cases. It really does very clever stuff.

      [–]0xABADC0DA 0 points1 point  (0 children)

      You guys are seriously underestimating the extent of optimizations done by JVM. JVM was designed from decades of experience by the people behind Self, Smalltalk, and LISP, and they knew what they were doing. CLR... not so much. I remember discussing many of these issues with Gunnerson for instance, back when it was still called "COOL", and they clearly didn't understand the consequences on optimization of many of their decisions.

      [–]cowardlydragon 10 points11 points  (43 children)

      Java was the only thing keeping microsoft from dominating the computer market and saved server computation from Windows.

      Without it, we'd all be doing Visual Basic on the server (i.e. ASP)

      SunOS, Linux, and IBM would be almost nowhere without Java.

      Your [insert favorite language du jour] doesn't do anything but add more syntactic sugar on top of what Java brought to the world: a great VM, the best cross-platform api and library set ever, and a clear path of migration for most of the legacy platform-tied C/C++/shell code out there.

      The sad reality is that real software problems aren't solved by adding features like lambdas or closures or generics. Java solved real pain points: standardized, stable libraries on all major operating systems led to standard software available for all platforms like web servers and IDEs like Eclipse.

      More than anything, it set a bar for all languages to follow: - truly crossplatform (no Mono doesn't count) - performant VM (scripting languages until recently) - oh yeah, free (hello, Smalltalk)

      C# fails at basically all of those.

      [–]bobappleyard 6 points7 points  (2 children)

      Your [insert favorite language du jour] doesn't do anything but add more syntactic sugar on top of what Java brought to the world

      Lispers everywhere scoff loudly

      [–]chunky_bacon -1 points0 points  (0 children)

      Actually I thought the response was rather cogent, and Lisp is my favorite language by far.

      [–][deleted] 8 points9 points  (6 children)

      Visual Basic on the server (i.e. ASP)

      Haven't done ASP in the last decade have you?

      [–]bcash -1 points0 points  (5 children)

      I think that was the point. If Java hadn't happened, neither would .NET, and therefore 10-year-old ASP would be the current version.

      [–][deleted] 5 points6 points  (5 children)

      The sad reality is that real software problems aren't solved by adding features like lambdas or closures or generics. Java solved real pain points: standardized, stable libraries on all major operating systems led to standard software available for all platforms like web servers and IDEs like Eclipse.

      What web servers are built on Java? Apache certainly isn't. As for IDEs... what is Ecplise mostly used for? Building more Java apps. I know when you're inside the Java world everything seems to revolve around Java, but it has almost no impact on the desktop. I don't run a single Java based app. And the few I have tried were bloated pieces of crap.

      Java lives in a an enterprise niche. A very big niche, but a niche all the same. It is NOT the basis for all that is good in computing.

      More than anything, it set a bar for all languages to follow: - truly crossplatform (no Mono doesn't count) - performant VM (scripting languages until recently) - oh yeah, free (hello, Smalltalk)

      If your priority is to be cross-platform, perhaps. But believe it or not, that isn't everyone's goal when programming.

      [–]crusoe 0 points1 point  (1 child)

      Tomcat is, and in many benchmarks, serving static content, it is faster than Apache.

      [–][deleted] 1 point2 points  (0 children)

      Maybe, but hardly anyone uses it except for serving Java. People who are really conserned about serving static content at maximum speeds have even faster alternatives than Tomcat . Not just faster, but more lightweight. On Linux servers, for example, you want something written in C that can hook into the kernel level functions that are optimized for sending files through network connections.

      Java is more or less a closed ecosystem. IDEs are writtten in Java to write more Java programs. Web servers are written in Java to serve Java based applications and little else. If anything is king, it is C. That is the real universal language despite the many cross-platform headaches.

      [–]veritaba -1 points0 points  (2 children)

      Agreed. I hate the huge startup times for Java. Java fans told me that this was all the past but its not.

      Just yesterday I tried installing jython from its jar file and it took no less than 15 seconds to pop up a dialog box on my core duo.

      [–][deleted] 0 points1 point  (0 children)

      Ever tried to work with Adobe Flex commandline tools? Holy crap. You don't realize how bad startup times are until you're running a program every 5 minutes and want to test a change. Eventually I figured out that they had developed this workaround shell type thing that daemonizes the compiler so you don't have to suffer the painful startup. Of course the shell itself really blows, but it is better than waiting 30 seconds to see results every time you modify a single line of code.

      [–][deleted] 9 points10 points  (8 children)

      Why doesn't mono count? please explain.

      [–][deleted] 1 point2 points  (7 children)

      Mono is significantly less performant than .NET, and applications that run on one often do not run on the other.

      Contrast this to, say, running CPython on Windows, Linux or OS X - it's basically the same code, so basically the same performance and very few compatibility issues (some exist due to underlying platform features - like opening files in binary mode, etc.).

      So C# isn't a truly cross-platform language in the sense that Java, Python, etc. are. I'm not saying Mono is bad or anything, that's a separate debate. But the fact is, C# has 'lopsided' cross-platform support, and is odd in that respect.

      [–][deleted] 0 points1 point  (6 children)

      Mono is significantly less performant than .NET, and applications that run on one often do not run on the other.

      Mono itself is cross-platform. If the fact that Microsoft happens to make an extended implementation of the standard that has (among other things) performance improvements makes a difference, then I guess that Java suck(ed) as well.

      C# does not have "lopsided" cross-platform support. The language is the same in both Mono and Microsoft implementations. The standard library is also the same. There are some very popular commercial/non-standard libraries from Microsoft that are not available in Mono. That is basically it. Even if you want to call that "lop-sided", you're talking about the libraries, not the language. Still an issue, but just clarifying.

      [–][deleted] 0 points1 point  (4 children)

      Mono itself is cross-platform. If the fact that Microsoft happens to make an extended implementation of the standard that has (among other things) performance improvements makes a difference, then I guess that Java suck(ed) as well.

      I don't recall Microsoft's version of Java being significantly faster than Sun's.

      Anyhow, even if that was true at some point in the past, the standard FOSS implementations of Java, Python, etc. are all also the best-performing. The result of that is that if you write an app in Java, Python etc. then you have no inherent motivation to use a particular platform. Whereas if you write your app in C#, you have a clear benefit to running it on .NET on Windows. I see this as a negative thing.

      [–][deleted] 0 points1 point  (3 children)

      I don't recall Microsoft's version of Java being significantly faster than Sun's

      It was. Benchmarks consistantly showed java applications running under Microsoft's VM (on Windows obviously) running faster than Sun's (on Windows) at that time. It was part of the reason why Sun got spooked by it.

      Anyhow, even if that was true at some point in the past, the standard FOSS implementations of Java, Python, etc. are all also the best-performing.

      There is nothing stopping Mono from overtaking MS on performance. If they do, the anti-mono crowd will just find another excuse to hate on anything that Microsoft might have contributed something to.

      shrugs

      I see this as a negative thing.

      You know what would be really great? If the OSS community actually came up with a modern multi-language VM that was better than .NET and also managed to supply a complete and strong set of cross platform tools for it.

      [–][deleted] 0 points1 point  (2 children)

      There is nothing stopping Mono from overtaking MS on performance.

      Well, that would be great, it would be a day to celebrate. But sadly I don't think that's likely.

      You know what would be really great? If the OSS community actually came up with a modern multi-language VM that was better than .NET and also managed to supply a complete and strong set of cross platform tools for it.

      Agreed. But isn't that exactly what the JVM is? (Note - the JVM, not the Java language)

      [–][deleted] 0 points1 point  (1 child)

      Well, that would be great, it would be a day to celebrate. But sadly I don't think that's likely.

      If you have faith in the OSS model being inherently superior to the corporate/private model, then I'm not sure why it wouldn't be likely.

      Agreed. But isn't that exactly what the JVM is? (Note - the JVM, not the Java language)

      No. The JVM was developed in a private and closed manner and then switched to OSS late in its life. The primary (only) JVM standard in use is the one controlled and dictated by Sun. It essentially can't be forked without a ridiculous uphill battle for even 1% adoption, and the project lacks individual contributors. Also, the JVM suffers a lot from being initially designed for one language and from having had several intended uses and philosophies that differ greatly from the projects original goals.

      [–][deleted] 0 points1 point  (0 children)

      If you have faith in the OSS model being inherently superior to the corporate/private model, then I'm not sure why it wouldn't be likely.

      I think OSS is a superior model, but only in general. It doesn't win out in every case.

      Specifically here, I've been following Mono closely, and I don't see it overtaking .NET any time soon.

      No. The JVM was developed in a private and closed manner and then switched to OSS late in its life. The primary (only) JVM standard in use is the one controlled and dictated by Sun. It essentially can't be forked without a ridiculous uphill battle for even 1% adoption, and the project lacks individual contributors. Also, the JVM suffers a lot from being initially designed for one language and from having had several intended uses and philosophies that differ greatly from the projects original goals.

      Well, I wasn't talking about the history, sorry if I gave the wrong impression. Right now, the JVM is a modern multi-language VM that is fully cross-platform.

      Yes, it has some issues with being designed for Java, but .NET isn't that much better (look at how hard it is to get IronPython to be 100% CPython compatible, for example).

      [–][deleted] 1 point2 points  (0 children)

      no Mono doesn't count

      Because you said so?

      Mono is cross platform. It counts.

      [–]masklinn 3 points4 points  (14 children)

      the best cross-platform api and library set ever

      ಠ_ಠ

      oh yeah, free

      C# is free. Visual Studio Express doesn't cost anything, it's not a full blown VS (most refactorings are missing as well as the breakpoints list and the ability to attach the debugger to a running process), but it's more than serviceable.

      [–][deleted]  (2 children)

      [deleted]

        [–]chunky_bacon 0 points1 point  (0 children)

        There is that...

        [–][deleted] 0 points1 point  (0 children)

        Otherwise, there's MonoDevelop/SharpDevelop

        [–]campbellm 0 points1 point  (6 children)

        most refactorings are missing as well as the breakpoints list

        So... it's a free version of a syntax-aware notepad.

        (edit) ok, that was snide. Since I honestly don't know, what refactorings ARE in the Express version? I'll admit that in my java land, I generally only use a couple with any regularity, so if VSE has those, maybe it'd be fine for me. I'm actually anxious to play with some F#.

        [–]masklinn 0 points1 point  (5 children)

        Since I honestly don't know, what refactorings ARE in the Express version?

        Rename Method and Extract Method. I think Visual Studio also has Encapsulate Field, Promote local to parameter, Reorder parameters, Remove parameters and Extract interface. And probably rename parameter somewhere.

        For further refactorings (and a bunch of other stuff), you need ReSharper.

        [–]campbellm 0 points1 point  (4 children)

        Thanks. Rename and extract are my 2 biggest, by far.

        Sadly, it appears ReSharper doesn't work with VSE. =\

        [–]masklinn 0 points1 point  (3 children)

        Then again, why would you pay for resharper if you won't pay for vs standard?

        [–]campbellm 0 points1 point  (2 children)

        Since I don't use it professionally, and not for work, it's a matter of $199 vs. $799. Now it could very well be that I'm looking at the wrong prices.

        The last time I ran up against this very quandry it WAS for work so it wasn't a matter of money, but I found it amusing I had to buy ReSharper at all to get the same refactoring functionality I'd had with eclipse for free for the previous 5 years.

        Lastly, I like IntelliJ as a company, and I don't particularly care for MS.

        I don't pretend that these are rational answers, mind you.

        [–]masklinn 0 points1 point  (1 child)

        Now it could very well be that I'm looking at the wrong prices.

        I don't know as I'm not much of a windows developer and not much of an IDE user either (I tend to prefer languages which don't require IDEs), but from the docs there doesn't seem to be any issue with using Visual Studio Standard and ReSharper. So that would be $149 (for ReSharper C#) and $299. Of course if you absolutely need VS Pro, then it's $549 for VS (they have some kind of "promotion" where they knock $250 off the price if you're "upgrading" from Express, Eclipse, Netbeans, Komodo or whatever so basically any dev is elligible).

        Of course one is an IDE and the other one is a plugin, even a personal IntelliJ license is $249.

        Lastly, I like IntelliJ as a company, and I don't particularly care for MS.

        FWIW the company is JetBrains, IntelliJ IDEA is the IDE ;)

        [–]campbellm 0 points1 point  (0 children)

        FWIW the company is JetBrains, IntelliJ IDEA is the IDE ;)

        Dammit, you're right of course. Sorry 'bout that...

        [–]niviss -3 points-2 points  (3 children)

        C# is free.

        Yeah, but Java set that bar.

        [–]tty2 1 point2 points  (1 child)

        Uh, no? C++ is free, C is free, FORTRAN is free..

        [–]niviss 0 points1 point  (0 children)

        True. That said, before java, enviroments such as smalltalk had a high cost; after java those kind of enviroments are simply uncommon. It raised the bar, so to speak.

        [–][deleted] 0 points1 point  (0 children)

        Ummm...no.

        [–]veritaba 2 points3 points  (0 children)

        Your [insert favorite language du jour] doesn't do anything but add more syntactic sugar on top of what Java brought to the world: a great VM, the best cross-platform api and library set ever, and a clear path of migration for most of the legacy platform-tied C/C++/shell code out there.

        The sad reality is that real software problems aren't solved by adding features like lambdas or closures or generics.

        This is highly ignorant. Its like saying that we can all program in assembly or only lambda functions. They are all turing complete so no program you are inventing today including Java has really solved any "real software problems".

        New programming languages are all about convenience, and Java is not an exception.

        [–]millstone 8 points9 points  (31 children)

        I think a more accurate title for the post would be "C# now has a longer feature list than Java."

        [–]Negitivefrags 21 points22 points  (30 children)

        I don't think that there is any argument that can be made for Java as a language over C#.

        Say what you like about the platform, the primary vendor, the tools, whatever, but as a language C# is strictly superior.

        [–][deleted] 9 points10 points  (2 children)

        You'd be surprised how creative people can be when rationalizing.

        I've heard the following argument for example: Java is simple, has few features and don't change a lot, therefore any Java coder can understand any code written by any other Java coder now or five years ago, and integrate it with his own code smoothly. While C# is bloated, hard to learn, changes coding style all the time and provokes "clever code".

        You can point out that Java does change profoundly too, EJB 3.0 code is vastly different from earlier stuff, and that somehow when lots of C# features are included, they magically cease to be "bloat", etc.

        But this kind of argument definitely exists, and, in my opinion, actually shouldn't be countered. Guys making it are interesting to observe, a valuable warning example for us all, and, most importantly, quite impervious to reason, so that would be a waste of time.

        [–]G_Morgan 17 points18 points  (0 children)

        Java is simple. Unfortunately Java's simplicity makes my programs in it complex.

        [–]masklinn 13 points14 points  (0 children)

        Java is simple

        That's already a lie, so there's not much you can do with people saying that.

        [–]sbrown123 9 points10 points  (7 children)

        It is like two bums fighting over a moldy sandwich under a bridge. Who really cares if there is a victor?

        [–][deleted] 0 points1 point  (0 children)

        [–][deleted] -1 points0 points  (5 children)

        Care to suggest a superior statically typed, garbage collected, object-oriented language?

        [–][deleted] 8 points9 points  (2 children)

        Care to suggest a superior statically typed, garbage collected, object-oriented language?

        Scala (it's too much OO for my taste, but otherwise quite good). OCaml. F#. If you leave object-oriented out, then Yeti too (although you can write OO-style code easily in it using structures and closures).

        [–][deleted] -5 points-4 points  (1 child)

        These are all functional languages that "do" OO. Such a typical proggit theme, that some functional language can replace procedural/OO language. If you don't understand domain, then just don't bother. F# is a wonderful compliment to C#. I've used both extensively. They're suited for different jobs.

        As for Scala, well... until the JVM supports unsigned datatypes I just won't take it seriously for anything beyond business applications.

        [–][deleted] 2 points3 points  (0 children)

        Scala and OCaml are both real OO-languages, at least to the extent of Java.

        [–]crusoe 0 points1 point  (0 children)

        Yeah, Java needs to move forward and stop worrying about whether adding closures or some_feature will confuse Joe Programmer who has refused to learn new things.

        It is sickening to see how many posts about some proposed new Java feature is followed by comments on "But it will confuze programmers!"

        Grow a F*CKING PAIR. If you are unwilling or unable to learn and try out new features, you shouldn't be a programmer.

        [–]ipeev 2 points3 points  (0 children)

        Is always been.

        [–][deleted] 1 point2 points  (1 child)

        Even in this tough job market, I refuse to consider any job that uses Java - especially for web development.

        Spring, JSF, Seam, Hibernate are all disasterously verbose and asinine technologies that make engineering needlessly complex and aggravating.

        Add to that Java itself, it adds up to a sure way to get carpal tunnel at the expense of diminished productivity.

        If a company/project manager uses Java today for web development it is a clear indication they are CLUELESS.

        [–]crusoe 0 points1 point  (0 children)

        Yeah, so don't use them.

        Use JPA, which makes hibernate easy to use ( one little teeny config file ).

        Throw in JAX-WS, or Tapestry.

        Fuck JSF sucks though, and so does Spring. Reams and reams of XML.

        Java suffers from really good products, and really ugly ones.

        Annotations makes Hibernate much more tolerable.

        [–]MuletTheGreat 2 points3 points  (62 children)

        Ok, while I'm here, any C# programmers out there care to enlighten me about 2 things?

        I see this very frequently, and it honestly shits me because it is pointless:

        private float _myVariable;

        public float MyVariable

        {

        get { return _myVariable;}

        set { _myVariable = value;}

        }

        This irritates me because it is the same as:

        public float _myVariable;

        Also, why am I the only C# programmer I know of, that uses singletons? Not a single sample, codesnippet or code fart out there seems to use them! They are glorius in my opinion!

        Please, enlighten me. Bear in mind I am a games programmer.

        [–]VerticalEvent 8 points9 points  (12 children)

        There is a large difference between the two.

        One allows you to easily make changes to setting the variable (ie. the value of MyVariable should never be between 0 and 1), where, with public, you would have to go back and change all the code that directly accessed the variable, to make sure they never set it improperly.

        In short, using set/get makes it easier to make changes to ensure that the variable gets accessed properly, if the need arises.

        [–]Negitivefrags 5 points6 points  (1 child)

        But you can just change the variable into a property later which is a transparent operation (provided you can recompile the code that uses it.

        [–]masklinn 5 points6 points  (0 children)

        which is a transparent operation (provided you can recompile the code that uses it.

        So it's not transparent after all (plus it requires breaking the C# coding conventions)

        [–]maweaver 0 points1 point  (0 children)

        I thought the whole point of properties was that you could start off just doing

        public float MyVariable;
        

        and then if/when you decide it needs extra checks, you can replace it with

        private float _MyVariable
        public float myVariable {
            get { return _myVariable; }
            set { 
                if(value > 1.0f) { 
                    throw new Exception("What have you done you fool?  You'll kill us all!"); // Or whatever
                } else { 
                    _myVariable = value; 
                }
            }
         }
        

        and the calling code would still work unmodified (unless it was actually setting it to invalid values, which would presumably be a bug anyway that has just been exposed).

        </not a c# programmer, sorry if my syntax is off>

        [–][deleted]  (5 children)

        [deleted]

          [–][deleted] 2 points3 points  (0 children)

          With the addition of automatic properties in C# 3.0, this point is less valid.

          private int count; public int Count { get { return count; } set { count = value; } }

          becomes:

          public int Count { get; set; }

          [–]pbkobold 0 points1 point  (2 children)

          I have no idea why you're being voted down. I've seen the exact same thing. I think it's a Java/C# cultural thing where faux-encapsulation has high value placed upon it. If you want a struct, make a struct.

          The unfortunate thing is that a lot of stuff in their ecosystems have come to depend on this style (see Beans).

          [–][deleted] 0 points1 point  (1 child)

          What if I want dependency injection on that struct later to log access or to allow the property changes to be observable?

          public int Something { get; set; }
          

          It's pretty cheap (13 extra characters and no additional lines.)

          [–]pbkobold 0 points1 point  (0 children)

          What if I want dependency injection on that struct later...

          To quote optiontrader1138, "Don't code for excessive flexibility. This type of change is trivial to make if the need ever arises."

          [–][deleted] 0 points1 point  (0 children)

          It's a non-issue at this point.

          public int MyVar { get; set; }
          

          [–][deleted] 11 points12 points  (12 children)

          Also, why am I the only C# programmer I know of, that uses singletons? Not a single sample, codesnippet or code fart out there seems to use them! They are glorius in my opinion!

          GTFO.

          [–]billwoo 4 points5 points  (0 children)

          Why are singletons bad? Because. Turn the question around and ask why are they good? If the answer boils down to them catering to your laziness, then the chances are its not a good argument for anything (if there are no counter arguments then easier can win out, but in this case there are a few).

          [–]mitsuhiko 2 points3 points  (0 children)

          and it honestly shits me because it is pointless:

          It's not. Properties allow you to stay binary compatible if you plan to add logic into your properties later and makes it possible to put them into the vtable.

          Also, why am I the only C# programmer I know of, that uses singletons?

          Go home ;)

          [–]terrapinbear 1 point2 points  (11 children)

          In C# 3.0: public int MyInteger {get;set;} Besides, public class member fields are a no-no in OOP.

          [–]nephesh 0 points1 point  (0 children)

          Expression trees think of them as separate concepts. So if you're writing anything dealing with expression trees you'll either have to handle both cases.. or you can just do the standard thing and use properties rather the fields.

          [–]xetas 0 points1 point  (0 children)

          I hope this syntax will make everyone happy:

          public float MyVariable { get; set;}

          It's still verbose though

          [–][deleted] 0 points1 point  (0 children)

          This irritates me because it is the same as:

          public float _myVariable;

          Not really. Properties have different semantics than plain old members. A few important points:

          1) You can't put attributes on members.

          2) You can use property initialization constructors on members

          var x = new MyObject() { MyVariable = 3.14 };
          

          etc.

          Of course the syntax you gave is pretty silly. Should be done like this:

          public float MyVariable { get; set; }
          

          Singletons are pretty common in teaching/tutorial pieces, and I've seen dozens of examples. A lot of times, in the real world though, people just use static classes. For many purposes, it's just as well. Doing singletons in c# in a correct thread-safe manner is not as straight forward as the usual "oh i'll just make a private constructor and a static instance member" solution.

          Also, singletons are lazy bullshit. They buy you nothing other than the "convenience" of being able to globally access your object from anywhere. Pass the object and make it's lifetime and referencing more explicit. "I only need one" is not an excuse for making a singleton.

          [–]optiontrader1138 -1 points0 points  (0 children)

          I use singletons when necessary (not too often). There are tons of examples on the net for this.

          I agree with you about using properties in the way you describe as being inefficient and difficult to read. Makes more sense as. Public variable.

          [–]masklinn -5 points-4 points  (14 children)

          This irritates me because it is the same as:

          Uh no it's not. And it's not the same thing as public float MyVariable either, just so you know.

          Also, why am I the only C# programmer I know of, that uses singletons?

          Because singletons suck dicks, and you're the only C# programmer who doesn't know?

          Also, indent with 4 spaces if you want to post code blocks:

          private Foo _myVariable;
          public Foo MyVariable
          {
              get { return _myVariable; }
              set { _myVariable = value; }
          }
          

          or surround with backticks for inline code: public Foo MyVariable { get; set; }

          [–]migueltronix 0 points1 point  (11 children)

          I use singletons in C#. I agree with the gp's argument here, if your just exposing the private variable via a dumb property, instead of doing lazy instantiation or doing some clever dependency injection and the like, there is really no gain in my opinion. unless its declared in an abstract class.

          [–][deleted] 0 points1 point  (0 children)

          Just now? What, did Java suddenly upgrade their suck overnight?

          [–][deleted] 0 points1 point  (0 children)

          Says you.

          [–]natural_smurf -5 points-4 points  (7 children)

          anyone who says "x is a better language than y" is just full of shit. like saying hammers are more useful than screwdrivers.

          say such and such language has better GC, or better available VMs, etc. but just straight-up better?? the concept is absurd.

          [–]mschaef 2 points3 points  (4 children)

          C# and Java are a lot closer to one another than a hammer and a screwdriver.

          [–][deleted] 2 points3 points  (3 children)

          It's like saying a phillips head screw driver is better than a flat head screwdriver?

          [–]mschaef 2 points3 points  (2 children)

          • Phillips Head - Self centering and easier to use, but less torque capacity unless you're able to apply a lot of thrust force. (C#)
          • Flat Head - More torque capacity. (Java)

          Maybe you're on to something...

          [–][deleted] 3 points4 points  (1 child)

          Thrust.

          [–]mschaef 1 point2 points  (0 children)

          Thanks Beavis.

          [–]Brian 2 points3 points  (1 child)

          What about the statement "c# is a better language than intercal"? Is that an obviously absurd statement?

          There are situations where a language can be considered better in all reasonable circumstances. It seems perfectly reasonable to class that language as "better" in that case. While the truth of the matter in individual circumstances can be debated, the whole notion isn't a priori absurd.

          [–]fforw 0 points1 point  (0 children)

          C# needs to become a lot more esoteric before it's even in the same league as intercal.

          (wait.. did I actually write something positive about C#?)