5 ms·
I agree that Google should add more languages to android. And while Scala is a great language, it's very complex - so it won't benefit many of the less skilled
by pinkyand 12y ago
I agree that Google should add more languages to android. And while Scala is a great language, it's very complex - so it won't benefit many of the less skilled users.
A better language would be something with the simplicity and power of python, but with good performance.Groovy could be one such language.
- blablabla123 12y agoIt would be a mass experiment on Functional Programming acceptance ;)
- MichaelGG 12y agoConsidering that Visual Basic has monads, and lots of C# developers are regularly using closures, I think the response to "is FP accepted" is a resounding yes. Although .NET had to sort of smuggle those features in, under cover.
- phatak-dev 12y agoScala is not complex in terms of the language design. Most of features [or complexity] come from the libraries.
- taeric 12y agoThat doesn't do much to make it a great choice, though. In particular, Scala can be a fair bit trickier in terms of knowing your memory profile. Though, I doubt it is much worse than Java these days.
- nvarsj 12y agoImplicits? Compared to Java, Scala is not a simple language. I'd say Scala's complexity is on the order of Haskell + Java syntax with additional glue on top of that. Not to say this is bad, it just means you need greater discipline when writing software in Scala. A bit like C++ (yes, I went there! :-)).
- zak_mc_kracken 12y agoI'd say this makes Scala slightly more complex than C++ and Ada. Java and Haskell are not in the same league when it comes to complexity (Java because it's simple, Haskell, because it's wickedly well designed so its complexity is completely tractable).
- frowaway001 12y agoThe great thing is that as soon as people mention C++, it's immediately clear that this person has not a single clue what he/she is talking about.
- zak_mc_kracken 12y agoNot true, the mix of functional and OO features make the language complex even without the libraries. Throw in implicits, higher kinds, pattern matching, a fairly good generic type system, support for all kinds of polymorphisms (subtyping, ad hoc, duck typing), etc... and you can see complexity emerge pretty quickly.
- broodbucket 12y agoJust because Scala has features that are tricky to get your head around if you're not familiar with functional programming, it doesn't mean it's complex to write software in. You can write Scala that's basically Java with less syntax if you want. I think that's what's so great about Scala, Python and other languages that mix OO and functional elements; you don't have to throw away Java and pick up Haskell, you can start experimenting with other styles as you go.
- TeeWEE 12y agoIt still doesnt change the fact that Scala, as a programming language, tries to incorporate too many concepts while still trying to be typesafe. This makes the language complex, and not an ideal candidate.
- benburton 12y agoThere's no substantiative argument in this comment. > Scala, as a programming language, tries to incorporate too many concepts Too many concepts? Says who? How many concepts is too many? You don't have to use them all, and you can pick them up fairly easily as you go along; that's exactly how I learned the language. > while still trying to be typesafe. Not sure why that's contentious. > This makes the language complex, and not an ideal candidate. Says who? Why? Should all complex things be abandoned? I find the Android framework itself complex, personally, so should we throw that out? This is the same Scala FUD that's always prevalent on Hacker News. "The language does too much." So what? You don't need to know all the concepts to be proficient. The language's beauty is that you can write simple code and pick up the concepts as you go along. Library modularity generally means that you don't need to get into the deep end of the language unless you want to. Scala is an expressive language. That's an intentional design decision that makes it flexible. It is not a drawback. It does not make it overcomplicated for a beginner.
- apendleton 12y ago> Says who? Says at least me and the OP, and probably others... I haven't put a ton of time into learning Scala and only occasionally interact with it, but in that capacity I'd definitely say I find it a bit intimidating and someone hard to read. Certainly there are many ways to write Scala, and a Java-like style is doable, but idiomatic Scala, as far as I've seen, encourages terseness and the use of opaque punctuation-laden operators that aren't immediately interpretable by people not familiar with the language. Whether legibility from non-experts is important is absolutely a matter of opinion and personal taste (it's a clear source of disagreement between the Python and Ruby communities as well), but if you're someone who thinks it's an important property for languages that get widespread adoption to have (and I am), looking at Scala code as it seems to typically be written would give you (or at least gives me) pause. I can look at Swift without having ever written any and know roughly what it's doing. I can't with Scala. I don't think they fill the same niche, as the poster seems to be advocating that they could.
- lmm 12y agoGroovy's founder has said that he wouldn't have bothered creating it if he'd known about Scala at the time. In Scala you can write almost the same code as Groovy, word for word - but you don't have to give up compile-time type safety for it. (Of course you can do more complex things in Scala, taking advantage of the powerful type system. But you don't have to if you don't want to)
- divideby0 12y agoGroovy has supported compile-time safety since version 2.0 with the optional @CompileStatic annotation. It's one of the few languages where you can mix static and dynamic typing, even within the same class. With this annotation enabled, you get pretty close to pure Java performance but with 1/5 the lines of code in some case. For something like Android, running Groovy with CompileStatic enabled by default would make a lot of sense.
- vorg 12y ago> It's one of the few languages where you can mix static and dynamic typing In theory, but in practise virtually everyone uses the dynamic typing only. Groovy's really only used with Grails and for testing Java classes. > Android, running Groovy with CompileStatic enabled by default would make a lot of sense Unlike other statically-typed languages, Groovy's CompileStatic code was written by only one person and having it be the default would expose all the bugs.
- pinkyand 12y ago> but in practise virtually everyone uses the dynamic typing only. Why ? is it a social thing? or a technical thing?
- tormeh 12y agoAny optional and inconvenient feature in a programming language will never be used. It's why static typechecking in Python and Pypy and whatever will never take off.
- vorg 12y ago> Groovy could be one such language Android needs a statically typed language, but Groovy's dynamically typed, and the statically typed portions available via annotations since version 2.0 isn't really used much. Groovy's still usable for its original use case of manipulating and testing Java objects, and with Grails, but the more recently promoted stuff isn't being used in favor of other options, and even Gradle seems to have been totally rewritten in Java for Gradle 2.0. I suspect Gradle will soon open its configuration as an API so any language can be used with it.
- thawkins 12y agoGo would make a good candidate, given that it is also a google project.