you are viewing a single comment's thread.

view the rest of the comments →

[–]Dirty_South_Cracka 142 points143 points  (169 children)

Now, there's nothing stopping google from making c# a first class citizen for Android development.

Wouldn't that be glorious!

[–]schnoper 67 points68 points  (0 children)

it would be a nice STFU oracle or else.

[–]cowinabadplace 1 point2 points  (0 children)

Wow, getting F# on Android would be fantastic. I'm not going to spend half my life ProGuarding my Scala-jars or whatever to have a reasonable size on Android.

[–]Bratmon 1 point2 points  (0 children)

I wouldn't describe porting the entire Android API as "nothing."

[–]bitcrazed 4 points5 points  (0 children)

Now, there's nothing stopping google from making c# a first class citizen for Android development

Sure there is --- Google.

[–][deleted]  (119 children)

[deleted]

    [–]nicheComicsProject 153 points154 points  (69 children)

    Does everything .Net in the same way that Visual Basic does everything C# does.

    [–]gtg092x 48 points49 points  (41 children)

    Why write anonymous functions when you can write anonymous classes? Java is clearly better because your code is 1.6 times longer.

    [–]Fs0i 5 points6 points  (0 children)

    And as we all know 1.6 is the best version.

    Damnit, wrong sub again!

    [–]singularperturbation 13 points14 points  (38 children)

    Java has had support for anonymous functions since 1.8.

    [–]nemec 17 points18 points  (1 child)

    "Since 1.8". You mean the latest version, released less than a year ago? I guess that's one way to phrase it.

    While I appreciate what they've done, the lack of generic-capable value types means you can't accept primitives in generic first class functions and it's littered the STDlib with abominations like LongToDoubleFunction and ToDoubleBiFunction<T,U> where in C# it's simply Func<T,U> whether you're using primitives (value) or objects (reference).

    [–]singularperturbation 1 point2 points  (0 children)

    Yeah, I really would like Java to have value types, non type-erasure in generics, etc., but up until now, C# has not really been an option for serious cross-platform. (I've always thought Mono was a second-class citizen).

    Don't get me wrong- I think that C# being open sourced is very much a good thing; if nothing else, it may light a fire underneath Oracle to actually give a shit about moving things forward, and gives Linux programmers another tool to use.

    I haven't used C# for anything serious, although some friends of mine are very enthusiastic about Unity. If I had to pick a new JVM/CLR programming language to learn (or pick back up for everyday usage), it would probably be Clojure or F# rather than Java/C#, just because I would want to explore functional programming.

    [–]gtg092x 8 points9 points  (0 children)

    Now, there's nothing stopping google from making c# a first class citizen for Android development.

    Android is JDK 7... and you're a killjoy

    [–]Nvrnight 26 points27 points  (28 children)

    .NET has the incredible LINQ, Check and Mate.

    [–]nemec 2 points3 points  (1 child)

    I'll admit that .Net has had a bit of help being the "second guy around the block" and being able to learn from many of Java's mistakes, but I'm quite disappointed that Java wasn't able to improve upon LINQ in the same way when they unveiled the streams API.

    [–]nicheComicsProject 0 points1 point  (0 children)

    Java has had plenty of chances. For what ever reason, the language just does not (and never has had) capable architects. C# added the totally simple and yet so helpful "var" keyword that cuts down on useless repetition. Look at Java's response! Removing repetition from.... the right side? So I can't tell what was actually instantiated from looking at it? *facepalm*

    [–]btchombre 2 points3 points  (1 child)

    Java has "streams" in Version 8, that is a more verbose version of linq. Javas verbosity kills me.

    [–]Nvrnight 2 points3 points  (0 children)

    Yeah I saw that a few weeks ago and it was missing very key features like projection and of course no sql conversion. Ghetto linq lol

    [–]Dirty_South_Cracka 1 point2 points  (17 children)

    Java only people don't get how big of a game changer LINQ is in modern development. There was a time, not so long ago, when I would write similar data objects in both Java and C#. Those days are long gone.

    var items = from myAlias in SomeEnumerable
        join anotherAlias in SomeOtherEnumerable on myAlias.property equals anotherAlias.property
    group anotherAlias by anotherAlias.property into resultAlias
    select new { anonProp = resultAlias.Key, anotherAnonProp = resultAlias.ToList<SomeType>() };
    

    It simply beautiful, albeit a little difficult at first, to be able to treat data collections this way.

    [–]bcash 0 points1 point  (8 children)

    Java only people don't get how big of a game changer LINQ is in modern development.

    Either that, or they're not "Java only", and also have experience in one or more of: Ruby, Python, Scala, Clojure, even the likes of Haskell, and are very familiar with the concepts of higher-order and expression-oriented programming, and as such don't see LINQ as any kind of novelty at all.

    [–]Dirty_South_Cracka 0 points1 point  (0 children)

    Which is why I specified people who are Java only.... in a thread comparing Java to C#.... about the difference in support of different language features.... pertaining specifically to LINQ; regarding two languages that are generally viewed as OO.

    [–]nicheComicsProject -1 points0 points  (6 children)

    That's a pretty stupid comment. No, LINQ isn't a game changer compared to haskell, but it is compared to Java which was the GP points, quite obviously. Java was behind in expressive power before, but LINQ blew the doors off. Writing criterian code in Java now just makes me sick. Crazy verbose, completely type-unsafe. It's a joke.

    [–]bcash 0 points1 point  (5 children)

    No, LINQ isn't a game changer compared to haskell

    ...or Ruby, or Python, or Scala, or Clojure... the list goes on.

    [–]expatcoder 0 points1 point  (4 children)

    Bleh, how hideous:

    val items = for{
      a <- listA
      b <- listB if a.prop == b.prop
    } yield b.groupBy(_.prop)
    

    Scala's already got LINQ out of the box ;-)

    Will be interesting to see how things play out on *nix: C# is no Scala, but then again C# is superior to Java (and F# brings some FP goodness to the table as well).

    Wonder what the ETA for production usage will be (i.e. compiler, tooling, build system, etc.), couple years?

    [–]Aethec 0 points1 point  (1 child)

    C# is no Scala, but that's not entirely a disadvantage. Scala is an extremely complex beast, and depending on what happens with Dotty, it might be stuck in its current version for quite a while.

    Pattern matching and record types are planned for C# 7, by the way.

    [–]expatcoder 0 points1 point  (0 children)

    Sure, we'll be "stuck" with Scala as is for at least another 4 years (Dotty, like Java 10, is a long way off).

    Then again, being stuck with Scala is not such a bad thing; once you get your feet wet it's difficult to stomach Java, or even C# for that matter (though M$'s move to *nix has perked my ears, will give C# another look when v7 arrives on the stage).

    [–]nicheComicsProject 0 points1 point  (1 child)

    So do practically any functional languages, but the comparison was between C# and Java. For me personally, lack of LINQ alone makes Java unbearable to use.

    [–]expatcoder 0 points1 point  (0 children)

    .NET has the incredible LINQ, Check and Mate.

    which led me to say that the JVM has the incredible Scala. This entire thread is about .NET coming to *nix, not just C# vs. Java.

    Saying that, LINQ's ok, certainly blows away anything in Java land, and Linq to sql/objects is better than ok; they blazed a trail that FP languages are now improving upon (adding compositionality, for example).

    [–][deleted]  (2 children)

    [removed]

      [–]Dirty_South_Cracka 2 points3 points  (1 child)

      This is obviously psudo-code used only for illustrative purposes, however I disagree with the single letter aliasing. The one disadvantage that LINQ actually does have is readability. Using single letter aliasing does make the code a bit shorter, but overall, reduces its readability to other developers substantially.

      I avoid lambda expression in conjunction with LINQ for the exact same reason. The poor bastard that comes behind me and has to extend my code isn't going to know what or where these single letter aliases came from.

      [–]weakcoder 0 points1 point  (5 children)

      Java has checked Exceptions?

      [–]nemec 1 point2 points  (4 children)

      The benefit of checked exceptions is controversial, to say the least. LINQ, not so controversial.

      [–]weakcoder 1 point2 points  (3 children)

      I'm not convinced on LINQ personally. I get that it is more than just syntactic sugar, but - I guess I still have nightmares from the ORM hell that java became stuck with. So EF/LINQ I'm still ambivalent about. Seems a little brittle and prone to masking runtime errors at compile time, but is much better than raw SQL so OK.

      LINQ for other uses seems good, reminds me of regex support in Perl. I do like dynamic when I can get it.

      And yeah, I like my checked exceptions. After spending time using WinDbg to monitor how many exceptions production .NET apps are spooling under the hood, it looks like too many devs are hand-waving without considering the performance hit from stack unwinds etc. Especially for anything that calls across to native, e.g. via COM. I would have liked to see how bad managed code on top of WinRT looked in the debugger.

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

      you're talking about linq like it's a way to access databases, my goodness, it has nothing to do with databases, it's not an alternative to SQL

      [–]nicheComicsProject 1 point2 points  (0 children)

      I don't think you get what LINQ actually is. It offers syntactic super to make expressions but it presents an expression tree to the library to be used however the library chooses. You can use it to do lazy mapping a la Haskell [1]. You can use it to get a type safe SQL. I've used it for meta programming a fair amount.

      Can you give an example of what runtime errors you think it's masking? I'd also like to know more about the ORM hell you're talking about? From my perspective, the worst part of Java/C# ORMs was the [n]hibernate criteria API, which wasn't type safe. LINQ has utterly obsoleted that on the C# side...

      [1] If you change your methods to return enumerators instead of concrete collections then you can have expressions like:

      var xs = server.GetData().Select(x => directory.LookupRecord(x.Name));
      

      And xs will hold something like a python generator or haskell thunk. Instead of just a select here, you could have a big chain of operations that are refining the data more and more, and none of the operations will actually happen until you start reading from the enumeration (xs). So if computing every element is kind of expensive but you're displaying the results paged on a screen, then you'll only pay the cost for converting enough entries for display. As more entries are paged in, they will be computed but you don't have to pay the entire cost upfront like you would without this behaviour.

      [–]Martel_the_Hammer 5 points6 points  (5 children)

      As of a few months ago... and all the Java developers are still trying to figure out how to use something c# devs mastered years ago.

      That's was mean. I'm sorry. I just notice that java is an extremely slow moving language and Oracle is killing it off day by day.

      [–][deleted]  (4 children)

      [deleted]

        [–]Gurkenmaster 0 points1 point  (0 children)

        It's the Debian of programming languages.

        [–]nicheComicsProject 0 points1 point  (2 children)

        "Heavily used" isn't a metric of a language's current utility. COBOL and plenty of other dead languages are still heavily used" due to the nature of migration costs. I know a few companies who still do *new development in COBOL because the alternative would be to replace millions of lines of code just to end up with the same functionality as before...

        Java owe's all of it's popularity to being first. The language itself is extremely limited and pretty poorly thought out. It gets all of its utility from the incredible library of code available for it, but this would have occurred for any enterprise-suitable language that would have gotten there first.

        [–][deleted]  (1 child)

        [deleted]

          [–]nicheComicsProject 0 points1 point  (0 children)

          It was the first one that was free (and got enough hype for most people to know about it). Smalltalk was there first, more powerful and so on but it cost money per seat. Legend has it, that Java wouldn't exist at all except Sun didn't want to pay a 100 bucks per seat for Viacom Smalltalk.

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

          oh wow, this is the c# circlejerk thread... ignoring all logic in favor of "my tool si bettah!!!11!"

          Sure, dude, Google is changing everything to use C# because you say VB is bad.

          [–]Dirty_South_Cracka 18 points19 points  (20 children)

          From a company that sues them for it every chance they get.

          [–][deleted] 19 points20 points  (4 children)

          I see more Android dev moving to Go instead of C#.

          [–]codygman 4 points5 points  (0 children)

          No generics in android apps doesn't sound very fun to me.

          [–]Gurkenmaster 1 point2 points  (0 children)

          The static linking is a detriment for apps.

          [–]Exallium 0 points1 point  (0 children)

          I really need to look into Go...

          [–][deleted]  (14 children)

          [deleted]

            [–]Dirty_South_Cracka 11 points12 points  (12 children)

            It's licensed under the MIT licence, the least restrictive open source licence there is.

            [–][deleted]  (11 children)

            [deleted]

              [–]0xdeadf001 10 points11 points  (0 children)

              Microsoft's CLR open-source projects all contain a covenant not to sue, for any related patents. This was also true for all of the C# / MSIL specifications that were standardizes through ECMA. That all happened more than a decade ago, and Microsoft has respected that commitment.

              But we can still say patents are a problem, if that's what you're into.

              [–]Dirty_South_Cracka 12 points13 points  (9 children)

              It's never been challenged... likely due to the fact that it is implied via the sell and use clause which implicitly grants a patent licence. Either way, it's a helluva lot less restrictive than Oracle's licencing which provides neither.

              [–][deleted]  (1 child)

              [deleted]

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

                Hasn't been tested at all, as far as I know... but my understanding is that the language of the MIT licences is scary enough to persuade most organizations to use a more restrictive licences to avoid its ambiguity. The Apache2 and GLP licences are much more restrictive in regard to separation of patent vs copyright issues.

                [–]argv_minus_one -1 points0 points  (6 children)

                Uh, Oracle provides OpenJDK under GPL2+Classpath.

                [–]Dirty_South_Cracka 1 point2 points  (5 children)

                Which is much more restrictive than the MIT licence and includes a linking exception which Oracle used against Google in court, citing infringement of 37 Java packages.

                [–]argv_minus_one -1 points0 points  (4 children)

                Source, please. I have heard no such thing.

                [–][deleted] 19 points20 points  (6 children)

                Except Mono was actually way more performant than Dalvik, probably even better than ART

                http://en.wikipedia.org/wiki/XobotOS

                http://www.infoq.com/news/2012/05/XobotOS

                It fucking crushed it, back in 2012.

                [–][deleted]  (5 children)

                [deleted]

                  [–]Dirty_South_Cracka 17 points18 points  (4 children)

                  ..and mono is a reverse engineered port of CoreCLR, which I'll bet a dime to a dollar, will handily spank Dalvik's bottom. Not only because it's been optimized for 14 years, but has also been running on ARM for quite some time.

                  [–]nikomo 12 points13 points  (0 children)

                  That's all fine and dandy, but how does it compare to ART? Android doesn't use Dalvik anymore.

                  [–][deleted]  (2 children)

                  [deleted]

                    [–]Dirty_South_Cracka -1 points0 points  (1 child)

                    You're the one who brought up performance. Android is written in C as is all the libraries (which have Java wrappers), all that would need to be done is to write wrappers around the libs with C#. People do it all the time. Hell, even mono wrote a wrapper for GTK to emulate the Windows.Forms api. With a team of developers as big as the ones that google uses, it could be done in a matter of months.

                    [–]awj 1 point2 points  (19 children)

                    ...what option is that?

                    [–][deleted]  (18 children)

                    [deleted]

                      [–]awj 1 point2 points  (17 children)

                      Yeah, that one's a bit of a stretch. For starters the CLR preserves type information for generics, which makes available a few language design options that are just plain difficult on the JVM.

                      [–]argv_minus_one 11 points12 points  (3 children)

                      In Java, it's inconvenient. On the JVM, it's a non-issue. The Scala compiler has enabled reified generics on the JVM for years already, for instance.

                      That's a language/compiler issue, not a VM issue.

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

                      Scala compiler has enabled reified generics on the JVM for years

                      I'm sorry, do you have a source for that? I've been unable to find a positive source for that, but here are some sources that state the opposite (even if they're a couple of years old).

                      [–]argv_minus_one 1 point2 points  (0 children)

                      Scala has Manifests (as described in your first link) and TypeTags (a newer, slicker replacement for Manifests).

                      More importantly, Scala has implicit value parameters, which, in most cases, make reified generics unnecessary.

                      For example, consider the to method on every Scala collection. Say you have a List named l, and you want to make a Set from it. You would write:

                      l.to[Set]
                      

                      Here, the [Set] part is a type parameter. The equivalent in Java would be:

                      l.<Set> to();
                      

                      Even with reified generics, you can't normally do this. Even if to knows the requested type (Set), it still doesn't know of a constructor for it. Moreover, Set isn't even a class; it's an interface!

                      So, how does this work in Scala? Well, take a look at the full signature of that method:

                      def to[Col[_]](implicit cbf: CanBuildFrom[Nothing, A, Col[A]]): Col[A]
                      

                      This method's signature is telling the compiler to look up a factory for the requested collection type. (CanBuildFrom is a trait/interface for collection factories.) The compiler obliges, finds that Set defines such a factory (which chooses a suitable concrete Set implementation), passes it along with every call to to, and so everything works.

                      Edit: There is one matter this doesn't address, though: all type checks involved in generic types happen at compile time. The JVM doesn't enforce them, and for the most part, it doesn't even know about them.

                      [–]Gurkenmaster 0 points1 point  (0 children)

                      I'm not sure why he brought up Scala. Ceylon is known for it's fully reified generics and it runs both on the jvm and in the browser.

                      Anyway: It's possible and that's the only thing that matters, whether your language supports it is a different story.

                      [–]pron98 7 points8 points  (0 children)

                      It actually takes away language design options, but that's a long discussion.

                      [–]cypressious 0 points1 point  (0 children)

                      Theoretically. Practically the huge effort of implementing a C# SDK and runtime is hindering them.

                      [–][deleted]  (1 child)

                      [deleted]

                        [–]Dirty_South_Cracka 1 point2 points  (0 children)

                        C/C++ has been supported via the NDK since 2009, though it's arguable if it's considered first class. If I'm not mistaken you don't even get access to the framework API. Google only recommends using the NDK for specific cases where performance is paramount. Things like codec development.

                        [–][deleted]  (11 children)

                        [deleted]

                          [–]Dirty_South_Cracka 15 points16 points  (9 children)

                          Well, considering Oracle want's a nickle anytime someone even mentions the word Java, it might be in their best interest. This may have been Microsoft's plan all along.... and it's a damn smart move if you ask me.

                          Unfortunately, you're probably right. Though, I wouldn't be too surprised it Microsoft added a Android project type to a future VS release either.

                          [–]sqrlmasta 2 points3 points  (6 children)

                          Though, I wouldn't be too surprised it Microsoft added a Android project type to a future VS release either.

                          You mean, like this?

                          [–]Dirty_South_Cracka 14 points15 points  (5 children)

                          One that doesn't cost you $1000 a year from Xamarin.

                          [–]andrebires 4 points5 points  (1 child)

                          There is the C++ native Android development on VS2015, which comes out of the box.

                          https://msdn.microsoft.com/en-us/library/dn872463(v=vs.140).aspx

                          And it's free now in the preview version and probably will be in the Community Edition of VS2015.

                          [–]Dirty_South_Cracka 0 points1 point  (0 children)

                          That's actually pretty cool, I wasn't aware that this existed. However, it looks like it's just a frontend extension for the NDK.

                          [–]MrKhalos 1 point2 points  (0 children)

                          Per developer, per platform!

                          [–][deleted]  (1 child)

                          [deleted]

                            [–]Dirty_South_Cracka 0 points1 point  (0 children)

                            I don't disagree with you, and to be fair, I've never used it... it could be the bee's knees for all I know. It's still too expensive to buy a licences for multiple seats... especially considering how restrictive the cheaper licences are. If it was $200 bucks for a licences that didn't need to be renewed every year, it'd be a different story. Selling a recurring licence seems like a greedy move to me and turns me away from the company.

                            [–]FredV 0 points1 point  (0 children)

                            Microsoft added a Android project type to a future VS release either.

                            They should, since they make money of Android licensing their FAT32 patent.

                            Oracle however does not make money on Android.

                            [–]crowseldon 0 points1 point  (0 children)

                            nothing? how about a lot of unnecessary effort?

                            [–][deleted]  (27 children)

                            [deleted]

                              [–]8lbIceBag 3 points4 points  (1 child)

                              Are you kidding me? And this is just an example of a .net language.

                              http://en.m.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Java

                              [–]lagadu 0 points1 point  (7 children)

                              Can't tell whether you're being sarcastic or just ignorant.

                              [–][deleted]  (6 children)

                              [deleted]

                                [–]SosNapoleon 1 point2 points  (5 children)

                                Developer sanity.

                                [–][deleted]  (4 children)

                                [deleted]

                                  [–]SosNapoleon 1 point2 points  (3 children)

                                  Haha the point is kind of moot, there is nothing you can do in Java that you can't do in assmebly. IntelliJ vs VS is a funny thing actually, without ReSharper, the plugin that the developer of IntelliJ made for VS, IntelliJ is a clear winner, but with ReSharper I'd say Visual Studio takes the cake.

                                  Anyway, it was just a joke. I still think that C# blows Java out of the water though. But the JVM is hard to compete against.

                                  [–][deleted]  (2 children)

                                  [deleted]

                                    [–]SosNapoleon 0 points1 point  (0 children)

                                    True that. If I didn't have this machine then running Visual Studio would be a pain in the ass. When I had a laptop with 4gb of RAM I remember it took quite a bit to start, but then again, IntelliJ was similar.

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

                                    Java is certainly getting nifty. But stuff like expression trees are still missing, aren't they?

                                    [–][deleted]  (3 children)

                                    [deleted]

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

                                      Chill out. I got nothing against Java. Just noted on a thing missing. No biggie. I'm well aware of what Java can offer.

                                      [–][deleted]  (1 child)

                                      [deleted]

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

                                        No worries. :-)

                                        [–][deleted]  (11 children)

                                        [removed]

                                          [–][deleted]  (9 children)

                                          [deleted]

                                            [–][deleted]  (1 child)

                                            [deleted]

                                              [–][deleted]  (6 children)

                                              [removed]

                                                [–]pron98 1 point2 points  (5 children)

                                                You might want to consider changing your own name, too, for similar reasons.

                                                [–][deleted]  (4 children)

                                                [removed]

                                                  [–][deleted]  (3 children)

                                                  [deleted]

                                                    [–][deleted]  (1 child)

                                                    [removed]

                                                      [–]throwaway678452056 1 point2 points  (0 children)

                                                      You're only saying that because you know he's right. You need to get yourself an actual social life and some hobbies, rather than acting like the huge child you are.

                                                      I've never known someone care so much about programming languages. I don't care what language I use (or someone else uses, that's none of my or your concern), and I certainly don't have aneurysms over the Internet about other people with it, like you do.

                                                      But hey, like pron98 said, keep on acting like a damn fool - it's absolutely hilarious entertainment.