Categories
Uncategorized

The Best “Chapter One” I’ve Ever Read

This article also appears in Canadian Developer Connection.

Cover of "Professional ASP.NET MVC 1.0"

As a rule, Chapter One of most programming books seems to leave me with a vague, unsatisfied feeling. I usually finish them with either:

  • A “Hello World”-style application that provides an initial “It compiled!” rush, but little else, or
  • A “Trees dies for this?” sort of indignation, if the chapter is one of those perfunctory one with a name like “Getting Started” that provides the same information you gathered while deciding whether to buy the book.

Based on these experiences, I think I can be excused for being a bit skeptical when I read the announcement that Chapter One of Professional ASP.NET MVC 1.0, published by Wrox, was being made available for free download. Of course they’re giving it away for free, I thought, it’s the chapter that’s worth nothing!

A quick aside: If you haven’t heard of ASP.NET MVC, it’s Microsoft’s answer to the MVC-based frameworks that are all the rage these days, such as Ruby on Rails and Django. It’s not a replacement for ASP.NET, but an alternative; if you want to build applications following the REST paradigm, with fine-grained control over the flow of your application and HTML and want to do things “the web way” as opposed to a more “desktop app” way, you should seriously consider trying it out. (For more detailed pros-and-cons considerations of ASP.NET versus ASP.NET MVC, see this article in Nick Berardi’s Code Journal.)

Luckily, curiosity got the better of me and I downloaded the chapter. I got my first sign that wasn’t your garden-variety Chapter One when I looked at the file size and page count. 14 megabytes? 196 pages? Something strange was going on here. Perhaps a glitch during the download?

Once I scrolled past the cover page, the standard Wrox cover featuring the authors and their impressively receding hairlines (hence the nickname for the book, “The Gang of Foreheads”), I hit the introductory paragraph:

The best way to learn a new framework is to build something with it. This first chapter walks through how to build a small, but complete, application using ASP.NET MVC, and introduces some of the core concepts behind it.

That’s right: rather than provide some long-winded perfunctory history of the Model-View-Controller framework, the backstory of how the ASP.NET MVC framework came to be or some simple “Hello World”-style example app of little consequence and requiring less effort, the authors decided to get right down to business and show you how to build an ASP.NET MVC web app. This was a surprise – but a very welcome one!

NerdDinner screenshot

The application that you build is called “NerdDinner”, a site that lets techies declare Meetup.com-style gatherings and RSVP for them (you can see the finished product in action at NerdDinner.com). You start at ground zero,  “File –> New…”, and from there, you build the app with just enough asides to explain a few vital concepts and very few of those false detours that some tutorials lead you down. NerdDinner may be a simple app, but it covers a lot of ground:

  • From the basics of CRUD application design in an MVC web framework
  • to matters of input validation,
  • to registering, authenticating  and authorizing users
  • to integrating Ajax-enabled forms and an Ajax map
  • to the built-in unit testing features of ASP.NET MVC.

By the end of the chapter, you’ve got a nice little application that lies in the “sweet spot”. It’s small enough for you to be able to learn from quickly, yet big enough to show you the ropes behind building the important parts of a CRUD web application that’s ready for public consumption.

download_chapter_1I’ve tried out a number of ASP.NET MVC tutorials, and this one’s my hands-down favourite. It’s written by the people behind ASP.NET MVC, it covers a lot of ground, the finished app is an excellent basis for your future projects, there’s a working version online that you can use as a guide and  the code works! Even better, this single chapter that packs all this value is free-as-in-beer. I’m sure I’ve paid  for whole books that have imparted less knowledge than this single free chapter.

If you’re interested in learning about ASP.NET MVC, download Chapter 1 of Professional ASP.NET MVC 1.0 [13.8 MB PDF] and give it a try. It’s the fastest way to get both a working ASP.NET application and up to speed on Microsoft’s new web application framework. And be sure to tell me how it worked out — if you have any questions or comments, or run into any difficulty with the chapter, let me know – drop me a line via email, send me a tweet or give me a shout-out in the comments.

Categories
Uncategorized

“Canada’s Next Top Model View Controller” Presentation at Metro Toronto .NET User Group Next Thursday

This article also appears in Canadian Developer Connection.

Canada's Next Top Model (moose) View (Lake Louise) Controller (beaver)

If you’re going to be in the area of downtown Toronto next Thursday, May 28th, you might want to check out my presentation, Canada’s Next Top Model View Controller at the next Metro Toronto .NET User Group meeting. I’ll be talking about the ASP.NET MVC Framework, Microsoft’s answer to MVC frameworks like Ruby on Rails, Django, CakePHP and Catalyst. As is my stock in trade with presentations, this will be informative, enlightening, entertaining and just might feature a rock and roll accordion performance.

The presentation takes place Thursday, May 28th at 6:00 p.m. at the Manulife Financial Building (200 Bloor Street East, Toronto, between Church and Jarvis – use the entrance on St. Paul Square). Admission for the presentation is free, but you have to register, and as of this writing, only 24 tickets remain.

For more details about the presentation, visit the Metro Toronto .NET user group site.

Categories
Uncategorized

Tech Books I’m Reading Right Now

This article also appears in Canadian Developer Connection.

I’m reading a couple of tech books right now, and I plan to publish more in-depth reviews of them in the next couple of weeks. In the meantime, I thought I’d give you some quick reviews to give you a taste.

Pro ASP.NET MVC Framework by Steve Sanderson (Apress)

pro_asp.net_mvc_frameworkThe first book is Pro ASP.NET MVC Framework, published by Apress and written by Steven Sanderson. It’s been available in “beta” form as a PDF for the past couple of months, and as of this afternoon, the final PDF version has been released. I expect that the dead-tree edition should be hitting the shelves of your favourite bookstore, real or virtual, in a week or so.

This book covers the new  way of developing ASP.NET applications, the MVC way. If you’ve read the “Gang of Four” book or any other book on design patterns (or any of Rocky Lhotka’s books on business objects), you know that MVC is short for “Model-View-Controller” and a pattern for separating an application into its business logic, presentation and interface. Perhaps you’ve looked longingly as the “cool kids” have used frameworks like Ruby on Rails and Django to build applications with greater speed and fun, and fewer errors and less futzing around with tedious development minutiae. You might have heard Scott Hanselman and Phil Haack talk about their work on ASP.NET MVC, or maybe you’d heard that Jeff Atwood’s Stack Overflow is implemented in ASP.NET MVC.

I myself come from the world of Rails and have noodled with Django. As such, find that I’d rather use an MVC-style framework in most cases. That’s why I’m happy that ASP.NET MVC has hit the official “1.0” stage – it’s available for download right now and will be included in Visual Studio 2010 as an official alternative to old-school ASP.NET.

The book is a great introduction to the concepts of MVC web frameworks in the context of ASP.NET. It starts by showing you how to get the ASP.NET MVC tools and templates onto your system and then walks you through the development of a sports store ecommerce site. The middle part goes into the features of ASP.NET MVC in greater detail, covering REST and routing, controllers and views, testing and adding Ajax to your MVC applications. The last section covers the goodies that ASP.NET gives you – authentication, members/roles/profiles, caching/compression and WebForms – and how to use them in the context of ASP.NET MVC.

It looks like a pretty promising read on a topic that I’m very interested in. Watch this blog for a review, and eventually, some code examples based on what I learn from the book.

The Passionate Programmer by Chad Fowler (Pragmatic Bookshelf)

the_passionate_programmerRegular readers of this blog will know that my favourite developer book of 2008 was Pragmatic Thinking and Learning: Refactor Your Wetware. They also know that there really wasn’t much about software development in particular, but developing the most important tool for software development: your mind.

The publishers of Pragmatic Thinking and Learning have just put out a “new-ish” book, The Passionate Programmer, written by Chad Fowler. I say it’s “new-ish” because it could be considered a second edition of his book My Job Went to India (and All I Got was this Lousy Book).

The problem with My Job Went to India was that the title implied that it was largely about saving your job from outsourcing. In a recent podcast about the book, Chad said that the book’s title influenced the way he wrote it, and it ended up not being quite the book he wanted to write.

The Passionate Programmer is different; you could consider it a “refactoring” of My Job Went to India, and a good one, too. Rather than focusing on saving your job, it’s more about two very important things:

  • Finding fulfillment and happiness in your career
  • Cultivating the desire to live a remarkable life

Those are two pretty tall orders for a book, but I’ve met Chad at a couple of conferences, and I know he likes to think big. I’ve just started into The Passionate Programmer and so far, I’ve thought “damn right!” at every bit of advice he’s given. As with Pro ASP.NET MVC Framework, watch this blog for the full review of this book.