Sergio and the sigil

Thank you LCNUG

Posted by Sergio on 2008-12-19

Thanks to the brave souls that ignored the incredibly exaggerated Winter storm warnings and insane weather forecast for last night. These folks came to the LCNUG meeting and were home before the first snow flake hit the ground. Also, thanks LCNUG for inviting me to talk, I hope you enjoyed at least a little bit.

The material I had to show in my presentation would no doubt fill an entire day (because it came from a full-day class I previously led) but we are not that crazy so we decided that:

  • Doesn't matter how much of the material we cover, what we cover we will cover well.
  • It would be best to talk about less things but get more value out of that than talk about a whole lot of things and feel like you just wasted two hours of your life.
  • Go only as far as our stamina (and storm anxiety) allowed us to.
  • Ask, ask, ask. Don't go back home with any lingering question.
  • Well, keep that under the 2-hour mark, will you?

I never thought we would have enough time to see the entire material or even see some jQuery stuff. But I'm confident that what we have seen there will allow anyone that is starting to take JavaScript seriously to jump on jQuery (or YUI or Prototype.js, etc) and be able to effectively read the docs, the samples, and even the source code.

I'm trying to get clearance with my company to share the presentation material. Either by a download link here or directly emailing the attendees. Sit tight.

Talk: JavaScript - Beyond the Curly Braces

Posted by Sergio on 2008-12-09

Next week I'll be speaking at the Lake County .NET Users' Group, in Grayslake, IL. The topic will be something that is near and dear to me and which I have talked and written about quite a number of times.

If you live in the North 'burbs, come and support our local group. You can register for this event here.

JavaScript - Beyond the Curly Braces

One of the greatest problems with JavaScript is its superficial syntax resemblance of C-style languages. We call it the curse of the curly braces.

That is also a very large source of frustration for developers trying to learn JavaScript beyond the basics. Thinking that JavaScript is somehow related to Java or even "It's almost like C# but a little simpler" is an unfortunate and common occurrence that can only lead to trouble.

In this session we will analyze some of the fundamental differences between JavaScript and C#/Java. We will highlight the pitfalls that can trap us and the appropriate workarounds for them.

Time permitting and if there's interest we will take a look at Idiomatic JavaScript, which will help us understand how JavaScript is being written these days. Learning about this will also help you when trying to read the source code or even the documentation and samples for popular JavaScript libraries like jQuery, Prototype, YUI, etc.

Don't be sloppy in your scripts

Posted by Sergio on 2008-11-14

For a few weeks now, every time I try to logoff from my home banking website something bad happens. See screenshot below.(screenshot eaten by backup failure.)

  1. Firebug opens unexpectedly
  2. There's a frigging debugger; statement in the live production site
  3. The logoff process hangs until I press F8 in Firebug or the continue button
  4. All my information is still on the screen. Imagine if I had just clicked Sign Off and left my desk.

When I saw this for the first time I though: wow, some developer will be slapped for that (actually there are some developer names in the file,) but it seems that nobody else has a debugger enabled or they just hate their clients that are also web developers. The "bug" has been there for at least 2 weeks now.

Even if you don't care for customers that happen to have a debugger like myself, leaving that kind of thing in your production environment immediately projects an image of sloppiness that is the last thing I want to have with my home banking.

Update 11/24/2008: That script was fixed sometime over this past weekend.

Don't tell me you did that with JavaScript

Posted by Sergio on 2008-08-22

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.

Interview for the Prototype blog

Posted by Sergio on 2008-05-13

Recently, Tobie Langel from the Prototype blog asked me to answer a few questions about Prototype.js and my involvement with it.

The interview has been posted today. The folks in the Prototype team have been producing some wicked cool code for a while and they're working on a number of interesting things to enrich the developer experience. I'd advise you to keep an eye on that blog for constant innovation in the JavaScript sphere.