Skip to content

MattHicks.com

Programming on the Edge

Menu
Menu

Why Scala is AWESOME

Posted on September 24, 2008 by mhicks

Many people refer to me as a Java evangelist, Java super-freak, and many other terms that tend to suggest that any language other than Java is outside of the realm of consideration. Though true that I do my fair share of bashing of languages like Ruby or Groovy, it is because I really have longed for a new language to come out that is better than Java. I’ve been programming in Java for several years and though I love the language there are many flaws that don’t seem to be getting fixed any time soon. I know no language is perfect, but of the options I’ve always felt Java comes the closest.

When I first learned about Scala I shrugged it off as another crappy scripting language, but recently it has been brought back to my attention when I realized that it’s not a scripting language at all, but a fully language that gets compiled into byte-code the same way Java does. In fact, it gets compiled into byte-code that shares space with Java. For a Java developer this is quite appealing to be able to use a new language yet still make use of all my old APIs and conventions.

There are several amazing things about Scala that seem to pick up where Java falls short and runs with it. I will do my best to outline these features here as I’m learning the language to helpfully show these points to others and also for later reference for myself.

  1. Everything is an Object – This is particularly awesome in it gives true delegate support, something Java has been lacking forever. I can pass around methods as parameters and so much more.
  2. Native Support for XML – Though the ramifications of this feature can be some ugly code, when you want to work with XML in your applications being able to simply create a variable and reference direct XML without having to wrap it into a String it can be very helpful. This not only provides creation-time validation, but keeps you from having to escape quotes and nasty multi-line concatenation if you tried to do the same thing with a String. More useful than anything I think is the direct support to query data back out of XML.
  3. Overriding Operators – Reference back to point #1. Since everything is an Object even addition and subtraction is working with Objects. In Scala they have this cool idea to provide another syntax for making calls. For example, classically you would make a call to a method like:

    myObject.doSomething(“somevalue”)

    However, in Scala you can also call the same thing like this:

    myObject doSomething “somevalue”

    My first thought when I saw this is more shock than awe. One of my biggest concerns as a developer is the open-ended structure in languages that allow programmers that are either new to programming or lack the common sense to write sensible code to exploit open-ended structure to do evil things to make their code completely unreadable. However, when I realized their purpose in doing this, the awe finally set in. Since a number is also an Object when I say:

    3 + 5

    That is the same as writing:

    3.+(5)

    This means that + is actually a method that can be implemented so I can write pretty code to add two Objects together to a result.

1 thought on “Why Scala is AWESOME”

  1. themathmagician says:
    January 3, 2009 at 11:02 am

    I am happy to agree with you 🙂

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Courio: E-Mail 2.0
  • Scribe 2.0: Fastest JVM Logger in the World!
  • Logging Performance
  • Publicity in Open-Source
  • Play Framework for Scala: An Evaluation

Recent Comments

  1. Luke Hutchison on Multithreaded Unzip?
  2. Luke Hutchison on Multithreaded Unzip?
  3. Unknown on Multithreaded Unzip?
  4. D L on Multithreaded Unzip?
  5. Matt Hicks on Multithreaded Unzip?

Archives

  • March 2019
  • February 2018
  • January 2017
  • June 2016
  • July 2015
  • February 2015
  • December 2014
  • September 2013
  • March 2013
  • February 2013
  • January 2013
  • November 2011
  • December 2010
  • October 2010
  • July 2010
  • June 2010
  • May 2010
  • October 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • March 2009
  • February 2009
  • September 2008
  • July 2008
  • May 2008
  • March 2008
  • January 2008
  • December 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007

Categories

  • adobe
  • android
  • apple
  • beans
  • benchmark
  • challenge
  • chat
  • comparison
  • courio
  • eclipse
  • example
  • flex
  • framework
  • games
  • hacks
  • helios
  • html
  • hyperscala
  • ios
  • java
  • javafx
  • javascript
  • jcommon
  • jgn
  • jmc
  • jseamless
  • jug
  • kickstarter
  • learning
  • linux
  • log4j
  • logging
  • mac
  • media
  • mediacenter
  • methodology
  • mobile
  • mythtv
  • nabo
  • open-source
  • opengl
  • opinion
  • personal
  • playframework
  • pojo
  • programming
  • publicity
  • rant
  • raspberrypi
  • review
  • scala
  • scribe
  • script
  • sgine
  • social
  • sudoku
  • sun
  • swing
  • tutorial
  • Uncategorized
  • webframework
  • website
  • windows
  • xjava
© 2025 MattHicks.com | Powered by Minimalist Blog WordPress Theme