ASP.NET: Snakes on a framework!

It was about four years ago that I left my religion.  No not the one dealing with God (that happened much earlier), the one dealing with code.  You may be familiar with some of the commandments:

  • There are no bad languages, only bad programmers
  • Logic must be layered, data must be abstracted and design must be separate
  • Parameters and Methods must be explicitly set and invoked

I had been working at a small web development for about 3 years and was frustrated with the fact much of my time - too much - was spent fixing bugs.  At the time most development was in perl, some php.  I knew what I was doing, and yet bugs were under every function.  On top of that I yearned for the mythical object of the orient to appear, that would help me reuse my code from project to project.  So I smashed the stone tablets and went looking for the truth.

I came back from my journey enlightened.  Python was the direction of the future - if not for the language itself then for the concepts.  A language should provide as much logic as possible, a framework even more.  The less code you write, the less bugs you write - it's that simple.  The less code, the faster the feature is implemented.  The faster the features, the more you get time for.  Why, in 2006, should I be dealing with table tags and counting colspan's?  If the table is driven by an SQL query, why can't I say "here is the SQL query to make the table from."  Oh, give me paging support, row selection, and um... alternate the row colors.  That would be terrific, okay?

I became involved in a python web framework called Albatross, and later used it to start SnakeSkin.  The goal was to build a framework that offered more than places to stick your objects and a few if / for loops in the templates.  It should have support to tie select boxes to SQL statements, validate user input, send email messages.  It should generate html based on abstract concepts, such as "make me a table" or "build a navigation tree".  Use intelligent default actions and setting versus having to explicitly define the most common case.  As we added things to our little framework I realised the 80/20 rules were in play - only worry about designing the framework to support 80% of the needs, and leave a work around for the last 20%.  I also learned that 80% of the time you think your problem is in that 20%, you're going about things the wrong way and a change now will save 80% of your time debugging 20% of the code.

Then, I was fired.  I never got a real reason; I think it was because I made too much money with my less than average salary.  Or it was letting management know I thought the perks and selling company time for free landscaping of their houses was hurting profits.  Or that they were letting all our great, talented, award-winning people get away because they were being too cheap to pay more than poverty level wages.  Or I talked about a game once during lunch...

That marked the end of my python time, and soon I switched into .NET 2.0.  I found that many of the things we were doing in SnakeSkin were done in .NET.  Microsoft had tossed aside the commandments as well and were making - what I truly feel - the best framework out there.  Well, almost the best - many of the cool things in python could not be done in .NET because it doesn't support dynamic languages.  Until today.

Microsoft is now hiring people with the purpose of bringing python support to .NET.  Ruby is coming too, details on a blog aptly called, "Less is better".  Will this make the fall release of .NET 3.0?  It's hard to say, but it looks promising.  If you take a sit back and recall the the .NET framework covers more than just the web - let the idea of windows thick apps with python soak in - you'll agree that we can wait a bit longer if we have to.

Posted By Mike On Thursday, August 10, 2006
Filed under asp.net python | Comments (5)

Submit this story to DotNetKicks   

Daryl - Friday, August 11, 2006 1:56:34 PM

Traitor.

Daryl - Friday, August 11, 2006 2:00:26 PM

Uhh, just kidding. I'm not *really* a zealot, though I do personally find that I'm more productive on a Linux desktop. From all I've heard you say about .NET, it sounds like it's really a winner. The combination of a great framework and an IDE built to be productive working within that framework can't help but make for a good dev environment.

Mike - Friday, August 11, 2006 3:53:26 PM

When I was last in linux, Komodo from active state was a very good IDE. Eclipse for Java is pretty sweet, and I know they have python plugins I just haven't tried them. Microsoft gives away a free version of Visual Studio now, so that makes them no worse than Sun in terms of talking open, but not really being open. Still not true open source - but have ya seen Atlas? =p

Gabriel. - Thursday, August 17, 2006 5:43:00 PM

(Forgive my ignorance of .NET with the following as it appears you have to know .NET to understand what the hell they're talking about...)

Hasn't there from the beginning been support for languages like Python inside .NET? In the .NET 1.1 books I borrowed a long ass time ago python was always in their examples of other example languages you could use ("VB/Java/C#/C++/Python/...").

And also forgive my ignorance but... how does using python/ruby syntax in .net even matter? Their one example given is linked here: http://blogs.msdn.com/joelpob/archive/2004/03/31/105282.aspx#434730

but I suppose I don't know even enough .NET to know why their code example isn't ridiculous cumbersome. Is "DynamicMethod" how you guys have to make anonymous functions or...?

Mike - Thursday, August 17, 2006 6:53:05 PM

There was the claim before, and Active State tried to make Perl.NET, Python.NET and gave up. The reason is python and perl (and ruby) are dynamically typed, the others are not. In python, a variable is a string, int, or custom object by the value placed in it during run time. So to make in work in 1.1, they had to strongly type python, which meant all that amazing stuff python does because it's "type commando" had to come out - Active State said what's the point of that? Python also loads modules at run time, they are not statically compiled.

The code you're looking at is internal framework stuff. Unless you want to add language support for another language, you'll never need that. All you'll do is put <page language="python"> in a config file.

In terms of SnakeSkin, this is to a template file and it's page module.

Leave a comment



Your name:
 

Your email (not shown):
 
Will display your Gravatar image.

Your website (optional):



About Michael

Michael C. Neel, born 1976 in Houston, TX and now live in Knoxvile, TN. Software developer, currently .Net focused. Board member of ETNUG and organizes CodeStock, East Tennessee's annual developers conference. .Net speaker, a Microsoft ASP.NET MVP and ASPInsider. Co-Founder of FuncWorks, LLC and GameMarx.

Proud father of two amazing girls, Rachel and Hannah, and loving husband to Cicelie who inflates and pops his ego as necessary.

 Subscribe to ViNull.com |  Comments

Follow me on Twitter | Contact Me

Related Posts

ASP.NET Security Vulnerability

Yesterday a vulnerability was disclosed at a security conference that enables an attacker to gain the Machine Key of an ASP.NET website.  This key ... Read more

ASP.NET: Cannot use a leading .. to exit above the top directory

This is a really quick post, mostly for myself so the next time I have this issue I can find the answer (yes, I often search my blog before google). The ... Read more

ASP.NET: Creating a UserControl with Child Content

I love ASP.NET User Controls, aka “ascx” files.  These little guys are great for reusable content and dividing up the components of a website.  ... Read more

ASP.NET SEO Interview on Polymorphic Podcast

Craig Shoemaker just posted the latest episode of the Polymorphic Podcast: ASP.NET SEO - Interview with Michael Neel.  Yes, I've now appeared in a ... Read more

Google Can You Hear Me?

In June of 2006 I wrote an article titled "Google Can You Hear Me? How to design URLs that are search engine friendly" that also included a sidebar titled ... Read more

XNA 3D Primer by Michael C. Neel

XNA 3D Primer by Michael C. Neel
Buy Now: [ Amazon ] [ Wrox ]

GameMarx

CodeStock

ASPInsiders Member

ETNUG Member