FiveRuns Blog

On Rails production performance and monitoring

Posts
No comments

Rails TakeFive - Five Questions with David Flanagan, Part 2

Welcome to this week's Rails TakeFive interview. This week, Part 2 of Adam Key's interview with David Flanagan, noted programmer and author of, among other books, The Ruby Programming Language.

Part 2, wherein Adam and David discuss the craft of programming:

Adam K.
David, you've worked with many languages over the course of your career. What's your take on building systems with one language versus many languages?
David F.
I've worked with many languages, but I haven't really built many systems... I guess I'd just say that today's reality forces us to use many languages. At least one on the server and one on the client. And if you start considering things like configuration scripts and Makefiles and CSS files, then we're really into many languages territory.
David F.
Thinking back to my system building days when I worked at MIT on the X Window System, I recall that even then I was advocating the use of markup languages for describing GUIs instead of doing that in C code, so I suppose I come down on the many languages side.
Adam K.
Wow, advocating markup back in the early X Windows days. That's forward-thinking!
Adam K.
Most days, I wish you'd advocated more :)
David F.
Not markup in the XML sense, but the use of a separate IDL (interface description language) to describe a GUI.
Adam K.
Well, most anything is better than using a language like C to describe a UI.
Adam K.
But, I'm fond of saying that you can only learn some things by doing it wrong the first time. So it goes with programming.
Adam K.
You have a fantastic chapter on programming in the functional style with Ruby. The chapter is presented as a thought exercise. I find these sorts of activities crucial to expanding as a programmer. What are some good thought exercises you've gone through lately?
David F.
I mentioned earlier in our chat that I'd been working on class-based inheritance in JavaScript. I did that originally for my JavaScript book. Turns out there was a mistake in the approach I used there, and I've just blogged about a new version. It's not that I think it is all that important to be able to robustly simulate class-based programming techniques in JavaScript. But trying to figure out ways to make it work really forces you to understand the workings of the underlying prototype-based inheritance.
David F.
That's one. I've also been learning Python recently for some documentation work I've been doing for freebase.com. I got to write my first Python generator method a few weeks ago. Learning any new language is an interesting exercise. Just trying to understand the differences between Ruby's yield and Python's yield, for example, would help any programmer understand both languages better
Adam K.
I agree wholeheartedly.
Adam K.
Are you a languages guy? You seem to have worked on and documented several of them.
David F.
I do enjoy learning and documenting languages... But in the course of doing that, I get to follow mailing lists full of true "language guys". Folks with PhD or who read the academic papers and such. (I'm thinking of people like Gilad Bracha and Neal Gafter who used to be at Sun working on Java and Brendan Eich at Mozilla on JavaScript). So I've been exposed to enough of those people to make me realize that I'm not a real language guy.
David F.
I can't use the phrase "type calculus" and really know what I'm talking about!
Adam K.
I'm the same way. I can't really keep up with the academic posts on, for instance, Lambda the Ultimate, but I do enjoy learning new languages. Impressing friends with my knowledge of (they would consider) arcane and academic languages is great fun too.
Adam K.
What topics do you find exciting and encourage other people to investigate?
David F.
I've stayed away from the arcane, but I have been hearing more and more about Scala and Haskell. Maybe I'll wait 10 years before learning those like I did for Python :-)
Adam K.
Haskell's one I recently dove into. I highly recommend it, though I should note that I had recursive dreams for a few nights afterwards!
David F.
Having just made my joke about type calculus, I have to say that I think the type system of ECMAScript 4 (JavaScript2) is pretty interesting. It's got everything, and very interesting uses of namespaces as well. I'm don't want to try to describe it here, but there are good whitepapers (not too out of date) at ecmascript.org
Adam K.
Type calculus jokes always kill.
David F.
:-)
Adam K.
Type systems in general are interesting bits, though the non-academic writing on them is a bit limited. Anything else cool that you're into currently?
David F.
I suppose I should plug freebase.com. I'm not by any stretch a semantic web person, but those who are should check it out. Freebase uses an object database with an interesting query language known as MQL. I've been documenting MQL, and that has been interesting work for me. Interestingly, MQL queries are written as JSON-formatted objects, for some Web 2.0 goodness.
Adam K.
Is that similar to how CouchDB formats its queries as JavaScript and JSON?
David F.
I don't know anything about CouchDB. Sorry.
Adam K.
Oh, it's a column-oriented document database gizmo. The main interface is via REST and you can define queries or views (maybe both) as JavaScript and get JSON back.
Adam K.
Anyway, last question! :)
Adam K.
It's often the case that today's problems are mostly the same as yesterday's problems. That said, what is entirely different in the software world from when you started?
David F.
Well, I started with a TRS-80 color computer with 4K RAM in 1981, so there are about 6 orders of magnitude more memory in today's comptuers... But I know that's not what you meant.
Adam K.
Heh :)
David F.
My first paid programming work was with Pascal and C back when those languages came (on PCs) with integrated editors and debuggers. I quickly moved off of PCs and onto Unix workstations, however and have stayed there ever since... I've come to accept the Unix-style separation of tools: editor, compiler, debugger. (And if I ever had to give up emacs, I'd be lost). But sometimes it seems as if the rest of the world is using modern all-encompassing IDEs. I've never gotten the hang of them, and I don't like them. (Though to be honest, if I had to work on some J2EE project or something, I might come to rely on and love an IDE that would do all the boilerplate for me.) I think that gets back to our earlier conversation about many languages. In some sense, things are just a lot more complicated for many of today's developers.
Adam K.
How so?
David F.
Another difference: back when I started, there wasn't a whole lot of concern about paradigms. Even OO was new, and we certainly didn't talk about things like extreme programming or test-driven development. We just wrote our code and then fixed it when bugs were found. (Sure, we had to read The Mythical Man-Month in school, but the programming recommendations in that book were so archaic (having typists on a programmer's support staff) that no one paid attention.
Adam K.
Interesting. Sounds like, as with many things, the acceleration of communication is the main factor in play.
Adam K.
Ideas (encoded as text and software) travel faster, so more stuff gets done.
David F.
How are things more complicated today? I just mean that there are more layers of complexity, more languages and grammars (HTML, CSS, XML, JSON) to learn, configuration file formats. With that increased complexity comes (one assumes) increased productivity, of course.
Adam K.
Does it feel more productive to you?
David F.
Yes, I think that's probably right. Like I said earlier, though, I haven't built a lot of systems. And since I've been self-employed for 15 years, I haven't had to work on programming teams that benefit (or suffer) from that increased pace of communication.
David F.
I assume that we as programmers are more productive today, though it doesn't always feel that way. For me, the appeal of new languages is how nice and tidy and self-contained they can be. When Java first came out 12 years ago, I think a big part of the appeal was how small the system was. There were only a limited set of things you could do with a Java applet, but the API was small enough that any programmer could master it. It was like having that TRS-80 color computer again.
Adam K.
Well, the hobbyist is making a comeback with projects like Shoes, Processing, Arduiono and Scratch.
David F.
It's hard to have that feeling of mastery these days when any real-world project seems inevitably to involve areas that you have not really mastered. Isn't there always some element of cutting-and-pasting a configuration file or someone else's CSS or something?
Adam K.
And hopefully, we as an industry are more productive, if only slightly, than back in the day. :)
David F.
Shoes is something I've been meaning to try out.
David F.
I'm not an economist, but I have to assume that the industry is more productive, or it would have collapsed under the weight of all the complexity!
Adam K.
Intuitively I agree, but that disregards the massive momentum of sales and marketing :)
Adam K.
Anything else you want to throw in?
David F.
No, I think that we've covered it all.
David F.
This was fun. Thanks!

For Part 1 of the interview, please click here.

David Flanagan is a computer programmer who spends most of his time writing about Ruby, JavaScript, and Java. His books with O'Reilly include The Ruby Programming Language, Java in a Nutshell, Java Examples in a Nutshell, JavaScript: The Definitive Guide, and JavaScript Pocket Reference. David has a degree in computer science and engineering from the Massachusetts Institute of Technology. He lives with his wife and children in the U.S. Pacific Northwest between the cities of Seattle, Washington and Vancouver, British Columbia. David has a blog at www.davidflanagan.com

Bookmark and Share
Continued Discussion

No comments have been added yet.

Contribute

Continue the conversation and share your thoughts. A name is required. Your e-mail address will not be displayed on the site. Textile formatting may be used in your comments (but will not be rendered in the live comment preview).

→ Posted by You on November 20, 2008 at 04:22 PM

Flickr

FiveRuns tagged photos on Flickr.

  • FiveRuns at the SF Ruby User Group
  • Inspiration - FiveRuns
  • FiveRuns at the SF Ruby User Group
  • Mark
  • Al
  • FiveRuns at the SF Ruby User Group
  • FiveRuns at the SF Ruby User Group
  • Bruce Williams Arrives

See more FiveRuns tagged photos…

Other Categories

Entries are also organized under the following general topic categories.