Why is this page text-only?

Main | January 2006 »

Book Review: ASP.NET 2.0: A Developer’s Notebook by Wei-Meng Lee

ASP.NET 2.0: A Developer's Notebook, part of a new series by O'Reilly Media, takes a radically different approach to code-oriented textbooks, and it's about time. O'Reilly has done something wonderful in realizing that most developers simply don't have the time to read through 1200-page books trying to learn every little detail about a subject.

Instead, we usually only have a matter of days (hours if we're really unlucky) to learn enough about the language we're using to make the project work. That's what this book is about... getting the job done. This books aims to be the brain of a great developer poured onto paper. You won't find useless chapters on theory or elaborate references of class hierarchies and object properties. What you will find is page after page of hands-on code examples that you can actually use.

Topics covered include:

  • Master pages, themes, and skins for easily creating a consistent look throughout your site
  • The Web Parts Framework (WPF) for building portal applications
  • Security and membership controls for managing user authentication
  • Data access via new data source controls and the GridView component
  • Performance tuning your site by pre-compiling and fragment caching.

ASP.NET 2.0: A Developer's Notebook is a book for developer's who would rather learn by coding instead of just reading. This is the perfect book for developers familiar with ASP.NET 1.x who're looking to make the jump to ASP.NET 2.0 and Visual Studio 2005 without wasting every second of their free time. It throws you into the code immediately, allowing you to learn by example. The code samples are all easy to follow and you can re-use them in your own applications. This is a must-have for anyone trying to learn ASP.NET 2.0.

Developer Mentality

Joe has been a New York City cab driver for 15 years. On Monday his boss will tell him that they have an important client and he must drive a limousine instead of his usual cab. On Tuesday his boss will ask him to drive an 18-wheeler. On Wednesday, the Goodyear blimp.

It’s hard to imagine a story like this being true but in the world of web development it happens all of the time. ASP, PHP, XML, Flash, etc. This list of technologies available to do the job is long and daunting. What’s worse is that most clients don’t know about, understand, or even care about this list. They have a problem and it’s our job to provide the solution. When the client wants a project in Flash I don’t have the luxury of saying “Sorry, I’m a .NET guy”. Instead, it’s a trip to the bookstore to pick up an Actionscript book, unhealthy amounts of coffee, and 3 days without sleep to string together a project in a language I’d never used before.

The difference between a good developer and a bad one is precisely this ability to think on one’s feet and adapt to any situation. One of the questions I always ask whenever I interview potential new hires is “How do you keep up with changes in the field?” More often than not the candidates don’t have an answer to this question and for me that throws up a big red flag. This industry changes almost daily and the proverbial list I mentioned earlier grows longer and longer. The people who actively seek out new information and thrive on learning new things are the ones who’ll be successful in this business.

I’m headed home for the holidays tomorrow armed with a book on SQL Server optimization and a set of video tutorials on the new Visual Studio so I should have some good stuff coming soon. Until then, here’s to hoping that next time I ask my interview question, the answer is “I read Code Scene”.

Happy Holidays.

Search Engine Optimization

One of the most frequent client requests is "I want my site to be #1 in Google". While we'd all like our site to be #1, in reality it isn't that simple. Search Engine Optimization (SEO for the truly hip) has become a trendy buzzword for marketing executives who spout false promises of search engine glory. The field has grown to the point where there are literally hundreds of firms claiming to be able to increase your search engine presence for a mere several thousand dollars. There are others on the opposite side claiming that all you need is a few meta tags to make your site stand out in Google. So who's right? What factors really DO affect your search engine ranking? What can you, as a developer, do to ensure that your site is properly optimized for Google, Yahoo!, and all the rest?

SEOmoz has compiled two of the best articles on search engine influencers that I've seen.

I encourage all developers to read those articles in depth but for the truly lazy, here're 5 quick tips for better SEO. In no particular order...

  1. Title tags - Every page on your site should have a unique title tag which gives a succinct description of the page. These should NOT be used to simulate breadcrumb trials.
    BAD - MySite.com : Products : Gizmos : Cool Widget : Details
    BETTER - Cool Widget Product Details | MySite.com
  2. Standards based semantic markup - This should go without saying for web development but it does affect your search engine rankings. Encoding descriptive titles with <h1...h7> tags will help search engines in picking out your keywords.
  3. Avoid using &id= in your dynamic pages - I'd done this for years until I found out that Google doesn't index pages that use &id= in the querystring. See Google's Webmaster Guidelines for more.
  4. Link text - make the clickable portion of your links descriptive.
    BAD - For information on widget #5, click here.
    BETTER - More information on widget #5.
  5. Ethics - Don't overload your page with keywords. Don't use hidden text to load your site with keywords. Don't try to create special pages just for search engines. If it seems like a questionable practice, it probably is.

Fun with style sheet switching

One of the great things about building your websites using web standards is that the content is completely separated from the design. Since the design is controlled entirely through CSS it becomes simple to change. Add a style sheet switcher to your site and you can even let your users control the design. Click the colored buttons below (or on the right nav) for a demonstration.

Red Orange Yellow Green Blue Purple

Now why exactly would you want to give your users control over how your site looks? For CodeScene, I've done it simply because I think it's a cool trick that illustrates the separation of content and presentation. A far more practical use however, would have been to create styles with varying levels of font sizes and contrast. This would add to your site's accessibly by allowing the user to choose the style sheet that is most comfortable for him/her to read. Since CSS also controls not only the colors but the layout, you could use a style sheet switcher to control that aspect as well to perhaps show/hide a navigation bar. Use your imagination.

For those interested in the code behind it, it's a relatively simple javascript library that turns alternate style sheets on and off, and then sets a cookie to remember which one was selected. It was written by Paul Sowden and can be found in the article Alternative Style: Working With Alternate Style Sheets on the infamous A List Apart.

Flash, IE, and the HTTP_REFERER object

I spent several hours the other day trying in vain to solve this problem and couldn't find much help online so I'm going to share. I have a website with a "Send this page to a friend" function on it. Users click a button and get taken to a form which inserts the URL of the page the user clicked from. This works by using the HTTP_REFERER server variable to grab the last page the user was on. It's a simple script and once I've used dozens of times before but in this case it would not work in IE. Firefox was no problem but Internet Explorer just didn't work. Several hours of tearing my hair out and I found the answer… The send to a friend button was part of a navigation bar that was created in Flash. When you click a link in Flash, it doesn't register in IE so the HTTP_REFERRR object shows up as blank. I'm not entirely sure if this is a bug or a "feature" but for whatever reason IE, Flash, and HTTP_REFERER do not mix. I tested this in both ASP.NET and PHP and it's the same. The IE user-agent just doesn't pick up the flash links.

Example: The button on top is a .gif image whereas the button on the bottom is a .swf. Both link to a page which displays the HTTP_REFERER variable. Using IE, click on both buttons and you'll see that the flash button doesn't behave as expected.

Image Button
Image Button

Flash Button

For those interested, my workaround was to pass the user's current page into the flash movie containing the send to a friend button. Clicking the button would then pass the value to the page as a querystring. I.e. send-to-friend.aspx?from=referring-page.html
It's not the most convenient solution but it works and I was able to meet the deadline and those are the only 2 things the client ever really cares about.

The obligatory bio post

This is the post where I introduce myself and try to convince you that I’m someone worth listening to.

My name is Jay Buys and I’ve been writing code of some sort for close to 20 years now and I’m only in my mid 20’s so that should tell you how young I got started. When I was about 7 or 8 my parents brought home a Commodore 64 computer and I was instantly hooked. Not only did I love playing games on it but I immediately wanted to know what made it work. So, armed with a few books from the local library, I started learning and writing code in BASIC, a distant ancestor of the Visual Basic.NET language I use today.

I got online for the first time in the early ‘90s, back when being online meant dialing into a local Bulletin Board System (a BBS for the truly old-school). From there I graduated to Usenet Newsgroups and eventually the infantile world wide web. I’m one of what seems like a few who still remembers the web the way it began; before Flash, before syndicated content, before Google, when Yahoo! looked like this.

I started to learn HTML literally the same week I first browsed the web and have been doing it ever since. I hold a Bachelor of Science from SUNY Fredonia in Media Arts and I currently have a full-time job in Washington, DC working with an extremely talented team of other developers, designers, content creators, and communication gurus who I continue to learn from every day.

My goal is take what I’ve learned over the years and share it here on this blog. I think we all learn best by drawing from others so comments and suggestions are strongly encouraged.

First Post! Jumping on the bandwagon

It seems that I'm the only one in the industry without a blog at the moment so here I am, jumping on the blog bandwagon. Welcome to the first post of codescene.com. My name is Jay Buys and I am a web developer.

Web development, which will be the primary focus of this blog, is an ever-changing field. It seems that every week I'm faced with a new challenge that sends me back to my books or out to the web in search of an answer. SQL, XML, Flash, web standards, ASP.NET, etc, etc. This blog won't focus on any specific technology, but web development in general which for me really means finding a solution to a problem.

Developers work as part of an online community using forums and blogs to share information with one another. Having learned countless amounts of information from people like Jeffrey Zeldman, Eric Meyer, and Dan Cederholm, it is my sincerest hope that this blog will give a little something back to the community I take so much from.

Check back often or subscribe to the RSS feed. There will be lots of stuff coming soon.

Update: 12/7/05 In my rush to get this site up and running, I forgot to give credit to it's designer. Many thanks go out to my friend and colleague Chris Vaccaro for the great work he did on designing this site for me on the short notice I gave him.