Showing posts with label General. Show all posts
Showing posts with label General. Show all posts

Thursday, January 13, 2011

ASP.NET MVC - The developer is back in control

ASP.NET MVC excites me more than just about anything Microsoft has released in the past 5 years (well... I do like Silverlight).  As I am new to MVC development, I am very familiar with classic forms of Microsoft web development (classic ASP, and ASP.NET).

A bit of history is in order here
Back in the nineteen hundred and nineties Microsoft released ASP.  At the time it was a very procedural VB scripting language.  You didn't have objects really (COM was available, but not really the same thing) and  debugging was a nightmare.  Anyone other than me remember writing "Response.Write...." 9863454 times trying to figure out where a logic error was?

A little after ASP 3.0 was released Microsoft released ASP.Net 1.0.  All of a sudden all the VB script programmers were in a rough spot.  ASP.Net was a totally new concept in web development.  Not only did you have to learn a new language (VB or C#) but you also lost a lot of control over what was actually rendered to the browser.

So now there is yet another new and very different way of development?
That's right folks!  It's time to role up those sleeves again and dive in.  Only this time Microsoft didn't make any language changes so the learning curve is a bit smaller.  When I first looked at MVC I was a bit skeptical (because who wants to relearn everything they thought they knew about web development....again).  As I was reading about MVC it was like turning over flat rocks in a field hoping there wasn't a snake underneath.  Slowly over time I realized that Microsoft had done something so wonderful that instead of being afraid of what I would find I was destroying all the information I could find on the subject!  I was back in control of exactly what was to be rendered on a page and not only that, I was able to take advantage of object oriented design patterns too. To top it all off MVC allows for better debugging and Unit Testing of my code.

FINALLY!  The developer is back in control!

-M

Wednesday, November 17, 2010

OMG! that's so elegant! or is it?

Ah yes, the term used by developers that pretty much means "I found a cool way to make this reusable, or better, or check this out, or ... etc...".

This term is so often used in the development community that it is nearly meaningless.  You might as well paint one house blue and one house red, and call the red house elegant.  Elegant is an opinion so when you hear the term [elegant] take it with a grain of salt.  What matters when you are developing an application is that the application WORKS (uh oh, I hear the eyes of senior developers rolling).  Yes, of course you want to think through your process and try to make all the parts and pieces as reusable as possible.  However, that doesn't mean your way is wrong because someone tacked the word "elegant" to something they worked on, or look at your code like they just got punched in the stomach because it doesn't match their way of coding.

Here is an example:  Let's say you have a database call that relies on stored procedures as the command source.  How many ways can you think of to make this work?  I suppose you could create a constant "SPROC" variable and assign the stored procedure to it, and assign it to the command text where ever you need to call that stored procedure.  On the other hand you could just as easily say command source = stored procedure.

So which way is better?  It's a simple matter of choice.  However, I bet a certain percentage of people out there have already made up their minds on which is "better", and how their way, not represented in this example, would be "better".  And I imagine there are equally that many excuses as to why.

In conclusion I believe development is a bit like art.  Only the person, or team can decide the elegance of a bit of code.

-Matt