View Single Post
  #7 (permalink)  
Old April 1st, 2011, 03:05 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
But in the book the verbiage between "query" and "=" is not there. I just think that is should have been.
You can add it there, but you don't have to. The same principle applies:

Code:
 
Dim query = dc.titles
would work fine. dc.titles is a Table(Of Titles) and thus when the compiler sees this, it types query as a Table(Of Titles). So, the code in the book should compile just fine and when you hover your mouse over query it should tell you the type.
The code in the download is slightly different and does include the As clause.

Quote:
Because Option Infer was added specifically due to LINQ, it probably should have been reviewed at the beginning of the LINQ section or at least the reader should be asked to return to chapter 1 page 18 and review the compile options.
Yes, I agree. That would certainly make sense....

Quote:
I don't know but when you write a book for WROX, do you consider the possibility that the reader may skip ahead?
It depends on the book I guess. My Beginning books are meant to be read from start to end. I do add forward and back references where appropriate. With a reference type of book things would be different.

I think it's a fine balance. If you need to repeat some stuff in every chapter, you may get the opposite effect where people don't like the fact the same information is repeated over and over again ;-)

But in your case, a reference in the LINQ chapter to the compiler options and an explanation of type inference would have been useful.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!