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
Don't tell me you did that with JavaScript

This week I experienced something that made me feel more confident about the viability of JavaScript as a first-class language in ASP.NET development. And I'm not talking about JavaScript's capabilities — those I have re-discovered long ago — my concern had always been how well other developers in my team would receive it.

For the last few days I've been meeting with a few other developers in my group, transitioning the support of one of my applications to them. Thanks to our quasi-regular brown-bag sessions, the understanding and acceptance of some architectural traits of the application, like the Repository Pattern and use of IoC containers (Castle Windsor in our case,) were fairly painless.

I always carried that uncertainty that when I started reviewing those .js files with them things could get ugly. These developers are pretty bright, real .NET ninjas, but hadn't yet used a JavaScript library like Prototype (or YUI or jQuery or MooTools or [insert favorite here];) and I used Prototype and script.aculo.us heavily in this project — which should not come as a surprise given some of my involvement with that library.

Unfortunately, without getting into too much analysis of teams and project management, I worked pretty much solo on this project, without enough code reviews and, heaven forbid, zero pairing sessions — again, that's not the point of this post; it's definitely the big reason behind my anxiety, but let it alone for now.

The day finally came for me to explain the UI portion of the application. Everyone thought the richness of the UI, the carefully applied visual effects, and the generally pleasant user experience were very interesting and they were curious to learn how it had been done. They knew I was using some JS library thing but I'm pretty sure they had never seen JavaScript applied to that extent.

I started explaining what is the most important thing for me, that you definitely need to use JavaScript libraries and that it is important to understand the language a little better. Without getting into a JavaScript lecture, we started discussing some of the basic features of Prototype, its global functions, why it does what it does to the native objects, and how JavaScript makes all that magic possible.

As soon as I started showing how clear and well-structured good JavaScript code could be I could see the light bulbs go off and some of those folks — that I knew feared JavaScript for being an unmaintainable mess — suddenly realized that there was this whole new world of production-grade, nice on the eyes, and expressive JavaScript code and techniques that they had been missing out the entire time.

I'm not done showing all the Prototype features used in the project yet, but I'm sure we will cruise through them and also script.aculo.us. Who knows? Maybe we even spend some time understanding JavaScript and its oft-misunderstood prototypal-inheritance model.


Posted 08-22-2008 4:35 PM by sergiopereira
Filed under: ,

[Advertisement]

Comments

DotNetKicks.com wrote Don't tell me you did that with JavaScript
on 08-23-2008 12:01 AM

You've been kicked (a good thing) - Trackback from DotNetKicks.com

Books and bits » Blog Archive » On Sergio Pereira’s - Don’t tell me you did that with JavaScript wrote Books and bits » Blog Archive » On Sergio Pereira’s - Don’t tell me you did that with JavaScript
on 08-23-2008 12:22 AM

Pingback from  Books and bits  » Blog Archive   » On Sergio Pereira’s - Don’t tell me you did that with JavaScript

Dew Drop - August 23, 2008 | Alvin Ashcraft's Morning Dew wrote Dew Drop - August 23, 2008 | Alvin Ashcraft's Morning Dew
on 08-23-2008 10:17 AM

Pingback from  Dew Drop - August 23, 2008 | Alvin Ashcraft's Morning Dew

Chris Sutton wrote re: Don't tell me you did that with JavaScript
on 08-23-2008 11:12 AM

That's great to hear that it made sense without that much effort. I think most people still remember the pain of Javascript back in the late 90s and early 2000s and don't realize that things have really changed for the better in terms of Javascript development.

Chris

Pessimist wrote re: Don't tell me you did that with JavaScript
on 08-23-2008 4:50 PM

I just hope that enough .NET developers realize that Javascript can be useful, before Silverlight comes to wreck the web party.

sergiopereira wrote re: Don't tell me you did that with JavaScript
on 08-23-2008 5:05 PM

@Pessimist

Do you think these same developers that have been avoiding JavaScript will jump on Silverlight? I have the feeling that sooner or later we will see something stupid like ASP.NET controls to wrap Silverlight grids, trees, menus, etc (they might already exist, I'm not paying attention to that yet). Then we could say "Hey, I did all that without writing a single tag of Silverlight/XAML)... I rock!"

For this kind of web developers, both JS and SL don't matter.

Ivanski wrote re: Don't tell me you did that with JavaScript
on 08-23-2008 6:21 PM

The fear of javascript is such a common thing that I come across - all of my current colleagues 'hate' javascript (except the few I have partially converted).

It's no surprise when it's used the way it normally is in web pages - global variables, global functions, no encapsulation, no chance for any form of reuse, etc.

Javascript isn't hard, it isn't weird or strange.  What's weird and strange is the way we tend to use it - in a very similar horrible, nasty, coupled-to-death way we used to use ASP and JSP.

Learning to use the language better and wrapping your head around one the libraries you mention make the whole experience sane, productive, testable, maintainable and cross platform - this hold true for any language, not just Javascript.

I think you should push harder for code reviews and a little pair programming, but I suppose you can't have everything all the time.

Thanks for the article.

Ivan

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)