Review : C# In Depth

I have read the second edition as well. The third edition carries on from there and provides a deeper look in C# 5 and it’s key feature async/await. If you want to understand what goes on behind the scenes, this one is for you. Jon Skeet ( yes the famous guy Jon Skeet) has managed to come out with a great book once again.

Jon starts easy on this, but doesn’t hold back. The prose is lucid yet well paced. It is one of the few books that make the effort to take the reader on journey. The journey begins with C#1 and then continues to C#5. Hardly any chapters drag on anymore than they should. Linq is covered in great depth and is a nicely written with enough diagrams to visualize what is happening under the hood. Generics is one my personal favourites. The text is nice, so are the code samples. I have never really understood generics completely, but the books does make things a lot clearer. The treatment of dynamic is really nice. It goes into the heart of the DLR and shows everything that you need to know to really understand dynamic.

The book really shines when you move to async/await. Jon makes a rather tough concept easier. I had to read it several times but each time the concept became easier. I only wish we moved away from the download the web page example for async. The book does spend time on compiler transformations that are behind async/await. Be patient when you read it, it will take time to sink in.

The only part that has been left out from the third edition is the chapter on Code Contracts. Jon clearly mentions that the topic hasn’t gained as much traction as he hoped. It may come back in the future though. As many have mentioned this before this is not a book for beginners. Use this to become a better C# programmer, after you have written C# for some time. This is a must have in your collection, especially if you work with C# day in and day out. It will give you a greater understanding of how the language designers wanted you think, and what makes C# a real joy.
A 4.5/5 for this one, keeping the 0.5 for the next edition :).

P.S. Even the appendix is handy.

Disclosure : I got a free copy of the book to review. The review is my own opinion and not influenced by anyone else.

Advertisements

Freebase : Level 3

It has been a long time since I have written a post, I am a little nervous now. Freebase has moved into a different league with Google acquiring it in 2010(Right about the time when I used Freebase to do the exact same thing that Google does now, not gloating just saying search engines just weren’t doing enough besides Page-ranking).
More information can be found on the following two links
Google Acquires Metaweb
Semantic Search

The results are evident now , search for a movie and you will see a nifty bar on the side showing a whole lot more information, information that was always there just not being used enough. Enough of talk, back to code.
I got some feedback on the small class that I wrote to query Freebase. It was OK, but cumbersome to use. So, there you go it is all dynamic now.

                dynamic thepolice = new ExpandoObject();
                thepolice.type = "/music/artist";
                thepolice.name = "The Police";
                thepolice.album = new Dictionary<Object, Object>();
                thepolice.album.Add("name", null);
                thepolice.album.Add("limit", 2);
                thepolice.album.Add("genre", new Object[5]);

I agree with .net4 and beyond this is the way developers would like to use it. I would definitely like to use it this way. This time the code is a lot cleaner(I am still learning, I am not evil by default). There is a class that I borrowed from MSDN that allows you to switch over types(more useful than you think). Code is now smaller, with a few tests as well. The entire code is available on Github Freebase.net.