The Artima Developer Community
Sponsored Link

Artima Developer Spotlight Forum
Michael Feathers on Patronizing Language Design

37 replies on 3 pages. Most recent reply: Jul 30, 2009 12:36 AM by Darko Latkovic

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 37 replies on 3 pages [ 1 2 3 | » ]
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Michael Feathers on Patronizing Language Design Posted: Jul 14, 2009 7:45 PM
Reply to this message Reply
Advertisement

One of the more interesting aspects of Ruby is that it imposes very few restrictions on the developer: A Ruby programmer can do almost anything, including changing classes at runtime, redefining methods, and so on. Indeed, many Ruby libraries cleverly take advantage of that freedom to create a pleasant developer experience. While Ruby imposes very few restrictions on the programmer, other languages are more concerned in their designs with preventing programming errors, writes Michael Feathers in a recent blog post, Ending the Era of Patronizing Language Design:

In many language communities, people are very concerned with the “right way” to do things. They learn all of the warts and edges of the language and they anticipate the ways that features could be misused. Then, they starting writing advice and style guides — all the literature which tells you how to avoid problems in that language. The advice goes on and on... If a language gives you mechanisms to enforce design constraints, it doesn’t feel quite right to not use them...

In some languages you get the sense that the language designer is telling you that some things are very dangerous, so dangerous that we should prohibit them and have tools available to prohibit misuse of those features. As a result, the entire community spends a lot of time on prescriptive advice and workarounds. And, if the language doesn’t provide all of the features needed to lock things down in the way people are accustomed to, they become irate...

If something goes wrong you have only yourself to blame. You can’t blame the language designer for not adding a feature because you can do it yourself, and you can’t blame him for getting in your way because he didn’t... So, why aren’t more people crashing and burning? I think there is a very good reason. When you can do anything, you have to become more responsible. You own your fate. And, that, I think, is a situation which promotes responsibility...

It is possible to create a mess in every language. Language designers can’t prevent it. All they can do is determine which types of messes are possible and how hard they will be to create. But, at the moment that they make those decisions, they are far removed from the specifics of an application. Programmers aren’t. They can be responsible. Ultimately, no one else can.

What do you think of Michael Feathers' comments on "patronizing" language design?


Erik Engbrecht

Posts: 210
Nickname: eengbrec
Registered: Apr, 2006

Re: Michael Feathers on Patronizing Language Design Posted: Jul 14, 2009 8:52 PM
Reply to this message Reply
Ahh yes...a developer's freedom to express himself should be achieved by taking away his freedom to express invariants in his code. Makes perfect sense to me.

Dick Ford

Posts: 149
Nickname: roybatty
Registered: Sep, 2003

One size doesn't fit all Posted: Jul 14, 2009 10:58 PM
Reply to this message Reply
But if he feels that Python or Java are too patronizing, why not move further down the spectrum of non-patronizing languages, and program in Common Lisp?

George Sakkis

Posts: 14
Nickname: gsakkis
Registered: Jun, 2007

Re: One size doesn't fit all Posted: Jul 15, 2009 12:56 AM
Reply to this message Reply
> But if he feels that Python or Java are too patronizing,
> why not move further down the spectrum of non-patronizing
> languages, and program in Common Lisp?

Or further up; C/ASM are less patronizing regarding memory management or code jumps. Implying that the higher the level, the less patronizing the language, seems... patronizing :)

Kay Schluehr

Posts: 302
Nickname: schluehk
Registered: Jan, 2005

Re: Michael Feathers on Patronizing Language Design Posted: Jul 15, 2009 3:30 AM
Reply to this message Reply
Without bondage & discipline you are not an "engineer" or come even close but an "artist" or worse: a "cowboy coder". It's almost like a class distinction.

Jason Young

Posts: 6
Nickname: apollodude
Registered: Dec, 2008

Re: Michael Feathers on Patronizing Language Design Posted: Jul 15, 2009 6:46 AM
Reply to this message Reply
It seems that languages focused on preventing you from doing the wrong thing (e.g. Java) receive harsh criticism, whereas languages focused on enabling and encouraging you to do the right thing (e.g. Scala) receive much praise. Different still are languages that encourage you to do stupid things like cast a pointer to an integer or vice-versa (e.g. C), which are languages that frequently come under attack.

Nemanja Trifunovic

Posts: 172
Nickname: ntrif
Registered: Jun, 2004

Re: Michael Feathers on Patronizing Language Design Posted: Jul 15, 2009 7:10 AM
Reply to this message Reply
I have always felt that it was not a business of a programming language to make up for deficiencies in the development practices. There are coding standards, code reviews and automated tests to prevent developers from "shooting themself in a foot"; if they are missing, you can restrict your language all you want - the damage is just waiting to happen.

Erik Engbrecht

Posts: 210
Nickname: eengbrec
Registered: Apr, 2006

Re: Michael Feathers on Patronizing Language Design Posted: Jul 15, 2009 7:15 AM
Reply to this message Reply
> I have always felt that it was not a business of a
> programming language to make up for deficiencies in the
> development practices. There are coding standards, code
> reviews and automated tests to prevent developers from
> "shooting themself in a foot"; if they are missing, you
> can restrict your language all you want - the damage is
> just waiting to happen.

I have always felt that it's better to burden a computer with a tedious task than a person. Therefore, it's not the business of a development process to make for deficiencies in a programming language.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Michael Feathers on Patronizing Language Design Posted: Jul 15, 2009 10:21 AM
Reply to this message Reply
When I read this, all I can do is hope that I never again have to maintain the code of free-spirit developers. Their dreams become my nightmares. A lot of the time, developers who complain about language restrictions want to do things that add little to no value while creating havoc for other developers. Whenever people work or live as a group, they must give up some personal freedoms. What is so hard to understand about this?

I think one of the comments on the blog sums this up nicely:

I’d really like to believe that Ruby has a culture of 
responsibility, but I don’t think that’s accurate. I’ve
debugged plenty of problems in Ruby applications which were
caused by a third-party library taking liberties with other
people’s code [...] each time I had to hot-patch the code
myself until the library was updated. That’s not
responsibility in the positive sense; it’s responsibility
in the sense of “no one else will fix this if you don’t.”

I think that Ruby has more of a culture of permissiveness
than responsibility. Just about anything is acceptable, and
rather than complaining about another library’s bad
behavior you should write your own version with its own bad
behavior.


Sometimes it's good to impose restrictions and sometimes it's good to relieve them. There are benefits and costs to both. There is no one correct answer.

Nemanja Trifunovic

Posts: 172
Nickname: ntrif
Registered: Jun, 2004

Re: Michael Feathers on Patronizing Language Design Posted: Jul 15, 2009 10:34 AM
Reply to this message Reply
> Whenever people work or live
> as a group, they must give up some personal freedoms.
> What is so hard to understand about this?

Absolutely! I am just saying that it is hard for a programming language designer to guess the right set of restrictions for any organization that may use the language. If a language is flexible, it does not mean that your organization's code standard needs to be flexible; it just means that a single language can cover different scenarios of usage.

Merriodoc Brandybuck

Posts: 225
Nickname: brandybuck
Registered: Mar, 2003

Re: Michael Feathers on Patronizing Language Design Posted: Jul 15, 2009 10:36 AM
Reply to this message Reply
I think Michael Feathers likes what he likes and holds things he doesn't like in contempt. I don't get his reasoning in some cases.

ActiveRecord and I, for example, have never gotten along very well. I think calling it powerful is laughable. It's at least as binding, if not more so, than the things he disparages in other languages. Using active record for database access is like eating steak with a balloon on your tongue.

I think his note of C++ not having reflection is self serving and leaves out the importance of overhead. C++ is meant to be for high performing applications and systems programming, among other things. Ruby is not.

Stroustrup had this to say about reflection and C++ http://www.research.att.com/~bs/omo_interview.html

"OMO: I agree. I believe high-level structures, especially with the help of generic collection classes, should almost always replace pointers in code. Java has a small reflection package in 1.1: Have you ever considered adding reflection to C++?

BS: Often. However, I have not seen an approach to full reflection directly supported by a language that didn't cause serious overheads. Also, reflection seems to encourage styles of programming that make it hard to determine what's going on from the source text and discourage static checking. I see that as a problem. Consequently, the C++ RTTI provides only the minimal information to determine the types of objects at run time. Where necessary, this can be used as a handle for more information about types (classes), but any such information is beyond what the standard guarantees."

Fortunately languages aren't designed in an academic vacuum where all things are made possible without regard to cost. To say that C++ tries to prevent people from doing unsafe things borders on laughable. C++ gives you enough rope to hang yourself and several of your friends without too much effort if you aren't careful. I would bet an irresponsible C++ program would die waaaaaaaaay before an irresponsible Ruby program any day of the week. Yes Stroustrup says there are things he doesn't like about reflection, but there are other things us folks in the real world have to worry about other than academic purity (or what Feathers considers "good") when it comes to getting a job done.

That post/article really feels like it is nothing more than the general "the stuff I like rules, the stuff I don't like sucks" garbage you see regarding technology these days. I think the assumption that language design decisions to restrict things, make some things hard to do, or not implement some feature results in "a decreased sense of responsibility and ownership" is fundamentally flawed.

One can easily turn his argument on its head and ask if Ruby makes one's sense of responsibility and ownership decreased because of a lack of manual memory management? After all, Yaz has decided I don't need to worry about taking care of myself regarding how I use it. Does Rails cause this problem with web apps? Rails is pretty damn particular in what it expects. You try not following the Rails naming conventions and MVC pattern and see how far you get. I'm sure Mr. Feathers will argue that these things are tools to help you get your job done in some way that is "better" than you could get it done without them. If they were <insert language other than Ruby here> features they would prevent you from being responsible and owning your work.

If you look at the comments following the post, you'll see he backs up on some of his points and questions things he doesn't seem to really understand, like how could pointers really be useful.

"Laurent: I knew someone would bring up that point. Although, I thought their example would be pointers rather than goto. Frankly, I think goto is okay to have in a language for the odd cases when you feel you have to use it. Raw pointers in a managed memory language, on the other hand, are a harder issue. The question is really whether you can do anything useful with them."

It seems like pointers are becoming like macros in lisp. People that don't use them can't wrap their head around why they might be useful and how powerful they really are.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Michael Feathers on Patronizing Language Design Posted: Jul 15, 2009 10:55 AM
Reply to this message Reply
> > Whenever people work or live
> > as a group, they must give up some personal freedoms.
> > What is so hard to understand about this?
>
> Absolutely! I am just saying that it is hard for a
> programming language designer to guess the right set of
> restrictions for any organization that may use the
> language. If a language is flexible, it does not mean that
> your organization's code standard needs to be flexible; it
> just means that a single language can cover different
> scenarios of usage.

We've been through this before. I believe the costs of every organization creating their own standards outweighs the benefits. The downsides of many features are not well understood until they are deeply entrenched in code and most organizations would prefer to focus their resources on building systems instead of making rules about how systems should be built.

I will say, however, that the idea of standard sets of restrictions that could be adopted and automatically enforced by different organizations is intriguing but I have doubts about how well that would really work out.

Merriodoc Brandybuck

Posts: 225
Nickname: brandybuck
Registered: Mar, 2003

Re: Michael Feathers on Patronizing Language Design Posted: Jul 15, 2009 11:07 AM
Reply to this message Reply
> > > Whenever people work or live
> > > as a group, they must give up some personal freedoms.
> > > What is so hard to understand about this?
> >
> > Absolutely! I am just saying that it is hard for a
> > programming language designer to guess the right set of
> > restrictions for any organization that may use the
> > language. If a language is flexible, it does not mean
> that
> > your organization's code standard needs to be flexible;
> it
> > just means that a single language can cover different
> > scenarios of usage.
>
> We've been through this before. I believe the costs of
> every organization creating their own standards outweighs
> the benefits. The downsides of many features are not well
> understood until they are deeply entrenched in code and
> most organizations would prefer to focus their resources
> on building systems instead of making rules about how
> systems should be built.
>
> I will say, however, that the idea of standard sets of
> restrictions that could be adopted and automatically
> enforced by different organizations is intriguing but I
> have doubts about how well that would really work out.

When did this turn into a discussion about C++???

that's a little joke....

Nemanja Trifunovic

Posts: 172
Nickname: ntrif
Registered: Jun, 2004

Re: Michael Feathers on Patronizing Language Design Posted: Jul 15, 2009 11:14 AM
Reply to this message Reply
> When did this turn into a discussion about C++???
>
> that's a little joke....

I was under impression we were discussing Ruby vs Python here :)

Cameron Purdy

Posts: 186
Nickname: cpurdy
Registered: Dec, 2004

Re: Michael Feathers on Patronizing Language Design Posted: Jul 15, 2009 12:41 PM
Reply to this message Reply
> Without bondage & discipline you are not an "engineer" ..

That quote absolutely made my day. Thank you :-)

Peace,

Cameron Purdy | Oracle Coherence

Flat View: This topic has 37 replies on 3 pages [ 1  2  3 | » ]
Topic: Laurence Vanhelsuwé on Java Collections Pitfalls Previous Topic   Next Topic Topic: Two-Way Data Binding in Flex 4

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use