While It’s Compiling is a new series of interviews with experts across a range of bleeding-edge technologies and practices, exclusive to Skills Matter. Be sure to subscribe to this blog for future interviews, or follow us on Twitter. You can see all earlier interviews in the series here.
Find out who we’ll be interviewing next, and get a chance to put your questions forward with the hashtag #whileitscompiling.
For the second part in this series, we caught up with Chris Marshall, one of the 22 Scala gold-badged users on StackOverflow. He has been programming commercially for 14 years, briefly in FORTRAN and Smalltalk, then Java (since 1999) and in Scala (since late 2008) after his patience finally wore out. With over 12 years financial IT experience, he has been in his dream job for GSA, a small, technology-driven hedge fund since 2006 and prior to that spent six years at JPMorgan working for the rates business.
In his spare time, he likes to fail to get through “The Essence of the Iterator Pattern”, which he has now managed almost 500 times.
1. What attracted you to functional languages in the first place?
I was initially attracted to Scala as “better Java” (before project Lambda, when it seemed like adding closures to Java was being punted into the long grass). Having large quantities of IP invested in the JVM (i.e. lots of Java libraries), Scala fitted a few key requirements, namely that you had seamless Java interop (which I now realize is a double-edged sword and agree with Brian McKenna’s opinion that Java should be hidden behind an FFI, but I digress). It looked “familiar” (i.e. it wasn’t Clojure) and it had a “pedigree” (Martin & EPFL).
Starting to use scala sent me on a path of discovery about types and opened me up to an online community which has shown me new (and I would argue better) ways of doing things.
2. What are you working on?
I don’t get as much time coding these days, as we now have a large team of developers – but my main project this year is going to be a bitemporal API representing the “business entities” within GSA (trading books, business units, funds etc). We’ve discovered over the last few years that not having this is painful. On top of this, there is a lot of incremental development on our existing codebases, which number in the hundreds
3. Do you work in only FP languages, or does the project you are working on have some FP code and some OO/Procedure code? If so how does that fit together?
No – we have a lot of Java systems, both legacy and not-so-legacy. I’m still very wary of providing Scala APIs to external teams as well (because many of our APIs target non-specialists who work in languages like Matlab, so binary compatibility issues are likely to cause unhappiness), so if we needed something in that space, I would probably still opt for Java.
Neither do I write pure functional code – many of our systems are realtime, or up 24×5, so I might write small pieces of functional code which ultimately end up running in a non-functional system (for example, actor-based).
4. What is one piece of advice you can give to new programmers?
Don’t be lazy. Never, ever skimp on logging and spend time making sure your log messages are comprehensive and contain all the information you will want. Don’t write assertions without a descriptive error message (your invariants will often turn out to be anything but) and similarly with exceptions. You’ll just end up adding it later, after your systems have failed and you have unhappy users, so you might as well just do it properly now.
5. What would you like to ask the community?
Can someone please demonstrate the coding of a realtime, functional system in Scala? By “realtime”, I mean “constantly up and producing output” as opposed to a single calculation with a defined end result (or results).