lördag, mars 29, 2008

Meta-level thinking

I have been trying to figure out what characterizes some of the best programmers I know, or know about. It's a frustrating endeavor of course, since most of these people are very different from each other, and have different experiences and ways to think and learn about stuff. Not to mention the fact that programmers tend to be highly individualistic.

But I think that I'm finally zeroing in on something that is general enough but also specific enough to categorize most of these people, and the general mind needed to be a really good programmer. In this blog post I'll call that "meta-level thinking", and I'll explain more about what I mean as we go along.

When people try to become better programmers there are generally a few different kinds of advices you can get. The ones that seem prevalent right now is (among others):

  • Learn - and understand - Lisp
  • More generally, learn a new language that is sufficiently different from your current knowledge
  • Work with domain specific languages
  • Understand metaprogramming
  • Read up on the available data structures (Knuth anyone)?
  • Implement a compiler and runtime system for a language
Of course, these are only a few examples, and the categories are a bit fuzzy. These items are based on most of my experiences so they tend to be a bit language heavy. But I believe that what you practice by choosing any of these routes is an ability to abstract your thinking. In short, I believe that being able to abstract and understand what goes on in a programming language is one way to become more proficient in that language, but not only that - by changing your thinking to see this part of your environment you generally end up programming differently in all languages.

This is why Lisp has a tendency to change the way people write Java code. Lisp teaches you metaprogramming and DSL's but they don't really do it in a way that need words. DSLs and metaprogramming are just part of Lisp. It's so much a part of the structure that you don't see it. But when you turn to Java you'll need to start working with these abstractions on a different level. Ruby programmers embrace metaprogramming and this changes the way these Ruby programmers think about things.

I'm really happy to see metaprogramming and DSLs getting more and more focus, because I really believe that understanding them is a really good way to make programmers better. Of course, you can get the same effect by writing a copmiler and runtime system - as Steve Yegge proposes. But I disagree that you really need that experience. There are other ways you can get the same way of looking at the world.

I call this meta-level thinking. I think it's mostly a learned ability, but also that there is an aptitude component. Some of the best programmers I've met just have a mind that fits very well. It's interesting to note that this kind of meta-level thinking is not an ability that is only applicable to programming. In fact, that's probably just a matter of genetic luck that the same ability works very well for programming as for many other things. I think that there is a connection between certain abilities and a capacity for meta-level thinking too. Like music - it's interesting to see how many programmers that have artistic leanings, and specifically towards music. It would be interesting to see some statistics about this.

In conclusion, this is my somewhat fuzzy view about what is one of the most important abilities that contributes to create brilliant programmers. If you have any interesting ideas about other ways you can reliably practice this ability, please improve on my list.

12 kommentarer:

Anonym sa...

I think it's about abstractions. That's what programmers have learnt to work with, and what a good programmer has mastered. Languages like Lisp or Haskell enable the expression of a large set of abstractions, and in effect offer more opportunity to learn about them.

Andreas

Mats Henricson sa...

I'm sorry, but I can't see any fit between your observations and mine. I consider myself a fair programmer, but the difference between me and my great co-worker (hi, Janne) has nothing to do with "meta-level thinking". It has much more to do with a fierce drive to never ever accept sloppy design or code. He will never accept increased technical debt, unless there is a true panic going on.

When thinking about some other great programmers I've encountered over the years, such as Lars, Per, Steve and Stephen, what perhaps connects them all is a will to never buckle under pressure. They know how to produce great code, and will not stray away from their known paths even when pressured.

Anonym sa...

I think abstractions and meta-programming is nice, but sometimes you cant abstract, especially not on a lower level if you depend on a specific OS.

To create a directory you cant abstract much, at least it would not make much sense to abstract that.

I think if the underlying OS however supports more abstraction in theory (Plan9) you could go a different route.

My point here is that meta-programming, abstractions etc... all live better if they are in and on an ecosystem that supports these notions.

This is why I believe UNIX is very practical but not a genious concept. Its rather stupid :/ and I hope that in the future we will see much more interesting AND better abstractions of how to work with an OS. (My favourite example - look at the GUI world on UNIX. It still struggles! But look at the www, with beautiful javascript events onClick etc... that is a somewhat nice abstraction - although I agree that the www itself has became rather complex and obfuscated, with so many people relying on XML ...)

Miles sa...

Anonym: I think the point is that meta-level thinking allows you to easily create new abstractions that better fit the program you're trying to write.

Twylite sa...

Laziness, impatience, hubris.

http://www.netropolis.org/hash/perl/virtue.html

A good programmer will find the simplest, most efficient and (by extension) most elegant solution ... even if it means researching, investigating and learning to come up with it.

One could say that a good programmer tries to minimize effort, but doesn't count research and learning as effort.

Fredrik Wendt sa...

On the comparison to being musically skilled, or artistically leaned - I'd say most of the good programmers I've met may be musically skilled but fail to improvise on a tune they've never heard before. Come to think of it - of course there must be exceptions - it's just that I've yet not came across one. Is it so that any really good programmer will "fail" to improvise (add value) to an unknown tune?

Steve Campbell sa...

There was a study of successful ice-skaters that compared their practice sessions with less successful skaters. What they found was that everyone practiced for the same amount of time, but the successful ones tried the harder moves more often.

To draw the parallel to great programmers, I think they just try the harder things more often - they push themselves. They fail more often, and learn from those failures. What they learn is internalized into various abstractions that allow them to work at a different level.

Anonym sa...

i think its abt abstractions.

Peter Krantz sa...

You are applying an inside-out perspecive. Some of the best programmers I know take a personal interest in the problem domain and have the ability to understand the needs of a business on a high level. Other things that come to mind is the ability to apply the right levevel of quality (not necessarily the highest) and communication skills.

In a project I'd take the things above over someone who knows Lisp if that was the choice.

Anonym sa...

Nice article. You can also get freelance work exchange and recruitment process outsourcing from ICanFreelance.com

ecommercewebmaster12 sa...

If you are looking out for apt ecommerce solution to spruce up your online business,then the offshore software outsourcing company Infysolutions is the ideal destination foryou. The url http://www.infyecommercesolution.com/ provides the details on specific ecommerce solutions that you can avail of to expand and boost up your online business.

cvxv sa...

看房子,買房子,建商自售,自售,台北新成屋,台北豪宅,新成屋,豪宅,美髮儀器,美髮,儀器,髮型,EMBA,MBA,學位,EMBA,專業認證,認證課程,博士學位,DBA,PHD,在職進修,碩士學位,推廣教育,DBA,進修課程,碩士學位,網路廣告,關鍵字廣告,關鍵字,課程介紹,學分班,文憑,牛樟芝,段木,牛樟菇,日式料理, 台北居酒屋,日本料理,結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,台北住宿,國內訂房,台北HOTEL,台北婚宴,飯店優惠,台北結婚,場地,住宿,訂房,HOTEL,飯店,造型系列,學位,牛樟芝,腦磷脂,磷脂絲胺酸,SEO,婚宴,捷運,學區,美髮,儀器,髮型,牛樟芝,腦磷脂,磷脂絲胺酸,看房子,買房子,建商自售,自售,房子,捷運,學區,台北新成屋,台北豪宅,新成屋,豪宅,學位,碩士學位,進修,在職進修, 課程,教育,學位,證照,mba,文憑,學分班,網路廣告,關鍵字廣告,關鍵字,SEO,关键词,网络广告,关键词广告,SEO,关键词,网络广告,关键词广告,SEO,台北住宿,國內訂房,台北HOTEL,台北婚宴,飯店優惠,住宿,訂房,HOTEL,飯店,婚宴,台北住宿,國內訂房,台北HOTEL,台北婚宴,飯店優惠,住宿,訂房,HOTEL,飯店,婚宴,台北住宿,國內訂房,台北HOTEL,台北婚宴,飯店優惠,住宿,訂房,HOTEL,飯店,婚宴,結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,台北結婚,場地,結婚,場地,推車飲茶,港式點心,尾牙春酒,台北結婚,婚宴場地,結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,台北結婚,場地,居酒屋,燒烤,美髮,儀器,髮型,美髮,儀器,髮型,美髮,儀器,髮型,美髮,儀器,髮型,小套房,小套房,進修,在職進修,留學,證照,MBA,EMBA,留學,MBA,EMBA,留學,進修,在職進修,牛樟芝,段木,牛樟菇,關鍵字排名,網路行銷,关键词排名,网络营销,網路行銷,關鍵字排名,关键词排名,网络营销,PMP,在職專班,研究所在職專班,碩士在職專班,PMP,證照,在職專班,研究所在職專班,碩士在職專班,SEO,廣告,關鍵字,關鍵字排名,網路行銷,網頁設計,網站設計,網站排名,搜尋引擎,網路廣告,SEO,廣告,關鍵字,關鍵字排名,網路行銷,網頁設計,網站設計,網站排名,搜尋引擎,網路廣告,SEO,廣告,關鍵字,關鍵字排名,網路行銷,網頁設計,網站設計,網站排名,搜尋引擎,網路廣告,SEO,廣告,關鍵字,關鍵字排名,網路行銷,網頁設計,網站設計,網站排名,搜尋引擎,網路廣告,EMBA,MBA,PMP
,在職進修,專案管理,出國留學,EMBA,MBA,PMP
,在職進修,專案管理,出國留學,EMBA,MBA,PMP
,在職進修,專案管理,出國留學,婚宴,婚宴,婚宴,婚宴

住宿,民宿,飯宿,旅遊,住宿,民宿,飯宿,旅遊,住宿,民宿,飯宿,旅遊,住宿,民宿,飯宿,旅遊,住宿,民宿,飯宿,旅遊,住宿,民宿,飯宿,旅遊,住宿,民宿,飯宿,旅遊,美容,美髮,整形,造型,美容,美髮,整形,造型,美容,美髮,整形,造型,美容,美髮,整形,造型,美容,美髮,整形,造型,美容,美髮,整形,造型,美容,美髮,整形,造型,設計,室內設計,裝潢,房地產,設計,室內設計,裝潢,房地產,設計,室內設計,裝潢,房地產,設計,室內設計,裝潢,房地產,設計,室內設計,裝潢,房地產,設計,室內設計,裝潢,房地產,設計,室內設計,裝潢,房地產,設計,室內設計,裝潢,房地產,進修,在職進修,MBA,EMBA,進修,在職進修,MBA,EMBA,進修,在職進修,MBA,EMBA,進修,在職進修,MBA,EMBA,進修,在職進修,MBA,EMBA,進修,在職進修,MBA,EMBA,進修,在職進修,MBA,EMBA,住宿,民宿,飯店,旅遊,美容,美髮,整形,造型,設計,室內設計,裝潢,房地產,進修,在職進修,MBA,EMBA,羅志祥,周杰倫,五月天,蔡依林,林志玲,羅志祥,周杰倫,五月天,蔡依林,林志玲,羅志祥,周杰倫,五月天,蔡依林,羅志祥,周杰倫,五月天,蔡依林