Sunday Selection 2012-03-11

Happy Daylight Savings Time Day everyone! (Or something like that)

Around the Web

Are you a Zen coder or a distraction junkie? It’s been a while since I’ve worked on a project where “my code’s been compiling” has been a valid excuse for not working. But now that I am on such a project, it’s important that those mini-breaks don’t turn into longer breaks.

Successful people are successful Einstein is rumored to have said that compound interest is the most powerful force in the Universe. Whether or not he actually said that, compound interest is still pretty powerful. Maybe it applies to reputation and achievement just as much as it applies to money.

The power of diligence in creating a remarkable life Keeping one’s options open seems to be a pretty common strategy but it could be the wrong one. Perhaps it’s a better idea to pick an area and dive deep rather than to spread your bets.

Videos

On being an introvert Everyone seems to be busy building the next social thing to help us “connect” better to everyone else. But a lot of the best work requires solitude and independence. Introversion might be a hidden superpower. (There’s a written synopsis, but the video is well worth the 18 minutes of your time.)

Etudes for programming

From Wikipedia:

An étude (a French word meaning study, French pronunciation: [eˈtyd], English pronunciation: / ˈeɪtjuːd /) is an instrumental musical composition, most commonly of considerable difficulty, usually designed to provide practice material for perfecting a particular technical skill.

I noticed today that Michael Fogus (one of the authors of Joy of Clojure) has a number of Github repos with names such as etude-ocaml and etude-syntax. I also realized this week that I’m a pretty slow programmer. I’ve been getting better over the years but I’m still slow, especially if there’s a good amount of API design involved. While I think that writing lots of code will make me faster over time, I do wish there was a more structured, focused approach.

In general, I wish there was more by the way of études for programming — problems and exercises of considerable difficulty designed to provide practice material for a particular (set of) skills. There are of course great textbooks for programming and computer science and those books have good exercises (I particularly like SICP and the K&R C book), however in most of those cases the point is to teach first and practice second. What I’d like to see is the reverse – assume that the reader already knows about functional programming or the C language but needs to “level up”, so to speak. The exercises would be harder and more in number but would also cover a broad area in terms of application of the concepts involved.

This is related to what I’ve written earlier in terms of deliberate practice for programmers. That post talks about “level up” lists – a list of programs to make that help explore the different areas of computer science and help you gain experience and hence “level up” as a developer. On the other hand études would focus on depth rather than breadth – each one would focus on a small technique or technology and fully explore that area. Together a continuous habit of working on études and doing level-up projects would give programmers a steady stream of deliberate practice exercises to work on.

The question is, where are we to find these études? I’m not sure if there are programming books out there that fit that description. If there are, I’d love to here about them. But in the meantime I’ve found an acceptable alternative — homework and assignments for college level courses. This semester I’m the TA for a course on functional programming and throughout the semester we have a set of 6 assignments for students to do. Each of them have about 3 to 4 problems (each with multiple parts) that tackle a small area of functional programming. I think exercises like this are great material for études. I’m currently working through the exercises at the same time as the students (other TAs are making them). Even though I’m already familiar with most of the material it’s been a good learning and great practice for me. I can’t really measure if I’m improving (apart from running my solutions through the test harness) but it’s more direct and practice in functional programming that I’ve ever had.

I’ll be done with this particular étude in a few months. I don’t think I’ll be releasing the code since the problems often get reused. However I do think there will be lot more where those came from. There are lots of college courses with website out there and there’s lots to learn. I’ll probably try compilers next. All that being said, it would be great to see some curation and collection. With Amazon’s Kindle Shorts and the growing interest in short, self-published books putting together a regular series of études might be a pretty lucrative endeavor.

Tagged ,

How much do environments matter?

The last week and a half has been really productive. I’ve written a lot of code, made progress on my research project and learned a lot of stuff in the process. Unfortunately it’s all been in one area, but that’s a matter for another post. But given how productive I’ve been one thing that I’ve been wondering is how important an environment really is to productive.

I’m usually of the opinion that environment (both physical and in terms of setup) is really important for any sort of creative or intellectual work. However I’m not quite so certain anymore. My current working setup is less than perfect. Though I have a nice DIY standing desk and a brightly lit office I also share the office with six other people and at times it can get pretty busy and crowded. I have a very powerful work machine but most of my recent work has been in a basic Ubuntu virtual machine with no customization other than my Bash and Emacs setups.

Despite the fact that my environment is not perfect the last week has probably been the most productive I’ve had all year. This begs the question: are environments really as important as I had thought they were? Or is it sufficient (and necessary) to have a project you’re really interested in? Of course, I understand that this is a personal question, so I’m just going to try it for myself.

What I’m starting to think is that the environment doesn’t need to be perfect, it just has to be “not painful”. There are some things that I just can’t stand: I can’t stand bad chairs, environments that are too noisy or too high of a room temperature. But once I have air conditioning, a standing desk and decent set of headphones I can quite easily tune out everything else. Similarly, once I have a command-line UNIX environment and a decent enough keyboard I care much less about what window manager I’m using, what size my monitor is or even what my language or toolchain is. Once I’m in the zone there’s very little that I care about.

I would say that environments matter, but only to some extent. After a point an interesting and exciting project can easily make up for any deficiencies in the environment. However, the opposite – a great environment but an uninspiring project – hardly makes you want to jump out of bed in the morning and get to work.

In addition to my Macbook and my work machine I have a small Eee PC lying around with a bare bones Arch Linux install on it. As a small experiment I want to see if I can be as productive on that machine as I am on my work machine. In addition to my research project I’m taking a programming languages class and TAing a functional programming class, so I regularly find myself in the mood for some OCaml hacking. Admittedly it won’t be a scientifically controlled and rigorous experiment, but it will be interesting to see how far an interesting project can compensate for a less then ideal environment.

Crystallized Archetypes

Manuel Simoni writes a very interesting (and brilliantly named) blog on programming languages entitled The Axis of Eval. For almost two years now he’s been delving deep and wide across the field of programming languages. He was interviewed by the State of Code blog a few months ago. I read something in that interview that has been lurking on and off in the back of my mind:

I think Lisp is the archetype, the crystallized form of all dynamically-typed scripting languages, and for that reason I like it. I also like C and Haskell, because they’re similarly crystallized languages in their respective areas.

As I study more about languages, and use a growing number of them on a regular basis, I can’t help but think: what are some of the other crystallized archetypes of languages out there?

Let’s start with Manuel’s list. Lisp stands out as the archetype for dynamically typed scripting languages. Other similar languages (Perl, Python, Ruby and the like) all emulate bits and pieces of Lisp (with varying success). Each new scripting language that becomes popular seems to be just a little more Lisp-y. Haskell is then the archetype for statically typed, functional programming languages. One could argue that this title belongs to OCaml or the various other MLs. From my experience working with them both occupy very strong points in the space of statically-typed functional languages. Which one you choose depends very much on what your particular needs are.

On another level entirely resides C. While both Lisp and Haskell strive to help you create elegant towers of abstraction, C will happily lay open the bare hardware for you. C is your archetype for a low-level systems programming language for a von Neumann machine. There’s certainly a new generation of systems programming languages waiting in the wings: D, Go and Rust to name a few. Though I have limited experience with any of them, from what I can tell they are all a few layers above the machine. While that’s certainly great for programmers (and I hope it picks up speed) if you want to get down into the guts of your computer you’d better reach for your C compiler. If you have more experience on this front, feel free to enlighten me.

While Java and C++ might have introduced much of the world to object-oriented programming, the title of archetype almost certainly goes to Smalltalk. While Lisp can play host to a powerful object system and OCaml goes far towards combining OO and functional programming, Smalltalk stands out as being object-oriented from the bottom up, so to speak. Of the modern popular languages, Ruby is probably closest to the Smalltalk way while still being a scripting language for Unix-like systems. I’ve only done a tiny bit of Smalltalk programming myself (and certainly haven’t made a large system) but it’s definitely a very interesting experience. I don’t know if there’s an ‘aha moment’ like there is with Lisp, but I highly recommend it if you write OO code regularly.

While those four cover most of the ground for popular programming paradigms, there are a handful of other interesting archetypes out there. For concatenative programming I’d recommend Factor. Similarly, Prolog stand for declarative, logic programming. I’m hesitant to name archetypes for web or distributed programming. Personally I think of JavaScript as more of a prototype-based OO language that happens to be in the browser than as the archetype for a web programming language. Somehow I feel like we can do better than the HTML, CSS and JS trifecta we have now.

As I keep learning about languages, I’m looking forward to exploring these archetypes in greater depth (and their particular instantiations). I might even try implementing a few of them. So much to learn, so much code to write, so little time.

Sunday Selection 2012-02-19

Around the Web

UNIX as IDE I have a love-hate relationship with IDEs. While I understand that IDEs are useful (if not essential) for languages like Java and C++, I personally can stay away from those languages and hence I use Emacs + command line tools as my IDE. Working primarily in Linux (and sometimes OS X) makes this very easy. This series (it’s a long read) is chock full of useful tips to better use Unix as your IDE.

Don’t Fall in Love with Your Technology Our job is not to use the best technology or write code. Our job is to solve problems.

Letter to a Young PL enthusiast This pretty topic-specific, but I’m a PL enthusiast so it’s relevant. If you’re interested in PL research (or just like exposing yourself to new ideas) this is a worthwhile. I don’t know half the things mentioned, but I try to learn a little more everyday. Additionally there seems to be a new PL-oriented mailing list called LL.next.

Fromt the Bookshelf

How to Steal like an Artist Ok, I’m jumping the gun on this one. It just came out and I pre-ordered on Amazon so I’m going to get it in a few days. But judging from the talk and blog post that started it all, it’s going to be awesome. Amazon has it for the cost of a venti something-or-the-other from Starbucks.

Follow

Get every new post delivered to your Inbox.

Join 338 other followers