C# 4.0

Monday: LINQ to Entities and the Entity Framework Examined

Today we release the first video of Day 10 in our Core curriculum discussing topics such as how the Entity Framework is different from previous data access API's, we looked at the Entity Data Model's underlying XML with it's Storage, Conceptual and Mapping sections, and use that as a launching point to discuss how that separation provides a high degree of flexibility in how to map between the relational and object oriented world.  We talk about performance and best practices and a host of other related topics as we gear up for a bevy of examples demonstrating practical recipes for LINQ to Entities usage in the remainder of day 10.

More information here ...

3 New Videos: Exercises and Solution for our big Day 9 LINQ Challenge

I love challenges.  Once, Mrs. Canton, my High School English teacher said "No one gets an A in my class."  I was not an "A" student, but the gauntlet was thrown down and I did not back away.  In the end, I came away with an A … one of the few in my high school career (unfortunately.)

Today I'm releasing three videos -- the first is the exercise for Day 9 that throws down the gauntlet for your new-found LINQ knowledge and forces you to struggle to come up with the solution for 9 mini challenges.  In fact, I challenge you to complete the exercise in BOTH the Query and Method syntaxes … so, 18 mini-challenges.  If you get stuck, not to fear … you can look at the solutions (provided as part of today's release as well.)

That should keep those of you in the northern hemisphere out of the heat this weekend (or out of the cold, if your toilet swirls the other direction.)  Enjoy!

Day 9 Exercise

Day 9 Solution - Query Syntax

Day 9 Solution - Method Syntax

Wednesday: Two LINQ From, Join, and a host of Expression Methods

Some days are like cutting through butter gins knife, other days are like cutting through steak.  Today was like cutting through a brick.  But, I persevered to bring you two more videos as we finish up Day 9's curriculum.  

LINQ From and Join
LINQ Quantifiers

Monday: 2 Videos!!! Introduction to LINQ to Objects, A Bunch of Examples

Ok, so to make up for last week (I fell off the one-video-a-day bandwagon) I decided to set a newer, loftier goal of 2 videos each day this week.  We'll see how it goes.

Today's videos center around the basics of LINQ, specifically LINQ to Objects.  The first video, "Introduction to LINQ to Objects" is a lecture format (I tried to keep it brief and to the point) and the second video "Examples of LINQ to Objects" demonstrates a dozen little code examples to show off what you can do with sequences of data (and how easily you can do it).

Also, a few hours left until we draw our first Facebook fan to choose a book off my bookshelf.  Still time to get in on that drawing.  Right now we have 300 fans, so your chances are pretty good (better than winning the lottery!  Better than being audited by the IRS!)

Friday: Lambda Expressions ... Finally!

Today's video release features Lambda Expressions in C#.  We see those funky little expressions in LINQ's method syntax, and this video deciphers the nomenclature, and provides the exciting progression of thought that began with Delegates, Anonymous Methods and finally Lambdas.  We also talk about the Func delegate definition and how to both understand it when we see it in Intellisense as well as how to use it for our own evil purposes.  This was a fun week for me to record -- I love this content and developing more examples solidified some of the nuances of these concepts in my own mind. 

Have a great weekend!

Thursday: Anonymous Methods

Today's video continues a progression of thought that will help us better understand Lambda Expressions which are used extensively in LINQ's method syntax.  Without this background, you might wonder what this crazy syntax:

o => o.OrderDate > DateTime.Now()

... or similar expressions really mean.  Yesterday we looked at delegates.  Today we look at how we can satisfy an input parameter defined to accept a delegate by passing in a method (a named block of code) without a name, in-line.  This is called an Anonymous Method.  It's an elegant, terse way of expressing a small algorithm used (in most cases) as an evaluation within a larger method.  While that might make little impression on you now, you'll see how it is used to provide a way to configure LINQ's extension methods.

Wednesday: Understanding Delegates (with an eye to Lambda Expressions in LINQ)

Today's video talks about Delegates in the context of Lambda Expressions.  In fact, this video is the first in a three-part mini-series on Lambda Expressions, which are vital to understanding LINQ's method syntax.  Originally, I covered this Delegates, Anonymous Methods and Lambda Expressions progression in a single 20 minute video.  After watching it again a couple years later, I was underwhelmed and knew I could do a better job with it a second time around.  This is especially true considering I had the task of introducing this to a more beginner audience on this pass through this topic.

Have the cobwebs lifted from your long weekend (at least, those of you in the US)?  Admittedly it was a bit more difficult to get rolling this week than I anticipated.  Here's to hoping for more productivity on Thursday and Friday!

Friday: Anonymous Types

Today's video covers Anonymous Types which are used extensively in LINQ, but also prove helpful elsewhere.  Enjoy!

Hey, if you're counting, that ends Week 3 of "one video each day".  Yay!

On a personal note ... we're off to catch a matinee showing of Avatar: The Last Air Bender.  If you like animation (or, just good TV, and there's a dearth of it in the summer) you should check out this Nickelodeon original on DVD.  I hear the movie isn't that great, but we're fans here at the Tabor house, so we're going to see it anyway.  :P  Happy 4th weekend!

Thursday: Local Type Inference (C# var Keyword)

We sent a lot of email out to our subscribers within the past 24 hours, so as I type this the website is getting hammered with requests and downloads.  If it's too slow for your liking, you might want to come back later in the day.

Also, remember, I'm going to be releasing videos each and every day, so if you want to avoid the rush, just come by every day (later in the day is better) to snag that day's videos.  Hopefully that will even out the traffic over many days, not just the day I send out the video.

Ok, today's video is about C#'s var keyword that enables local type inference, a concept that is one of those foundational building blocks of LINQ.  You'll see how it can and can't be used.

Wednesday's Video & A Word of Encouragement

It's Wednesday … 13 (work) days in a row with a video release. That's got to be some kind of record for me. :) Today we start Day 9 in the Core 1 video series, pushing towards LINQ I talk today about "Object and Collection Initializers" in C#. Yes, I've covered this in the C# 3.0 New Features series, however I plan on deprecating that series and this new video will replace the equivalent in that series. In a nut shell, you should be using this syntax when working with collections and groups of stuff. :)

Ok, now on to the "word of encouragement" ...

Nutshell: Apple's critical acclaim had reduced me to navel gazing, then I discovered the facts.

Long story:

The Windows camp (developers, administrators, enthusiasts, you name it) have been a buzz about this post, which nicely compiles statistics you may have seen represented individually as you've browsed the internet.

http://www.neowin.net/news/crunching-the-digits-the-scale-of-microsoft

Basically, while iPhone and iPad development has been getting all the acclaim from the press there's another story that is not as sexy or exciting, but means everything for those of us who are developers deciding where to invest our energies in learning: Windows 7 sold about 150 million licenses in about a year (give or take). 58 million netbooks were sold in 2009, and only 4% were not running windows. Apple predicts 7 million iPads sold this year. That is an 8:1 ratio of Windows 7 to iPad.

I have a lot of random thoughts on this that are going to come spilling out now. Forgive the bloated post.

Admittedly, as a Microsoft software developer, I've felt a little vulnerable in the past 3 months or so. I mean, at the height of the iPad and iPhone frenzy literally EVERY SINGLE STORY was about Apple. But this Neowin article's statistics emphasized to me a simple fact: Apple really is really about the consumer experience, while Microsoft is about the enterprise. Apple has not expressed or demonstrated a lot of interest in the enterprise. It may NEVER get into that market … who knows. Apple has a great *consumer* product! I use Apple products myself! But from an enterprise (or more relevant to our purposes, a developer perspective) it's not even close. I'll comment on the developer angle in the next paragraph. There are other competitors in the enterprise space, and Microsoft continues to push forward in that market. This is why Microsoft doesn't get a lot of press … the writers don't live in that world. But can any of us who follow Microsoft deny the quality of their latest products on the enterprise side? Products like Windows 2008 Server, SQL Server, Sharepoint, IIS7 or Visual Studio 2010? Or, perhaps to broaden this a bit, the choice available across the entire macro-sphere of Microsoft-dom … third parties, partners, etc.?

Back to Apple … from a developer's perspective. A few years ago I spent a week at Big Nerd Ranch in one of Aaron Hillegas' classes learning XCode, Cocoa, Objective-C, etc. So yeah, I dabbled in it for a week or two to see what all the excitement was about. I came away with this: while Cocoa is an impressive API framework that allows you to plug deep into OSX, XCode is severely lacking features that Visual Studio has had for years, Objective-C is not an elegant language, and the lack of a standardized library for database access was … shocking. I realized at that point that Microsoft had little to fear with regards to Apple as a serious threat to business (sure, small businesses that can make use of consumer grade applications, but not server products.)

The final nail in the coffin for me (with regards to investing more in learning Mac development) was the App Store. Why would I invest all the time and money required to build a software product and chance it that (1) it might be rejected in the only place I can distribute it, i.e., the App Store? and (2) it would be buried underneath 10,000 crappy applications. (Have you ever taken a few minutes and browsed through the 'Release Date' section of your favorite Category in the App Store? Wow, there's a lot of … chaff.

While I haven't used Webkit or HTML5 extensively, it clearly demonstrates a lot of impressive features for a browser-based rich, thin client. If you want to use that, there's nothing preventing you from using it in your UI layer when serving ASP.NET or ASP.NET MVC pages. In fact, while I don't know of anyone doing this right now, I can't see why you couldn't use this to build iPhone apps. See what this company has done with HTML5 as an iPhone app:

http://www.tuaw.com/2010/06/21/wwdc-2010-brian-akaka-of-appular/

Frankly, you have a better chance of someone finding you through "traditional means" than through the App Store.

But wait … this fall we're promised that Microsoft will have a new phone, Windows 7 Mobile Phone or somesuch. And the star of the show (for developers) is Silverlight. Before this announcement, I was rather "bearish" on Silverlight. It seems that the world is moving away from Flash towards jQuery and HTML5, so besides some media projects I didn't see the value. I see the value of Silverlight now, and I've been spending a lot of time personally playing catch up. Forget for a moment that -- at last check -- Silverlight was installed on roughly two-thirds of internet accessible devices (compared to 98% as Adobe claims with regards to Flash).

Focus on the prospect of the phone itself … It would be understandably easy to write off Microsoft's phone as an "also ran", similar to what many have done with the Zune. But, let's suppose that Microsoft is able to sell the phones to enterprises and tie it in with Office and Sharepoint (like they do everything else) and include administration features similar to policies, etc. on Windows Servers. THAT IS IN FACT WHAT WAS SAID by a product manager at TechEd a few weeks ago. THIS IS IN THE WORKS! THAT is a game changer for me … It is conceivable that decision makers would find this to be a compelling offering. I suppose we'll just have to wait and see … but may I offer a small prayer on behalf of the Windows 7 Phone. (Amen.)

I think Silverlight's long term success hinges on the success of the phone. I'm putting a lot of hope into this new phone realizing that (1) they've got to play a little catch up, and (2) it might not be perfect on the first pass. But, what if they were to get it right? What if enterprises do buy the phone? Wow, you and I are going to see another wave of opportunity. (Crosses fingers.)

Even if the Windows 7 phone doesn't win out, the fact of the matter is that it's time to focus on mobile in general. I'm going to be doing that this coming year personally and from an instructional perspective.

Syndicate content  RSS Feed