No Fluff Just Stuff Tampa — Day Two
Originally posted 2010-04-18 06:41:23
As Moore’s Law gets repealed and multicore processors demand that we actually learn to write good, safe, non-buggy multi-threaded code (Note: if the business people where you work understand the term \”race condition,\” you’ve got threading problems), functional languages gain appeal. I’ve eschewed Haskell, started looking at Erlang, and vowed to look at Scala. When I saw Ted Neward’s The Busy Java Developer’s Guide to Scala: Basics on the schedule, I figured I’d go to get a Scala jumpstart.
Neward’s presentations, in my experience, sometimes have slides, always have a text editor, always have a command line, and always have lots of code that he composes as he goes. He’s smart enough and knowledgeable enough that he almost always gets away with this approach, and his methods produce engaging presentations that he can easily mold to his audiences. Today, he got bogged down with enough compile errors around for \”not-loops\” (I forget what Scala calls them) that he had to eventually and grudgingly abandon. Live demos can be a tough gig. Later, though, as he wrapped up the presentation, the bolt of lightning hit and he realized that Int has a % method and Integer doesn’t, and that’s why the compiler kept barking.
Despite his frustration and embarrassment, however, the presentation was good and I’m glad I went. I downloaded and installed Scala on my MacBook Pro, downloaded and fussed with Vim support for Scala, and realized that I need Tim Pope to get interested in Scala so he’ll clean up the Vim plugin, make one of his vimbundles, and make it easier to install. I followed along with the code, typing in examples and verifying that I could compile and run them. I saw enough Scala that I’m intrigued. Also, although I can author very little Scala at this point, I leapt the \”clueless\” barrier. As I plunge into Scala and expend the effort to learn it, the pieces that I saw will be familiar. Not bad for 90+ minutes. Incidentally, Neward would have had no cognitive nor compiler issues if he hadn’t been presenting from Windows 🙂
When someone asked, at the end of the presentation, what problem Scala is trying to solve, Neward replied, \”Java.\”
I next attended Brian Sletten’s REST : Information-Driven Architectures for the 21st Century. He also talked about Richardson’s Levels of Maturity, explaining that most of today’s well-known REST services are level 2. The difference between level 2 and level 3, however, is small, and it’s easy to jump from 2 to 3. My understanding is that the jump requires only to embed linkage support in the responses.
He talked about the importance of keeping RESTful interfaces and implementations stateless, requiring all requests to contain sufficient information so that any server in a cluster can handle the request. He then walked through the different verbs and their safety (\”not safe\” changes server state, \”safe\” does not) and idempotence, and included the best explanation I’ve heard on the difference between POST and PUT:
- GET — safe and idempotent. Retrieves a resource.
- POST — not safe and not idempotent. Used for both create and update. Used when client is creating and doesn’t know the identity of the resource, or when client is updating by appending (doesn’t send complete information).
- PUT — not safe and idempotent. Used for both create and update. Used when the client knows the identity of the resource and completely overrides it.
- DELETE — not safe and idempotent. Deletes a resource.
- HEAD — used for what-if scenarios.
- OPTIONS — what can I do?
If what I typed isn’t clear, it’s my fault, not Brian’s.
He talked about the HATEOAS hypermedia links, talked about the human-readable URI approach vs RDF predicates, and pointed out that your REST services will be used in ways you didn’t think of. As an example, he demonstrated Retrievr, which allows you to make a rough sketch and then returns Flickr images that roughly match that sketch using Flickr’s RESTful API. Amazing.
I played with Groovy a few months ago, liked it, and have been too busy to get back to it. So, I attended a couple of sessions with Jeff Brown, who is a core member of the Grails development team. The first was on GORM, the object-relational mapping layer built atop Hibernate, and the second was on polyglot web development using Grails. He demonstrated his Grails Clojure Plugin, which works amazingly well. Both talks amply demonstrated the dynamic nature of Groovy, including metaprogramming and other Groovy goodness. I started writing an app in Groovy that I think, this time, I’ll actually finish.
Between the two talks, I chatted with Jeff about Grails vs Rails. He asked me what I missed in Grails that I have in Rails, and I blurted out, \”Haml!\” He hadn’t seen Haml, so I showed him some and we talked it through. He talked about GSPs and that they’re either looking at or perhaps working on (I don’t remember which) a new view technology for Grails based on Groovy code. Sounds interesting. Maybe, though, I’ll try to port Haml to Grails!
Great day two, ended by a trip to Ceviche, where we dined outside and saw a baby opossum who looked an awful lot like a rat foraging under the tables, a gelato run, and a win by the Celtics. Woohoo!