Wednesday, February 27, 2008

Fun with LINQ

I've really been getting into LINQ these days. I'm currently reading Pro LINQ by Joseph Rattz. The writing style is not a good as the Pro ASP.NET 3.5 book I've previously raved about, but there is a chance that this book is just covering a muchmore difficult topic.

If you haven't ready about LINQ yet, do so. It is coming to a Visual Studio near you. Even if you don't use SQL Server, you can still use it for XML, DataSets and anything that inherits from IEnumerable.

But I do fear that the downside of LINQ is that Microsoft is about to lose a lot of developers because of it. As easy as it is, it is also very, very difficult. 75% of the developers will look at the syntax, the ridiculous numbers of < and >, and run back to hand coding SQL statements and returning plain old data readers. The problem lies in the fact that LINQ Expressions are extremely difficult to read. They're powerful, yes, but the numbers of function delegates and advanced concepts of the .NET Framework that LINQ requires you to know in order to go beyond the most simple queries is a little frustrating.

I'm sure that with time, we will grow use to reading Lambda expressions just like we read regular code, but I think a large percentage of developers will be scared off from the syntax and will never try. They will stay with their tried and true methods of data access, and count the days to retirement. I don't blame them. A new concept like LINQ or NHibernate or The Entity Framework comes along every year. I skipped a whole generate of these tools, and here I am, now working in LINQ.

Visual Studio Tip - TODO

Here's a tip that seems pretty obvious, but I've never used it before, and it's really useful, especially if you are going to hand code off to someone else to finish

Add a comment line to your code as follows

// TODO - Add a task to complete here

Then, go to the main menu bar, and select View - Task list. In the task list Window, there si a drop down list that says either Comments or User Tasks. Switch to comments. TADA! TODO!

Quick, easy, and professional! No more sticky notes or long emails about what is left to do. And it gets tracked with your source control so you can see who made the change and when. You are use isource control, right?

Wednesday, February 20, 2008

Recent Reading

I recently finished my first pass of ASP.NET 3.5 in C#2008 by MacDonald and Szpuszta. What an amazing book. I learned something new on just about every page. It's a pain in the but to lug this monster around every day (it's 1500 pages), but I learned so much that I consider it required reading for developers trying to get caught back up with technology if you've been stuck in a rut.

I've also almost completed reading Head First HTML with CSS and XHTML. The first half of this book wasn't anythingnew to me, but the second half really helped get me up to speed with CSS and since that is exactly what I am working in this week, it is really helping. It's a very quick read. I'm getting through about 200 pages a day (there are a lot of graphics). The Head First series isn't for everyone, and I thought I'd give it a try. It's great for doing catch up on technology, but I wouldn't use it to try to learn some huge new concept.

I'm debating what will be my next work topic to read about. It may be Code Complete 2 or perhaps Programming SQL Server 2005, or maybe a book specializing on LINQ.

I can't believe how much reading I am able to get done while riding the Sounder back and forth to work. It would have taken me a year to work through ASP.NET 3.5 at home. I'm definitely in the learning groove, and on track to get caught back up on the technology I need to do my job.

And the writing bug is hitting again. YAY!

CSS Path Lesson Learned

Situation:

A graphic I was trying to display in the main page header on a website was not showing up. The header was build via a CSS page. All other graphics on the page were working.

Solution: CSS background:image links must be specified with the path from the css file, not from the page using it. (DUH)

Monday, January 14, 2008

Recent Reading

I just finished reading Microsoft SQL Server 2005 Reporting Services 2005 by Brian Larson. It's a pretty good introductory book, and after reading the first 11 chanpters, and skimming the last couple, I think I've got a pretty good idea on how to get started with SSRS2005. Unfortunately, by the time I actually get to use any of this, we'll probably be on SSRS2008, and I'll have to get the next version, but hopefully there won't be a lot of changes.

I'm currently digging into SQL Server Free Text searching and other search engines to be used for searching relational databases. The SQL Free Text search has a few major downsides:
1. It can only index one database
2. You need to actively update the database indexes on a schedule, or the search will not get accurate information
3. You need to specify the columns to include in your searches through your indexing.

This may still work to do what I need, but there will be a lot more effort than originally planned.

I am also researching and comparing LINQ, CSLA, NHibernate and the Microsoft Entity Frameworks for use in my data layers. No winners yet, as they all offer benefits. The biggest loser in using these tools is WCF, since using WCF removes a great deal of the capabilities built into each of these tools for CRUD operations.

Finally, I've been cracking open Visual Studio 2008, mainly to look at LINQ and new ASP.NET functionality.

More to learn, always more to learn.