Notes on Life, ‘Puters and Hawaii

Scala is a Ghetto

I took it on myself to try to learn Scala.  Scala is an “experiment” in programming languages and feels pretty academic in that it takes features from a dozen other languages and attempts a mash-up of OO and Functional programming.  The learning curve is fairly steep for a programming language and it totally has that look-at-us-we’re-blazing-a-new-trail academia feel to it when you watch IRC and read the mailing list.  It feels tailor-made for academics - they even have a special “scala-debates” mail-list separate from their normal users or developers mail-list.  Although the language itself has features that are interesting, the syntax is verbose, ugly and robotic.  Even their website looks like they pulled it out of the way-back machine in the year 1996 and designed it for the “Mosaic” browser.  No eye for aesthetics or elegance.  But like taking vitamins, I studied it anyway because it’s “good for me.”

Then I started lurking on #scala on IRC for a few weeks.  Immediately I was surprised by the snarky comments of some of the top chatters on IRC.  Mostly it was a negative comment about this person or a snide remark about that language.  At one point I got into an argument with a couple guys after I mentioned that I use ruby & jruby as my staple language at the moment.  The closed mindedness and arrogance was amazing coming out of the chat.  I would guess that’s typical of religious monoglot language zealots.  Whatever.

So with that 1st “ruby sucks” language argument experience on IRC in the back of my mind, the day before yesterday someone asked a simple question which I attempted to answer (also on IRC).  I didn’t get half my Scala solution out of my mouth before 8 people jumped in with other comments and heckling.  It’s like a pack of wolves.  Then I said something incorrect (so did others too though if you check the log) and got the %!@# kicked out of me verbally because I wanted to debate about it.  After I was told I “blend into the sea of idiocy” and “you don’t know &@#$” and “shut up” - by one of the same arrogant %@#s that slammed ruby and java before, I swore back and got kicked out.  :)  Because of the swearing, the argument spilled out onto blog posts.  ( I did post the scala code to my solution - it works. )

The scala nerds did what most academics do - they went off and did an extensive review of the underpinnings of the VM, wrote experimental code to support their position and wrote some papers (well blog posts)  - probably because they don’t have billable jobs and are hanging around in class and would be playing Werewolf or WoW otherwise.  Two days later, there were 3 or 4 blog posts coming off that argument and all the scala nerds lining up to snicker and poke and add their $0.02.  That’s great.  I even had one  scala fanboy email me 7 times to give me his random opinion about reading about the argument (wtf?).

My bad behavior (and others) aside, it appears that the culture is one where newcomers are only tolerated if they already have the language mastered and keep quiet.  I felt like Zed Shaw there for a moment and wanted to reach over the internet and pimp-slap that guy.  Really abrasive.  No thanks.

So studying the language wasn’t a waste.   It’s always good to learn.  But there are plenty of good languages out there with non-attack-shark communities.  Time will tell (Scala is something like 5 years old already and lots of people haven’t even heard of it - even some entire user groups haven’t heard of it).  I would bet my money on Scala being obscure or even dead in 5 years - something along the lines of the numbers of paying jobs for Lisp, Haskell, ML and the like.  99% academic coding.  There’s little to no scala work out there even for a Java developer with a dozen years experience who just learned scala.  You would literally have to start your own company and pay through the nose for a couple good scala devs if you wanted to work with scala outside open-source.  Or better yet - work in an academic setting where you can twiddle bits all day and debate everyone to show how smart you are.

If I actually want to get something done on a team and do it today, (J)/Ruby, Java and Erlang are all I need at the moment, although in my past I have studied assembly, C, C++, Pascal, Lisp and other dabblings which I no longer use or remember all that well.

Notice that comments aren’t enabled, Scala nerds.  Go comment somewhere else.

Update: Aparently this made it’s way to DZone (Java/Scala heavy blog site for devs) where I got trashed some more.  :)

Here is the code which demonstrates what I was trying to say which is that equals and hashCode are over-ridden together according to the javadoc and that by over-riding the equal method that you can determine BOTH when an object is the same content and same reference at will.

// The following doesn't work - same as Java
class Demo(x: String) {}
new Demo("fail!") == new Demo("fail!")
new Demo("fail!").equals(new Demo("fail!"))
new Demo("fail!") eq new Demo("fail!")

// However, over-ride some methods just like I said and
// you have everything you need to discover any equality
class Demo(x: String) {
  val contents = x
  override def hashCode : Int = { contents.hashCode(); }
  override def equals(other: Any) = other match {
    case that: Demo => this.contents.equals(that.contents)
    case _ => false
  }
}
// oh what do you know they are equal ->
new Demo("ftw!") == new Demo("ftw!")
new Demo("ftw!").equals(new Demo("ftw!"))
// and their hash codes are the same
// but that's not what makes them equal - it's just following the javadoc like I said
new Demo("ftw!").hashCode() + "|" + new Demo("ftw!").hashCode()
// nope they aren't the same instance ->
new Demo("ftw!") eq new Demo("ftw!")

More proof that scala devs think they are the ultimate -> james iry blogs about doing lambda in java using anonymous classes but then the discussion in the chat he calls java and perl devs “blue collar”

Comments are closed.