On Sun, Aug 29, 2010 at 12:50 PM, Josh Berry <[email protected]> wrote:
> <snip/> > >> >> Saying that Kojo teaches you Scala is like saying that programming in Java >> teaches you C++ because the JVM is written in C++. >> > > Excepting that they can actually use Scala. Kojo is essentially a > magnificently done Scala REPL with some imports, no? (Maybe I'm entirely > off on this.) > > Yes, it is a magnificently done REPL, implying that I could use full Scala syntax in KOJO (but possibly at the expense of some of the graphical integration features). So you could start with the logo DSL and jump into Scala syntax once the kids were ready for it. Therefore the proof-by-analogy of Java teaching you C++ fails. You cannot write C++ directly inside Java. However, Kojo is still Scala, therefore you can write Scala inside "Kojo" (it uses Scala's REPL, not its own implementation which I think is Beust's misconception). The other side to this is that I could pull Kojo into any Scala project I wanted to, if I really felt like some good turtle graphics were needed. Once again, I think little is gained arguing this point. Beust is obviously against Scala. Reading his blogs, he has some complaints (implicits particularly) that may or may not be justified. We can argue complexity all we like here, but let's stop focusing on periphery items and focus on the meat of the complaints. * Scala has implicits. O NOES C++! In C++ those lead to lots of needless memcopy and stack allocations and poor programmers doing all sorts of evil. I'm not so certain these objection hold up in Scala as it has static types. Haskell also has implicit style magic with type classes, and it seems to have done them well. Time will tell in Scala. * Scala has an advanced type system O NOES HASKELL! -> Scala's type system is more powerful than Java's, but at the same time, Java's type system is possible harder to work with if you want to write generic functions. It appears to focus on making collections easy, but just wait until Java 7 has closures. Then you'll see the downsides to how Java handles variance. * Scala allows you to drop syntax, making two expressions equivalent. O NOES PERL! While there is a dannger of making things so terse it takes a long time to parse what a function is performing, it also allows most code to become less verbose while still 100% readable. Part of readability is understanding how a language works, so of course coming from Java to Scala one would think it an unreadable mess of gunk. You would think the same if you went to Haskell, F# or even Ruby (I know I did). Unfortunately, this means the true judges of readability are those proficient in a language. Therefore I think it's pretty futile to make arguments form either side here. * Scala is for academics. O NOES ML! The implicit argument here is that either A) I (The average Java user) am too stupid to use Scala. I don't think any of us are implying this so it could be B) I can code much easier in Java and keep my productivity high. It takes me a lot longer to think through a solution in Scala or read through a solution in Scala. Well the, continue to code in Java. I think it was about month 3 for me when my abilities to write Scala had gotten to the point where I could more efficiently write/read Scala than Java. However in a large project with a lot of junk tacked on it (like Spring, Aspects, J2EE or whatever other frameworks you use) this point may never be realised. Also note that Scala is not really for academics, as some view the innovations in Scala as being purely pragmatic extensions of what they've already accomplished in ML. In any case, all these complaints are justified. While I believe that Scala will shine through, it still has some issues to work with regarding each of these points. Implicits are ever evolving, with a change to how they resolve in 2.8.0 and I think we've yet to see them completely stabilize (although I don't see massive change to their structure in any future). I also know Implicits have a few issues around them that I'm actively trying to help solve. As for the rest, well, let's see how long this thread will really get. -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
