4 ms·
It seems to me that what you want is a CoffeeScript for JVM, a language that is much more expressive and concise and at the same time can compile to JVM and uti
by cygwin98 13y ago
It seems to me that what you want is a CoffeeScript for JVM, a language that is much more expressive and concise and at the same time can compile to JVM and utilize the aplenty Java libraries.
Like CoffeeScript, this language should mainly follow OOP paradigm, while allows certain kinds of FP features, such as first class functions, seq, etc. Immutability is not forced. Basically, a Scala-minus -- Scala without Haskell stuffs, and much reduced FP features.
- deleted 13y ago[deleted]
- eranation 13y agoThis sounds basically like Xtend: http://www.eclipse.org/xtend/documentation.html http://www.eclipse.org/xtend/documentation.html However, I got screwed, I now LIKE my OP / FP mishmash. Perhaps the OP is right, but too late for me, I can't work with any other language now. Haskell is too pure FP, Go doesn't have pattern matching, JavaScript is not typed (perhaps a JVM TypeScript is my ideal solution? or perhaps it's Dart?) same with Ruby and Python I'm stuck with Scala. p.s. if C# was on the JVM I would consider it as well. I'm going to give Kotlin another look though...
- cygwin98 13y agoI think we share a similar background. I was coming from Ruby on Rails and C# background, and now am spreading into JVM via Clojure. Before C#, I did everything in C++, which I don't like. The past few years has seen a turmoil of battles on the web frontend, which caused a huge number of churning without much progress technically, totally waste of time and efforts in the web community. Now, it seems to me that that turmoil is inching into the backend and JVM. A wrong selection of technology stack would cause a huge waste of time investment. That's why some of us stand up and say no to Scala, which has been aggressively marketed as Java++ for the past few years, and seems to gain some momentum. I personally consider that's a dangerous sign, as the objective of Scala (IMHO) is to replace Java as the mainstream industry language. With the complexity of Scala, can you imagine the average Java programmer starts to write libraries in Scala? That would be disastrous to the whole JVM eco system. We all know what happened to C++. I personally would go with Clojure, which is at least philosophically coherent. I feel comfortable working in it. Even it may not become mainstream, I am OK with that. Life is short, be happy.
- eranation 13y agoWell we do share the C# background, but I lastly used C# about 8 years ago, a lot has changed. As much as I would love to have a Ruby background, Ruby (mostly on Rails) for me is a hobby language / framework, can't use it at work, sadly. I actually come from 10 years of writing mostly Java and JavaScript. I (used to) like Java, but I will replace both Java and JavaScript with Scala in any of my new projects without hesitation. Including taking into account on-boarding new team members, including taking into account how complex people can get with Scala, trust me, bad developers make spaghetti from anything, Java included, and spaghetti is not the worse thing, bad buggy code is. you'll be shocked how many Java developers don't know the contract between hashCode and equals in Java. in Scala, if you use a case class (or data class in Kotlin) you get default equals and hashCode for you, so for you little DTO bean, you'll avoid having duplicates in a set (very common Java newbie bug). Also I tend to find that huge amount of Java bugs end up having the same 2-3 exceptions - and most notoriously the NullPointerException. With Scala options, it's diminished significantly. p.s. I did some college projects with C++, and can read it but I can't really understand the comparison to Scala, really. So I personally won't be worried about Scala replacing Java mainstream industry world. 1) it will take a lot of time for it to happen even if HN was full of ("Scala is even better than Go / Haskell / Clojure, my eyes are opened!" 2) even if it does, I am (very subjectively) about 10X more productive with it, and write / read code much more easily with it than with the same code written in Java, but this is only because me and my team constrain ourselves to avoid abusing the language. E.g. there is nothing wrong with if(option.isDefined) if you don't like pattern matching. or using dot notation and avoiding infix notation when not really needed. I also don't care about using vars, or using while loops when it's more readable, I always provide a named function to my operators, and only use implicit conversions when it really needed and helps code readability (for example to use it for actual CONVERSIONS and avoid method overloading hell and not just to pimp a library) I also avoid one liner terse code that no one can read (or debug) and the end result is 10X more happiness, productivity and fun than with boring old Java. I also use it with Spring, Java EE and Maven instead of sbt. Scala if used this way, is indeed a better Java. But it needs guidance, so perhaps it indeed needs a "the good parts" book / style guide / Linter p.s. If you spent some time to learn Scala and tried it on a project, and still prefer using Clojure, I'll believe you. if you say you prefer Scala over Java, I will force myself to respect you and avoid being accused of an ad hominem attack :)