From: Dave Thomas Date: 2001-10-27T13:40:16+09:00 Subject: [ruby-talk:23594] Re: Ruby and Python: a fuzzy question Kevin Smith writes: > Ok, Dave. Enough other people have shared. What are your thoughts? Fuzzy :) For me, programming is 100% communicating. Coding is about expressing ideas and intentions, either on behalf of someone else or (when you're lucky) yourself. In this way, coding is like writing or (to use Chad's experience) composing music. When you write, you use different styles. A contract is written using different language than a ghost story. Your first love letter uses different writing techniques, words, phrasings, and images compared to your first letter of complaint to some vendor (at least it does if you want to be around to write a second love letter). The same is true of programming. As developers, we have to be able to write in different styles, to express ourselves using different idioms. Sometimes, the style is so formalized we use special-purpose programming languages: IDL for expressing CORBA interfaces, YACC for grammars, and so on. But the majority of the time we're not so lucky. Instead of using a specialized tool, we're left trying to impose a style on some general-purpose programming language, a C, Java, Perl, Ruby, ... This takes effort (even if it is sometimes subconscious), and that effort results in inefficiencies and frustrations. The language is a barrier to creative expression. Part of the effort is in the translation process itself: the higher level the language (in general) the less effort required to achieve a result. However, the level of the language is only part of the inefficiency. There's also a significant loss which results from the impedance mismatch between your internal model of the problem you're solving and the way the programming language lets you express that model. And I think that's where the imponderable personal side of it comes in. The higher-level the language, the more you can get done in a given number of statements. But because those statements are more expressive, there's also a higher risk of the impedance mismatch: if you and the language designer don't think the same way, you'll be constantly battling against his or her abstractions. (I think this is also why people are less passionate about languages designed by committees: the languages are bland because the inputs of multiple designers tend to average out). So, a good general purpose language will allow you to express ideas compactly (that is, it will be at a high level) but will also allow you to express ideas _your_ way (reducing the impedance mismatch). With languages designed largely by individuals (such as Perl, Python, and Ruby), the latter boils down to the philosophical compatibilities between you and the language designer. I can't speak for Perl or Python: I've never spoken with Larry Wall or GvR. But I do know some of Matz's philosophy when it comes to Ruby. He wanted to design a human-oriented language, a language that embodies some of the contradictions we all share. As a result, Ruby is simple enough to be usable, but not so simple that it is boring. It's consistent enough to be easy to learn, but ambiguous enough to give you freedom of expression. It's got a strong theoretical base, but comes across as a street-wise pragmatic scripting language: you don't need to know the meta-class model to produce great Ruby code. And I think Matz succeeded. For me at least, working with Ruby is like communicating my ideas to an old friend: I can express myself using short cuts and generalizations, because we have a shared understanding of the world. At the same time, I can communicate subtleties. The experience is efficient, effective, and rewarding. When I code in Java, I often feel like a carbon-based mechanical translator, trudging through the motions to churn out more code. When I code in Ruby, I feel like a creative human being. Clearly, other people find the same feeling with different languages. For them, these languages meld more closely with their way of expressing themselves. For this reason, discussions on "my language is better than your language" are about as useful as "my favorite color is better than your favorite color." Finally (loud cheers all round), a speculation: Ruby is designed to be human-oriented, and attracts a group of people who claim pretty universally that coding Ruby makes them feel happy. At the same time, Ruby folks (as exemplified by this list) are regularly complimented as being the one of the nicest and most supportive online communities around. Coincidence? Cheers Dave