YAGNI, I told them, millennium hand and shrimp!

I am running a long experiment with myself to see whatever you are gonna need YAGNI.

So I went way back to this:

image

And this:

image

This is an application that I am explicitly growing organically, only adding things as I really need them. It is working so far.

Print | posted on Tuesday, October 27, 2009 12:00 PM

Feedback


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 10/27/2009 1:00 PM Graham

Buggrit!


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 10/27/2009 1:41 PM Barry Dahlberg

Gee if you had those all in custom controls you'd be able to make one change to fix all your labels so they are associated with their text boxes...



;)


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 10/27/2009 1:44 PM Barry Dahlberg

Ack, blog ate my HTML, or rather, didn't eat my HTML... should that be HtmlEncoded?


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 10/27/2009 2:21 PM James L

WebForms, I do so hate thee...


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 10/27/2009 2:34 PM Chris Cyvas

Your webform brings all the boys to the yard! ;)

I think the hipster coders might knock a few points off your "cool" factor for displaying such an antiquated technology. At least, that's what they would say. :)


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 10/27/2009 3:11 PM zvolkov

Postbacks? Oh no! Even back in 2000 with classic ASP I always did command/query separation (or controller/view separation). View pages posted their forms to controller pages and controller pages redirected to view pages. You can do webforms but no posbacks for Christ sake!


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 10/27/2009 3:32 PM Ryan Riley

If you are pulling YAGNI, why are you starting with ASP.NET? Why not start with your HTML? After all, ASP.NET is producing HTML forms, which are really just documents with a designated action attribute for processing (which is also optional). So you could in fact just have the form and then create an ASP or ASP.NET page for the processing, then redirect. Or use CGI and really go caveman style. :)

Seriously, though, how did you decide that classic WebForms was YAGNI? On what were you calling YAGNI? MVC? If so, I don't follow the logic as those are two different approaches to achieving the same thing. If you had called YAGNI on ASP.NET in favor of ASP, I would understand (and possibly agree).


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 10/27/2009 4:07 PM Paul

What is this strange MasterPageFile you speak of? All looks a bit new and technical to me :)

Fair play man. If it doesn't change too much and isn't causing sleepless nights, roll with it.


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 10/27/2009 4:23 PM Bradley Landis

zvolkov,

Wouldn't having controller pages and view pages right from the get go defeat the point of the experient. You Aren't Going To Need It! I think ayende is saying, he will gladly refactor to something like that when the need arises, he is just waiting for the need to arise.


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 10/27/2009 6:49 PM Andrew

I know we all hate Web Forms, but really, we don't even know what this project/application is meant to do. If it's 3 web pages that show a grid with a few text boxes, Web Forms will be just fine..


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 10/27/2009 7:42 PM Phil

I am calling YAGNI on this code. Why do users even need to login?


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 10/27/2009 8:23 PM Frank Quednau

Nobody doubts this works, but it's brutal.


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 10/27/2009 9:26 PM Eugene Burmako

I smell duct tape


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 10/27/2009 10:07 PM gunteman

I like it!


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 10/28/2009 2:32 AM Tobin Harris

I like it too, beginners mindset in action. Also better than the 350+ LOC that comes with MVC AccountController (assuming userService isn't a refactoring of that).


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 10/29/2009 4:55 AM Jason Stangroome

I'm really interested to see where this takes you as your application evolves. I presume you're still writing tests.


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 11/1/2009 12:52 AM Chris Smith

If it works, does it matter? I've released a few things built this way and I've never had any trouble. I mean BIG things which have over a million hits a day.

Don't forget:

ViewState == ViewData
Code behind == Controller


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 11/1/2009 5:10 AM Ayende Rahien

Chris,
Your parallels are quite mistaken


Gravatar

# re: YAGNI, I told them, millennium hand and shrimp! 11/1/2009 1:10 PM Chris Smith

I don't think there is a stable definition of MVC in a web context which we can build on. It means different things to different people. Ok slight clarification on my point..

View State <= ViewData. ViewData is actually greater than View State. You have to pass the state via View Data to the view. ASP.Net provides a black box abstraction for this and persists it automatically between requests. The concepts are equivalent and you do spend a lot of time building ASP.Net on top of ASP.Net MVC.

Code behind == Controller. Each is responsibly for managing UI state and interaction with the model. ASP.Net MVC uses request data for state management (you manually recover state). ASP.Net web forms manages state for you.

Same generalised concepts, different application.

MVC is so blurred, it's impossible to take sides.

Comments have been closed on this topic.