Ayende @ Rahien

It's a girl

When the design violates the principle of least surprise, you don’t close it as By Design

I don’t actually have an opinion about the actual feature, but I felt that I just have to comment on this post, from Brad Wilson, about the [Required] attribute in ASP.Net MVC 2.

Approximately once every 21.12 seconds, someone will ask this question on the ASP.NET MVC forums

The answer is the title of this blog post. ([Required] Doesn’t Mean What You Think It Does)

If this is the case, I have to say that the design of [Required] is misleading, and should be change to match the expectations of the users.

We have a pretty common case of plenty of users finding this behavior problematic, the answer isn’t to try to educate the users, the answer is to fix the design so it isn’t misleading.

I am pretty sure that when the spec for the feature was written, it made sense, but that doesn’t mean that it works in the real world. I think it should either be fixed, or removed. Leaving this in would be a constant tripwire that people will fall into.

Comments

Barry Dahlberg
01/21/2010 09:16 AM by
Barry Dahlberg

Possible alternate names for the attribute:

[Required_NotReally], [Maybe], [HahaFooledYou]

spmason
01/21/2010 09:18 AM by
spmason

I couldn't agree more

Mark
01/21/2010 09:35 AM by
Mark

I agree completely. In my opinion, not fixing issues like this when there is still the chance to do so (i.e. before a final release) is somewhat of an oversight.

In this particular case, I understand some of the points being made and the decisions behind them. However the fact still remains - understanding this behaviour hinges on knowing the reasoning behind it and this seems wrong. As you have said, the design should not be misleading. I'm sure it would have been possible to gather ideas from all those concerned and come up with a solution which pleases more people.

Sean Gough
01/21/2010 03:17 PM by
Sean Gough

Well said! If people get this wrong more that 4,000 times a day then that's a pretty good indication that the attribute is named incorrectly!

To quote Inigo Montoya:

"You keep using that word. I do not think it means what you think it means."

Justice~!
01/21/2010 05:07 PM by
Justice~!

I agree entirely man. That is crazy.

Borek
01/22/2010 06:33 PM by
Borek

Brad explains in his post why it's not easy / possible to change the Required attribute now.

Moutasem al-awa
01/24/2010 08:51 AM by
Moutasem al-awa

Man, cant they mimic RubyOnRails if they can not design their own API, as you said its misleading and you should have a separate Flowchart to know whether its satisfying the simple need for validation or not. Complex solution for a simple problem :) MSDN way

Comments have been closed on this topic.