jQuery: Don’t build websites without it!

jquery For the last few weeks I’ve been using a JavaScript library called jQuery. The more I use it, the more I wonder how I ever built websites without it! Here’s the official description:

jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.

jQuery makes all of your page manipulations easier. Best of all, it does so in a consistent, reliable way across all browsers. No more little hacks in your JavaScript to make something work in both IE and Safari.

In general, I’m a big fan of doing things client-side on the web. That might sound weird coming from an ASP.NET developer, since the whole idea behind ASP.NET’s postback model (called Web Forms) is to make everything happen server-side. I think most experienced ASP.NET developers would agree however, that the postback model is crap. It’s flawed, and if you can avoid it, you should.

We built Podcast Spot in ASP.NET, but we don’t use postbacks. ASP.NET is essentially just our rendering engine. We made use of prototype, another popular JavaScript library, but a lot of the code we wrote is just ugly. I wish I had known about jQuery back then. I’m tempted to rewrite everything using jQuery, but I’m mindful of the “if it ain’t broke, don’t fix it” adage.

It’s very unlikely I’ll be building anything new without jQuery though. That’s how much I love it! Here are my favorite things so far:

  • Works in Internet Explorer, Firefox, Safari, and Opera. Cross-browser support FTW!
  • At just 16 KB for the minified, gzipped version, it has a very small footprint.
  • The API feels natural if you already know JavaScript quite well.
  • Chainability – the magic of jQuery. If you’re familiar with object-oriented programming, you’ll love jQuery.
  • The jQuery UI API is much more consistent and complete than script.aculo.us, and the effects seem much smoother too.

To get started with jQuery, just visit the website. You’ll probably also want to take a look at jQuery UI. The documentation is excellent, and there are quite a few tutorials available online.

Something to keep an eye on: Microsoft Velocity

Last week I heard about a new project from Microsoft code-named Velocity. You can think of Velocity as Microsoft’s version of the very popular memcached:

“Velocity” is a distributed in-memory cache that provides .NET applications with high-speed access, scale, and high availability to application data.

Basically it’s a backend technology that helps to make websites perform better. Instead of accessing the database every time a page is requested, the website can often get the data it needs from the cache which is much faster than accessing the database.

ASP.NET has had caching built-in for years, but it doesn’t work in a server farm. That is, if you have more than one web server, there’s no way for all of them to share the same cache. Velocity makes that possible. For a good technical overview of Velocity, check out this post from Dare Obasanjo. Also check out Scott Hanselman’s podcast interview with two of Velocity’s architects.

We use memcached in Podcast Spot, and we’ve been very happy with it. It’s simple, efficient, and does just what we need it to do. Of course, our memcached installation is no where near the size of Facebook’s. I’ve read in a few places in the past that they run a 200 server cluster with 3 TB of memory solely for memcached. I’m sure it has grown since then too.

I have no idea how well Velocity will perform compared to memcached, or even if it’s full of bugs or not! I am eager to play around with it though, and it’s a project I’ll definitely be keeping an eye on. Velocity is a project from Microsoft that is long overdue, in my opinion.

Twitter doesn’t know what’s wrong

twitter Even occasional Twitter users will no doubt be familiar with the service’s frequent downtime. It’s a rare day when I don’t run into at least one or two “something’s technically wrong” messages on the site. That has prompted a lot of discussion about how to improve Twitter, and also some discussion about how things could be so bad.

I’ve been willing to cut them some slack. They’ve grown exponentially, and continue to do so. Then on Wednesday, Twitter founder Jack posted this on the official blog:

We’ve gone through our various databases, caches, web servers, daemons, and despite some increased traffic activity across the board, all systems are running nominally. The truth is we’re not sure what’s happening. It seems to be occurring in-between these parts.

Transparency is great, but surely they must have some idea about what’s wrong? I don’t know much about their architecture or systems, but it seems odd to me that they’d be totally stumped. It suggests to me that their architecture was never designed, and was instead thrown together over time. Now they’re in too deep to start over.

Twitter developer Alex suggests that the main problem is the system was originally put together as a content management system, when in reality it’s a messaging system. If that’s the case, fine, but messaging systems are not new. They must be able to examine and learn from some existing stuff right?

Posts like the one Jack made don’t inspire much confidence that they’ll be able to turn things around, but I sure hope they do. I really love Twitter. Maybe the $15 million in additional funding that they recently secured will help.

Six months with the day job – no thanks to school

Post Image Today marks six months of me working at Questionmark. I started there in July as a .NET developer, and so far I’m really enjoying it. The work is interesting, and the people are great. After focusing mostly on Paramagnus for the last couple years, I was kinda worried that the transition would be painful, but it hasn’t been.

Of course, transition may not be the best word as I’m still working on Paramagnus too (along with Dickson). Not as much as I used to, obviously, but Questionmark has been very accommodating thus far. The first month or two was a bit difficult, but I have more of a routine now, so that’s good. The vacation last month was a nice break from everything as well.

I think part of the reason that doing both Paramagnus and Questionmark isn’t impossible is that I’ve never worked solely on Paramagnus. Until April of 2007, I was still a full-time university student! And all jokes about skipping class aside, it still required a fair bit of time and effort. So in a lot of ways I have just replaced school with the Questionmark job.

Those of you who know me well know that I do not look back on my time at the University of Alberta with much fondness. I really enjoyed the Economics courses I took and a few of my options were pretty interesting too. My computing sciences classes, on the other hand, were largely a waste of time. I always felt that the things we were learning about were entirely irrelevant! It still bugs me, because I love technology and I love software development but I absolutely hated most of the CS courses I had to take.

I’ve always wondered if any of the CS stuff I learned would be useful in a real job. None of it was at Paramagnus (except maybe the two database courses), but I don’t think that should really count, because I have complete control over our development and how it works. Questionmark should count though, right?

I can honestly say that if I had to rely on the things I learned in computing sciences for my job at Questionmark, I’d be completely screwed.

Instead of a Bachelor’s degree in Computing Sciences, I should have gotten the BFA in Software Development, as described at Joel on Software:

When I said BFA, Bachelor of Fine Arts, I meant it: software development is an art, and the existing Computer Science education, where you’re expected to learn a few things about NP completeness and Quicksort is singularly inadequate to training students how to develop software.

Imagine instead an undergraduate curriculum that consists of 1/3 liberal arts, and 2/3 software development work. The teachers are experienced software developers from industry. The studio operates like a software company. You might be able to major in Game Development and work on a significant game title, for example, and that’s how you spend most of your time, just like a film student spends a lot of time actually making films and the dance students spend most of their time dancing.

That sounds like it might have been useful! Better yet, screw university and just start a company. I mean it – I have learned so much from Paramagnus. I can’t imagine where I’d be had I not started the company. I certainly wouldn’t have a job at Questionmark.

Is it my fault for going to the University of Alberta instead of NAIT? No, I don’t think so. The U of A is supposed to give you the best education possible, but that shouldn’t come at the expense of preparing you for the real world. Will I look back twenty years from now and find value in the CS courses I took? Never say never, but I seriously doubt it. The tech industry changes too quickly.

I think the current education model for software development is horribly flawed. Very few people want to be computer scientists, charged with proving theorems and all that other crap. I think a lot of people want to learn how to develop software, from start to finish. I laughed at first, but I think the BFA in Software Development idea is actually quite good. It could totally work!

If I’m ever in a position to make it happen, I absolutely will try.

Invention vs. Innovation

Post ImageToday Don Dodge posted about a Wall Street Journal article that asks whether Microsoft is driving innovation or playing catch-up with rivals. If I were to ask myself why I read Don’s blog, today’s post would be the answer. Don is careful not to fall into the “Microsoft copies everyone!” or “No they don’t they’re awesome!” traps, and instead gets right to the heart of the matter:

People tend to confuse invention with innovation, as the WSJ has here. They use the words interchangeably, but they are very different.

Invention is the creation of a technology that is totally new. Innovation takes a collection of prior inventions to the next level by combining them with existing products or technologies, and producing a commercially viable product that solves a customer problem.

Both invention and innovation are vitally important to our industry. Microsoft does both but rarely gets credit for it.

I have quoted quite liberally from his post, but I wanted to get all the main points. In the post he also explains how R&D are related to invention and innovation. Definitely go read the entire thing, it’s worth it.

Read: Don Dodge

Microsoft Robotics Studio

Post ImageIf you’ve been reading my blog for the last year or so, you probably know that I quite like robotics. Actually, it was almost exactly a year ago (June 24th) that the Podbot was launched. Basically the Podbot was a podcasting robot – we could control it wirelessly with a laptop, and it had an onboard microphone and webcam. Very cool stuff, but unfortuntely, now out of commission. Andrew, Ashish, Dickson and I all had a blast with the project, though it was quite a bit of work.

Looks like the next robot we build might be a little easier! Earlier today at the RoboBusiness Conference and Exposition 2006, Microsoft introduced a community technology preview of Robotics Studio:

“Microsoft sees great potential in robotics, and we are excited to deliver our first CTP of Robotics Studio, making it easier to create robotic applications across a wide variety of hardware, users and scenarios”, said Tandy Trower, general manager of the Microsoft Robotics Group at Microsoft. “We’ve reached out to a broad range of leading robotics companies and academics early on in the development process and are thrilled with the positive response from the community.”

Microsoft also featured a bunch of third party demos at the event. This is pretty exciting stuff for a hobbyist like myself! I’m going to install the CTP and check it out. You find out more on the project at MSDN, and at the official team blog.

Read: Microsoft PressPass

WinFX renamed .NET Framework 3.0

Post ImageIn a fairly quiet announcement, made on a blog (noteworthy all by itself!), Microsoft has decided to rename their next development platform from WinFX to the .NET Framework 3.0. While it won’t affect the average user, it has created quite a discussion for developers:

The .NET Framework has always been at the core of WinFX, but the WinFX brand didn’t convey this. The brand also created an unnatural discontinuity between previous versions of our framework and the current version.

With this in mind we have decided to rename WinFX to the .NET Framework 3.0. .NET Framework 3.0 aptly identifies the technology for exactly what it is – the next version of our developer framework.

We are confident that this change will go a long way towards reducing confusion people may have about our developer platform and the technologies in which they should invest.

.NET Framework 3.0 will include the existing .NET 2.0 components, WPF, WCF, WF, and WCS. Most people seem to think this is a bad idea (judging by the comments on these posts), and here’s why:

  1. The runtime is still at version 2.0, even in .NET 3.0 – sounds more confusing than helpful!
  2. Everything will be put into the %windir%\Microsoft.NET\Framework\V3.0 directory. Again, confusing!
  3. As the release is built on .NET 2.0, it will include C# 2.0, and not C# 3.0, creating more confusion for down the road.
  4. The new stuff (W**) was never intended to be backported to Windows 2000, only Windows XP and Windows Server 2003 but .NET 2.0 fully supports all three. Presumably, this means support for Windows 2000 has been dropped.

Initially I agreed that the decision wasn’t a good one, but after thinking about it more, I think it was actually a good call on Microsoft’s part. This is about the development platform. When developing for WinFX, it’s better to think of it as a new platform, not just a superset of the old platform. Despite .NET 2.0 being at it’s core, developers are indeed using .NET 2.0 plus a bunch of other stuff when developing for WinFX. Naming the platform .NET 3.0 conveys this much more clearly.

Some of this is still confusing (such as, will .NET 2.0 be installed into both a V2 and a V3 directory, or just one of the two?) but I think in the long run this is good. It’s also the first time a lot of people will think of the .NET Framework as a product in and of itself, and when you do that, you realize it doesn’t matter what version the innards have. The other nice thing is that we’ll get a single installer now, instead of three or four.

I guess my main concern is that the size of the framework is going to start to balloon. Well, that and we have no idea what version of the framework the next release of Visual Studio, codenamed “Orcas”, will ship with. Presumably the change doesn’t affect the release date for Vista.

Flickr Gamma

Post ImageFlickr launched a new redesign yesterday, and upgraded the site from Beta to Gamma. I heard the redesign mentioned at Mesh by Chris Messina, who wasn’t exactly ecstatic about the changes. I for one love the new design, and think it is long overdue!

  • The menu at the top has been simplified and now contains dropdown menus to access various areas of the site. I found the old, two-tiered menu structure kind of confusing, so for me, this is a welcome change.
  • Search has been improved, and no longer just looks in tags.
  • There’s a new person menu on buddy icons.
  • Your Photos now shows to columns of photos instead of just one.
  • The Organizr is vastly different, and I haven’t really had a chance to play with it yet.

Great job Flickr, keep it up! I hope the site does eventually leave it’s greek editions to go final, but at least they are not stuck on beta forever. Perhaps a lesson (and new model) for others to follow?

Read: Flickr Blog

Hold developers liable for flaws?

Post ImageThat’s what one so-called “expert” thinks should happen. While most people will agree that security is a major issue, not everyone agrees on what should be done to combat security problems. This suggestion has got to be the most creative and ridiculous one I’ve come across:

Software developers should be held personally accountable for the security of the code they write, said Howard Schmidt, a former White House cybersecurity adviser.

Speaking Tuesday at the SecureLondon 2005 conference, Schmidt, who is now CEO of R&H Security Consulting, also called for better training for software developers. He said he believes that many developers don’t have the skills needed to write secure code.

If we’re going to hold software developers liable for their code, why don’t we hold users liable for their mistakes and errors too? Heck, why stop there! We might as well hold the farmer who grew the potatoes used in McDonald’s french fries liable for making people fat! Seriously, Schmidt is just way off base with regards to the liability issue. Training is one thing, liability is quite another.

You just can’t look at a piece of code and say with absolute certainty that it’s secure, even if you have proper security training. First of all, the developer cannot anticipate all of the ways in which the code might be used, nor can he/she predict what future technologies might impact the code. Secondly, there is quite often more than one developer who touches a piece of code, so it may not be written with the same caution or mind for security each time. There’s just too much uncertainty. Software development is often called “Computing Science” but a large portion of it is more “art” than “science”.

Read: CNET News.com