Brendan Tompkins

Sponsors

The Lounge

Wicked Cool Jobs

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Whidbey: Inline Code is now the Default

From “Hardcore Visual Studio.NET” :

“By default, Whidbey creates a Web form using inline coding, not code-behind.  That means your HTML formatting and your code are all in a single file.”
I guess I can understand this.  It may encourage developers to treat aspx classes as true presentation-only code and nudge toward using separate tiers for business logic.  But, I'm really used to using code-behind.  You can, of course, continue to use code behind, but if this is the way of the future, I don't want to create any more code that will have to be converted someday.  Anyone care to chime in on this one?

Posted Mon, Mar 1 2004 7:42 AM by Brendan Tompkins

[Advertisement]

Comments

Paul Wilson wrote re: Whidbey: Inline Code is now the Default
on Mon, Mar 1 2004 3:10 AM
The last I heard was they were thinking of making the default be code-beside for the professional versions and up, while keeping the web-matrix inline style for the basic versions. Also, I think you would certainly be able to change the default no matter what.
Ian O'Rourke wrote re: Whidbey: Inline Code is now the Default
on Mon, Mar 1 2004 3:45 AM
I don't why they would do that. It just seem odd. Doesn't mean they aren't of course.
Ian O'Rourke wrote re: Whidbey: Inline Code is now the Default
on Mon, Mar 1 2004 3:48 AM
As Paul says, hopefull you'd be able to change it. I have a fancy page with cascading datalists on and the codebehind for all the events is complicated enough without sullying it with the html and control code as well in one mega file :)
Brendan Tompkins wrote re: Whidbey: Inline Code is now the Default
on Mon, Mar 1 2004 3:52 AM
Yes.. You'll be able to change it. Although I'm used to code-behinds, and I agree they seem simpler, I'm trying to be more open-minded about this. The reason inline-code sucks currently is because the IDE doesn't present the code to you in a way that is easy to deal with. So, this is mainly an IDE problem and may not have anything to do with separate files per se. And if they could do away with .resx files while they're at it, they may convert me.
Thomas Tomiczek wrote re: Whidbey: Inline Code is now the Default
on Mon, Mar 1 2004 4:45 AM
Also, do not forget that you SHOULD actually have your business logic somewhere separate ANYWAY :-)

SO, this code is left with wireup things.

If the IDE can then "hide" the source in the HTML window, everything is perfect.
Alex Lowe wrote re: Whidbey: Inline Code is now the Default
on Mon, Mar 1 2004 4:47 AM
Brendan, I believe that what you are describing is what they are hitting on - i.e. the IDE will provide the different "views" on the "code". So, you will still get separation in the editor but the code will live in one physical file.
Richard Tallent wrote re: Whidbey: Inline Code is now the Default
on Mon, Mar 1 2004 5:43 PM
THANK YOU MICROSOFT! I've been griping about this for awhile. The code-behind model is silly. Either the code is too tightly-coupled to be in two separate files, or else the code is actually BL and should be elsewhere.

The only reason for code-behinds was an IDE that couldn't hack multiple simultaeous contexts, but the only excuse was that "web designers" could write ASPX files and programmers the CS or VB files, which is a bunch of hooey: design is more about CSS/Photoshop than markup, and ASPX markup includes object instantiation (of controls), something that should be left to the programmers who write the code that implements those objects' behaviors.

Combined with the fact that Windbey controls will now emit well-formed XHTML, I may have some reason to use VS where now I rely 100% on text editors.
Mark Bonafe wrote re: Whidbey: Inline Code is now the Default
on Tue, Mar 2 2004 12:43 AM
This is not really a step forward. It's a step back. I, for one, am glad for it. The IDE was the only reason for creating "code behind" in the first place. Inline is much, much better. It just makes more sense.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Devlicio.us