Getting new developers into Scala

7 views
Skip to first unread message

Zach Cox

unread,
Nov 3, 2010, 3:41:53 PM11/3/10
to Iowa Scala Enthusiasts
I'm curious how you have introduced Scala to developers who have never
used it, and gotten them interested in it & up to speed. Do you just
throw a Scala book or two at them? Have a favorite tutorial blog post
or video you make them watch? I'd like to find something that really
whets the appetite, impresses the developer and leaves them excited &
wanting to learn more about Scala.

metzben

unread,
Nov 4, 2010, 5:02:03 PM11/4/10
to Iowa Scala Enthusiasts
[I have 2 answers: How I got hooked. And what I'm seeing as others
already here and new hires start learning Scala]

Speaking for myself: About 7-8ish months ago, Wade sent me the link
to akka http://akkasource.org/. I'd never seen or heard of Scala
before. He then sent me a link to the ChatServer Tutorial.
http://doc.akkasource.org/tutorial-chat-server-scala
And that's what hooked me... initially it really didn't have much to
do with the akka lib, it was the expressiveness of Scala in that
tutorial as I kept thinking about how I would do it in java/c#.

I read this
==================================================
trait ChatServer extends Actor {
self.faultHandler = Some(OneForOneStrategy(5, 5000))
self.trapExit = List(classOf[Exception])

val storage: ActorRef

log.info("Chat server is starting up...")

// actor message handler
def receive = sessionManagement orElse chatManagement

// abstract methods to be defined somewhere else
protected def chatManagement: Receive
protected def sessionManagement: Receive
protected def shutdownSessions: Unit
==================================================
Kept reading and saw the implementation for
chatManagement/sessionManagement/shutdownSessions provided
via other traits. And then at the end I saw this...
==================================================
class ChatService extends
ChatServer with
SessionManagement with
ChatManagement with
RedisChatStorageFactory
==================================================
Wow... What I was seeing was the use of partial function chaining
(orElse) with Abstract members where the implementation of those
partial functions was wired up in the ChatService via Mixin
Composition. I was seeing that mix of OO/FP. Partial functions,
pattern matching and a better model than C#/Java inheritance via
Traits. If you've ever tried to build a large system with a massive
Domain Model and struggled/fought with traditional inheritance and OO
then you see Scala and you freak, at least thats what happened for me.
The second thing that got me was akka itself. Its crazy awesome if
you need Concurrency, Scalability, and Fault Tolerance(doesn't
everyone?).

[Now for my second answer]
Here is a link to the internal doc I had ready when the interns showed
up.
https://docs.google.com/a/t8webware.com/document/pub?id=1NaW73omYMg_bgk0Ofm7Wrfopacu9LOM3scAmkT2aXEg
We also gave them Programming Scala and the OReilly book.
One of the things we try and do is meet weekly and share what we learn
or know. There is so much to know and learn when building a large
system in Scala that you just have to take the time to do that.

So how did that work? I think it worked well however... A lack of
understanding regarding Functional Programming will seriously hamper
your ability to leverage the full strength of Scala. So this leads to
a rant...(you can disconnect here if you like :)

I agree with what a lot of people say about Scala regarding the fact
that its easy to get started with it. I've heard many say things like
" ... you just write Java/C# style code in Scala". Thats true, but
thats like saying that its easy to climb into the cockpit of a stealth
fighter plane. Who cares. I want to fly the damn thing! And it
takes a bit to learn how to fly with Scala and then another while to
learn how to fly well and correctly. From my perspective, the biggest
hurdle for our team (including myself) was understanding FP.

My way of tackling my own lack of understanding regarding FP was to
start learning Haskell and Erlang. Maybe not the best recommendation
for everyone but it worked really well for me as I was able to wire in
conceptually what was going on with things like .map/flatMap, Option,
Types, TypeClasses, Higher Order Functions, Combinator Libraries
etc... When you're completely limited to a functional view of the
world, it forces your brain to rewire its synapses :)

Which brings me to another point worth making. Scala is not just
another language, its a different WAY OF THINKING ABOUT WRITING
SOFTWARE. <<quote shamelessly stolen from David Pollock and
regurgitated>> And I'm saying that, from the context of C#/Java. If
you are fortunate enough to have slammed(slammed meaning built
something that other people use) Haskell, Scheme and Erlang along with
Java and some Ruby (OR if your name is Eugene Wallingford) then
getting Scala is a gonna probably be fairly straightforward :)

Which brings me to my final rant... I don't think Scala is
complex(like you can read all over the interwebs). I think Scala has
taken some of the the best known ways of thinking about writing
software and combined them to a single programming model/language on
the JVM/CLR. I'm afraid to say this but it all goes back to LISP
folks. This stuff isn't actually new. My problem was I didn't know
that :)

The way I'm going to pitch the next potential hire is... "Scala is
going to kick your ass, however you'll be a better programmer for it".

sorry for the rant

Tony Bibbs

unread,
Nov 3, 2010, 3:58:24 PM11/3/10
to iowa-scala-...@googlegroups.com
I'll go a step further and ask how you get non-J2EE types into it.  I started in Java back in about 1995 or so when J2EE wasn't the four letter word it is now.  It was sweet if for no other reason, than because I don't have memory allocation anymore.  Since then I've been dabbling in everything *except* J2EE which seems like an unfortunate requirement to be really good at Scala.  Maybe you could argue otherwise but there tends to be an inclination to bust down to J2EE libs that most have committed to memory and guys like me have to look up everytime.

The interest part should be pretty easy.  Just point to the heavy hitters on the web using it and then to the growing Scala jobs I'm seeing on the job boards.  Err, well, you might not want to do that ;-)

Zach, maybe the Scala vets here (looking at you and Wade) could help, with input from others, put together the case for Scala in the enterprise.  Look no further than the plethora of PHP articles on the subject and adapt.  That's the missing piece of the manual, IMHO.  

Anyway, that said, I'll collect a few links, etc I have booked marked and holla back when I get a minute.  Great discussion...
--
Tony Bibbs
Phone: 515.259.0003
Twitter, Skype, Facebook: tonybibbs
Web: http://www.tonybibbs.com

metzben

unread,
Nov 5, 2010, 3:38:17 PM11/5/10
to Iowa Scala Enthusiasts
Hey Tony,
Good to see you post in here! Your question is a good one concerning
Java-land. FYI, I'm not coming from Java even though I refd it
several times. I know Java, can read it but haven't built anything
that anyone else ever used with it.
I have some thoughts I want to vet further before I post again.

regards,
Ben


On Nov 3, 2:58 pm, Tony Bibbs <t...@tonybibbs.com> wrote:
> I'll go a step further and ask how you get non-J2EE types into it.  I
> started in Java back in about 1995 or so when J2EE wasn't the four letter
> word it is now.  It was sweet if for no other reason, than because I don't
> have memory allocation anymore.  Since then I've been dabbling in everything
> *except* J2EE which seems like an unfortunate requirement to be really good
> at Scala.  Maybe you could argue otherwise but there tends to be an
> inclination to bust down to J2EE libs that most have committed to memory and
> guys like me have to look up everytime.
>
> The interest part should be pretty easy.  Just point to the heavy hitters on
> the web using it and then to the growing Scala jobs I'm seeing on the job
> boards.  Err, well, you might not want to do that ;-)
>
> Zach, maybe the Scala vets here (looking at you and Wade) could help, with
> input from others, put together the case for Scala in the enterprise.  Look
> no further than the plethora of PHP articles on the subject and adapt.
>  That's the missing piece of the manual, IMHO.
>
> Anyway, that said, I'll collect a few links, etc I have booked marked and
> holla back when I get a minute.  Great discussion...
>

metzben

unread,
Nov 8, 2010, 5:25:42 PM11/8/10
to Iowa Scala Enthusiasts
[I posted a reply last week but must have been eaten by GG]

Tony,
Good and valid questions. I had forgotten (until I read your msg)
about my java-ish grind. I know Java the language well enough to read
it but I haven't slung java for real(meaning written something someone
else used). In some ways Scala does assume Java knowledge although
I've quickly forgotten that now that I'm writing Scala everyday. The
worst for me was dependency management (jar heaven) and grinding java
docs for the java libs I was using and then translating java examples
to try and figure out how things worked. Once I was on SBT dep mgm
was pretty easy. I still have to grind Java docs so I can wrap that
ugly shit up in some sexy Scala :) I guess I would say... I don't
think knowing Java is a requirement but you'll definitely have to
grind some java docs. That said I think Scala For PHP Refugees maybe
should be a blog series written by Wade Arnold/Tony Bibbs ;) I'm
really not joking here. There is a certain level of introductory
material missing in Scala land for non-java folks. I guess now that I
think about it I needed to use something for scaffolding to get to
Scala so all the java-scala stuff was really the only choice.

Zach,
I'm curious why you chose Scala @ Pongr?

On Nov 3, 1:58 pm, Tony Bibbs <t...@tonybibbs.com> wrote:
> I'll go a step further and ask how you get non-J2EE types into it.  I
> started in Java back in about 1995 or so when J2EE wasn't the four letter
> word it is now.  It was sweet if for no other reason, than because I don't
> have memory allocation anymore.  Since then I've been dabbling in everything
> *except* J2EE which seems like an unfortunate requirement to be really good
> at Scala.  Maybe you could argue otherwise but there tends to be an
> inclination to bust down to J2EE libs that most have committed to memory and
> guys like me have to look up everytime.
>
> The interest part should be pretty easy.  Just point to the heavy hitters on
> the web using it and then to the growing Scala jobs I'm seeing on the job
> boards.  Err, well, you might not want to do that ;-)
>
> Zach, maybe the Scala vets here (looking at you and Wade) could help, with
> input from others, put together the case for Scala in the enterprise.  Look
> no further than the plethora of PHP articles on the subject and adapt.
>  That's the missing piece of the manual, IMHO.
>
> Anyway, that said, I'll collect a few links, etc I have booked marked and
> holla back when I get a minute.  Great discussion...
>

Zach Cox

unread,
Nov 17, 2010, 11:08:08 AM11/17/10
to Iowa Scala Enthusiasts
I first heard about Scala when Daniel Spiewak started blogging about
it, like early 2008. I was using his ActiveObjects ORM at the time,
and building the first incarnation of Pongr in Java. In 2009 I
finally bought Odersky's Scala book and was totally hooked. In summer
2009 I started implementing new functionality in Scala, giving Pongr a
mixed Java-Scala code base. It was mainly Jersey-based web services
at this point, and Scala worked pretty seamlessly.

I chose Scala for the same reasons everyone else does: such a powerful
language, new way of looking at programming, concise syntax, runs on
JVM with great Java interop, and it's just an exciting language to
learn & develop in. It's also a good recruiting tool: great
developers are always looking for better technology to use, and that's
who we want to attract. In summer 2010 we started a new product for
Pongr, and that's when we dropped Java and went to 100% Scala. I've
never even considered going back to anything else.

As for any requirements to know Java, I think it depends on how you're
using Scala. If you're writing servlets, you'll definitely need J2EE
knowledge. But we use Lift, and I've maybe had to use the
HttpServletRequest once or twice, otherwise it's all Scalal & Lift.
It would be an interesting case study to hear from someone with little-
to-no Java knowledge who has learned Scala.

metzben

unread,
Nov 17, 2010, 1:29:23 PM11/17/10
to Iowa Scala Enthusiasts
Zach,
I think that its interesting that you said its a good recruiting
tool... I agree. Hadn't thought about it in that way. If a potential
hire is excited about Scala its probably a good sign.

I don't want to belabor the issue with Java but I think there are some
things worth saying. I should first say that I guess I don't count as
a non-java guy as I've grinded my fair share of C#(which is just Java
with a somewhat Benevolent Dictator).
I agree about J2EE. You don't need to know a thing about J2EE(I
didn't and still don't, for example). However general Java(the lang
and the libs) knowledge is assumed in Scala-land quite often. And to
be frank I think it provides somewhat of an advantage if you have a
lot of Java familiarity.

IMO one of the greatest things about Scala is the ability to easily
leverage the world of java and the many quality open source
projects(just look at the akka project, quite a bit of what they're
doing under the hood wouldn't be possible without java.util.concurrent
or other java libs like Netty or JGroups). Another example... I just
pulled a grind through the Kestrel code(one of the major pieces of
Twitter infrastructure), and it holds a wrap(naggati) for Apache
Mina(Who wants to roll their own NIO socket lib?) and uses java.nio
for managing read-behind on disk. Kestrel also drops down to
java.util.concurrent for concurrency.

In general you're going to find yourself having to work with java libs
in a large project. But really it isn't too bad... just a bit of
grinding is all :) And I would say that working to understand things
like java.util.concurrent is well worth the time. And there is some
good news, there are new Scala wrappers for many Java libs showing up
on github everyday. ScalaTime (Joda wrapper), Scalaj, scouchdb
etc... And I know Lift has native support for things like RabbitMQ,
CouchDB, and MongoDB... Soooo

All that meandering to say... it feels like the java landscape is
fading quickly in the face of very nice Scala wrappers :)

Zach Cox

unread,
Nov 17, 2010, 1:45:36 PM11/17/10
to iowa-scala-...@googlegroups.com
Excellent post on the programming-language-as-great-developer-magnet
idea: http://www.yes-no-cancel.co.uk/2009/09/18/the-python-paradox-is-now-the-scala-paradox/

Sounds like we may be coming to a consensus that knowing Java before
Scala will help you in your Scala quests, but is not a requirement.
And that during your Scala quests you are very likely to need to use
various Java libraries. And that is one of Scala's great strengths:
building atop a vast landscape of existing 3rd party libraries.

Finally - maybe if you want no part of Java (or the JVM) perhaps
Scala's not the best choice for you. Ruby, Python, Go, Haskell,
Erlang, etc. may be a better choice. :)

Also a note on the "Scala is too hard" bullshit we see all over the
place - at Pongr we have 2 developers (and one more in the near
future) that have learned Scala from scratch very quickly: one had 20+
years experience and the other is a sophomore at university. Both
were productive very quickly and are loving Scala now too.

Wade Arnold

unread,
Nov 17, 2010, 2:38:14 PM11/17/10
to iowa-scala-...@googlegroups.com
Blogged: Scala is easier than PHP.http://bit.ly/bzTNJE #scala #lift #akka
Message has been deleted

metzben

unread,
Nov 17, 2010, 3:09:07 PM11/17/10
to Iowa Scala Enthusiasts
I have to say thats some of the best link bait I've ever seen :)

Nice article btw Zach. Liked it.

On Nov 17, 1:38 pm, Wade Arnold <wade.arn...@t8webware.com> wrote:
> Blogged: Scala is easier than PHP.http://bit.ly/bzTNJE#scala
> <http://twitter.com/#%21/search?q=%23scala>#lift
> <http://twitter.com/#%21/search?q=%23lift>#akka
> <http://twitter.com/#%21/search?q=%23akka>
>
> On 11/17/10 10:08 AM, Zach Cox wrote:
>
>
>
>
>
>
>
> > I first heard about Scala when Daniel Spiewak started blogging about
> > it, like early 2008.  I was using his ActiveObjects ORM at the time,
> > and building the first incarnation of Pongr in Java.  In 2009 I
> > finally bought Odersky's Scala book and was totally hooked.  In summer
> > 2009 I started implementing new functionality in Scala, giving Pongr a
> > mixed Java-Scala code base.  It was mainly Jersey-based web services
> > at this point, and Scala worked pretty seamlessly.
>
> > I chose Scala for the same reasons everyone else does: such a powerful
> > language, new way of looking at programming, concise syntax, runs on
> > JVM with great Java interop, and it's just an exciting language to
> > learn&  develop in.  It's also a good recruiting tool: great
> > developers are always looking for better technology to use, and that's
> > who we want to attract.  In summer 2010 we started a new product for
> > Pongr, and that's when we dropped Java and went to 100% Scala.  I've
> > never even considered going back to anything else.
>
> > As for any requirements to know Java, I think it depends on how you're
> > using Scala.  If you're writing servlets, you'll definitely need J2EE
> > knowledge.  But we use Lift, and I've maybe had to use the
> > HttpServletRequest once or twice, otherwise it's all Scalal&  Lift.
> >>>> used it, and gotten them interested in it&  up to speed.  Do you just

Tony Bibbs

unread,
Nov 17, 2010, 5:19:29 PM11/17/10
to iowa-scala-...@googlegroups.com
On a tangent, maybe it's time to start a Des Moines Area Scala Users Group...I could use some face time with some of you hard core Scala developers.


On Wed, Nov 17, 2010 at 2:09 PM, metzben <vonfor...@gmail.com> wrote:
I have to say thats some of the best link bait I've ever seen :)

Nice article btw Zach.  Liked it.

Zach Cox

unread,
Nov 18, 2010, 11:13:07 PM11/18/10
to iowa-scala-...@googlegroups.com
Meetups are a great idea! I would love nothing more than to start
monthly Scala meetups. I just wish CF wasn't 2 hours away, so we
could get the whole group together. I feel like there's some great
synergy here. Any good videoconferencing solutions?

Wade Arnold

unread,
Nov 18, 2010, 11:16:02 PM11/18/10
to iowa-scala-...@googlegroups.com

Then you can see the beers from our meetups. I wish everyone could have seen Dr wallingfords presentation last night.

On Nov 18, 2010 10:13 PM, "Zach Cox" <zco...@gmail.com> wrote:
IMAG0264.jpg

Zach Cox

unread,
Nov 18, 2010, 11:22:08 PM11/18/10
to iowa-scala-...@googlegroups.com
Nice! Any videos/slides/code/etc from it? Wish I could've made it.

Benjamin Metz

unread,
Nov 19, 2010, 2:25:12 AM11/19/10
to iowa-scala-...@googlegroups.com
If you guys started one in Des Moines, I'd roll down.  (Truth is, my wife loves Des Moines so I could easily pull it off ;)

Reply all
Reply to author
Forward
0 new messages