<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Jon Skeet: Coding Blog : Book reviews, General</title><link>http://msmvps.com/blogs/jon_skeet/archive/tags/Book+reviews/General/default.aspx</link><description>Tags: Book reviews, General</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>The trouble with book reviews</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/07/08/the-trouble-with-book-reviews.aspx</link><pubDate>Tue, 08 Jul 2008 17:07:14 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1639806</guid><dc:creator>skeet</dc:creator><slash:comments>10</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/jon_skeet/rsscomments.aspx?PostID=1639806</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/jon_skeet/commentapi.aspx?PostID=1639806</wfw:comment><comments>http://msmvps.com/blogs/jon_skeet/archive/2008/07/08/the-trouble-with-book-reviews.aspx#comments</comments><description>&lt;p&gt;I&amp;#39;m currently reading two .NET books: &lt;a href="http://www.amazon.com/Accelerated-C-2008-Trey-Nash/dp/1590598733"&gt;Accelerated C# 2008&lt;/a&gt; (Trey Nash) and &lt;a href="http://www.amazon.com/Concurrent-Programming-Windows-Microsoft-Development/dp/032143482X"&gt;Concurrent Programming on Windows&lt;/a&gt; (Joe Duffy). I will, in due course, post reviews here. However, the very act of thinking about the reviews has made me consider the inevitable inadequacies.&lt;/p&gt;  &lt;p&gt;There tend to be two kinds of people reviewing technical books: those who&amp;#39;ve bought the book as a &amp;quot;regular punter&amp;quot; - who are aiming to learn something new. Then there are those who already know about the subject matter, but are reading the book mostly to review it. I realise there are people in-between (for whom the problems below aren&amp;#39;t such an issue) but these are the two camps this post addresses.&lt;/p&gt;  &lt;p&gt;The purpose of a technical book is usually to impart information and wisdom. I would have left it at just information, but things like best practices don&amp;#39;t really count as &amp;quot;facts&amp;quot; as such - they are opinions and should be treated as such. So, there are two qualities that I look for in a book:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Is it accurate? Are the facts correct, and is the wisdom genuinely wise?&lt;/li&gt;    &lt;li&gt;Is it a good teaching tool? How well is the information/wisdom transferred from author to reader?&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I think it&amp;#39;s worth breaking these up, although there is significant overlap.&lt;/p&gt;  &lt;h4&gt;Accuracy&lt;/h4&gt;  &lt;p&gt;As I&amp;#39;ve noted before, I&amp;#39;m a stickler for accuracy. If I can spot a significant number of inaccuracies in the text, I find it hard to trust the rest. Now I generally &lt;em&gt;don&amp;#39;t&lt;/em&gt; include grammatical errors, printing mistakes etc in this. While they make the book harder to read, they don&amp;#39;t typically leave me with a mistaken impression about the technology I&amp;#39;m trying to learn. There&amp;#39;s a blurring of the medium and the message when a book may be &lt;em&gt;technically&lt;/em&gt; just about accurate, but still leaves an incorrect impression.&lt;/p&gt;  &lt;p&gt;Now, the reader who has bought a book primarily to learn something new has little hope of judging accuracy. They can spot typos, and if the book is inconsistent or simply implausible that can become obvious - but subtle errors are likely to elude them. Just because an error is subtle doesn&amp;#39;t mean it&amp;#39;s unimportant, however. I know a &lt;em&gt;reasonable&lt;/em&gt; amount about threading in .NET, but there&amp;#39;s a lot of Joe Duffy&amp;#39;s book which is new to me. He could have made dozens of mistakes in the text around Win32 threading, and I&amp;#39;d never know until it bit me. (For what it&amp;#39;s worth, I very much doubt that there &lt;em&gt;are&lt;/em&gt; dozens of mistakes in the book.)&lt;/p&gt;  &lt;p&gt;A reader who already knows the subject matter thoroughly is much more likely to spot the mistakes. However, they&amp;#39;re unlikely to be much good at judging the other major criterion...&lt;/p&gt;  &lt;h4&gt;Teaching efficacy&lt;/h4&gt;  &lt;p&gt;I can&amp;#39;t really remember much about how I learned to program, other than that it was over the course of several years. I started off with Basic on the ZX Spectrum, then moved on to C, then Java, then C#. Each experience built on the previous one. The way in which I learned C# wouldn&amp;#39;t have suited a non-Java programmer nearly as well as it suited me.&lt;/p&gt;  &lt;p&gt;How can I possibly judge how well a book will teach a subject I already know? I can make some educated guesses about particularly confusing passages, and potentially critique the ordering of material (and indeed its inclusion/exclusion) but fundamentally it&amp;#39;s impossible to gauge it properly.&lt;/p&gt;  &lt;p&gt;The people who &lt;em&gt;don&amp;#39;t&lt;/em&gt; know the topic beforehand are likely to have a better idea, but it will still be flawed. In particular, you won&amp;#39;t know how well the material has sunk in until you&amp;#39;ve given yourself enough time to forget it. You won&amp;#39;t know how suitable the advice (wisdom) was until you&amp;#39;ve tried to follow it. You won&amp;#39;t know how complete the coverage is until you&amp;#39;ve used the technology in anger, preferably over the course of several projects. Even then it&amp;#39;s easy to miss stuff: if no-one on your team knew about iterator blocks and the C# book you were reading didn&amp;#39;t mention them, how would you know what you were missing?&lt;/p&gt;  &lt;h4&gt;Who should you trust?&lt;/h4&gt;  &lt;p&gt;This post has had a pretty depressing mood so far. That reflects my irritation with the whole topic - which isn&amp;#39;t to say I don&amp;#39;t enjoy reviewing books. I just have doubts as to their use. I do, however, have a few positive notes to end on, as well as some fairly self-evident advice:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;If &lt;em&gt;everyone&lt;/em&gt; likes a book, it&amp;#39;s probably good. Likewise unanimous disapproval is rarely a good sign.&lt;/li&gt;    &lt;li&gt;When judging reviews, see if you can work out the context. Is the reviewer reading from a perspective of knowledge, or learning? If they&amp;#39;re criticising accuracy, they probably know what they&amp;#39;re talking about - but may not be a good judge of the style and teaching technique. If the review is mostly saying, &amp;quot;I learned C# from scratch in 20 minutes with the help of this fabulous book!&amp;quot; then you can guess that they at least believe they had a positive learning experience, but you should treat anything they say about accuracy and completeness with care.&lt;/li&gt;    &lt;li&gt;Blogs tend to have more &amp;quot;expert&amp;quot; reviewers than ecommerce sites - although often bloggers will be encouraged to post reviews to Amazon as well.&lt;/li&gt;    &lt;li&gt;Look for reviews which give specific praise/criticism. In particular if they give examples of teaching techniques, you will have more of an idea as to whether it&amp;#39;ll suit you. Reviews which basically say &amp;quot;I loved it!&amp;quot; or &amp;quot;That&amp;#39;s rubbish!&amp;quot; aren&amp;#39;t terribly informative.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;On that note, I should probably stop. That&amp;#39;s another train journey gone that I should probably have spent actually reading... ah well. Please comment if you have other suggestions with regards to reviewing - particularly if it could help me to review books in a more useful way in the future.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1639806" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/jon_skeet/archive/tags/General/default.aspx">General</category><category domain="http://msmvps.com/blogs/jon_skeet/archive/tags/Books/default.aspx">Books</category><category domain="http://msmvps.com/blogs/jon_skeet/archive/tags/Book+reviews/default.aspx">Book reviews</category></item><item><title>Programming "in" a language vs programming "into" a language</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/04/23/programming-quot-in-quot-a-language-vs-programming-quot-into-quot-a-language.aspx</link><pubDate>Wed, 23 Apr 2008 18:47:15 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1601545</guid><dc:creator>skeet</dc:creator><slash:comments>15</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/jon_skeet/rsscomments.aspx?PostID=1601545</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/jon_skeet/commentapi.aspx?PostID=1601545</wfw:comment><comments>http://msmvps.com/blogs/jon_skeet/archive/2008/04/23/programming-quot-in-quot-a-language-vs-programming-quot-into-quot-a-language.aspx#comments</comments><description>&lt;p&gt;I&amp;#39;m currently reading Steve McConnell&amp;#39;s &lt;i&gt;Code Complete&lt;/i&gt; (for the first time - yes, I know that&amp;#39;s somewhat worrying) and there was one section was disturbed me a little. For those of you with a copy to hand, it&amp;#39;s in section 4.3, discussing the difference between programming &lt;i&gt;in&lt;/i&gt; a language and programming &lt;i&gt;into&lt;/i&gt; a language: &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Programmers who program &amp;quot;in&amp;quot; a language limit their thoughts to constructs that the language directly supports. If the language tools are primitive, the programmer&amp;#39;s thoughts will also be primitive. &lt;/p&gt; &lt;p&gt;Programmers who program &amp;quot;into&amp;quot; a language first decide what thoughts they want to express, and then they determine how to express those thoughts using the tools provided by their specific language. &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Now don&amp;#39;t get me wrong - I can see where he&amp;#39;s coming from, and the example he then provides (Visual Basic - keeping the forms simple and separating them from business logic) is fine, but he only seems to give one side of the coin. Here&amp;#39;s a different - and equally one-sided - way of expressing the same terms: &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Programmers who program &amp;quot;in&amp;quot; a language understand that language&amp;#39;s conventions and idioms. They write code which integrates well with other libraries, and which can be easily understood and maintained by other developers who are familiar with the language. They benefit from tools which have been specifically designed to aid coding in the supported idioms. &lt;/p&gt; &lt;p&gt;Programmers who program &amp;quot;into&amp;quot; a language will use the same ideas regardless of their target language. If their style does not mesh well with the language, they will find themselves fighting against it every step of the way. It will be harder to find libraries supporting their way of working, and tools may well prove annoying. Other developers who come onto the project later and who have experience in the language but not the codebase will find it hard to navigate and may well accidentally break the code when changing it.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;There is a happy medium to be achieved, clearly. You certainly shouldn&amp;#39;t restrict your thinking to techniques which are entirely idiomatic, but if you find yourself wanting to code in a radically different style to that encouraged by the language, consider changing language if possible!&lt;/p&gt; &lt;p&gt;If I were attacking the same problem in C# 1 and C# 3, I could easily end up with radically different solutions. Some data extraction using LINQ in a fairly functional way in C# 3 would probably be better solved in C# 1 by losing some of the functional goodness than by trying to back-port LINQ and then use it without the benefit of lambda expressions or even anonymous methods.&lt;/p&gt; &lt;h3&gt;Accents and Conventions&lt;/h3&gt; &lt;p&gt;That&amp;#39;s just between different versions of the same language. Between different actual languages, it can get much worse. If you&amp;#39;ve ever seen Java code written in a C++ style or vice versa, you&amp;#39;ll know what I mean. I&amp;#39;ve previously referred to this in terms of speaking a language with an accent - you can speak C# with a Java accent just as you can speak French with an English accent. Neither is pleasant. &lt;/p&gt; &lt;p&gt;At the lowest level, this is likely to be about conventions - and I&amp;#39;m pretty sure that when Steve writes &amp;quot;Invent your own coding conventions, standards, class libraries, and other augmentations&amp;quot; he doesn&amp;#39;t actually mean us to do it in a gratuitous fashion. It &lt;i&gt;can&lt;/i&gt; be worth deviating from the &amp;quot;platform favoured&amp;quot; conventions sometimes, particularly if those differences are invisible to clients, but it should always be done with careful consideration. In a Java project I worked on a few years ago, we took the .NET naming conventions for interfaces (an I prefix) and constants (CamelCasing instead of SHOUTY_CAPS). Both of these made the codebase feel slightly odd, particularly where Java constants were used near our constants - but I personally found the benefits to be worth the costs. Importantly, the whole team discussed it before making any decisions.&lt;/p&gt; &lt;h3&gt;Design Patterns&lt;/h3&gt; &lt;p&gt;At a slightly higher level, many design patterns are just supported much, much better by some languages than others. The iterator pattern is a classic example. Compare the support for it from Java 6 and C# 2. On the &amp;quot;client&amp;quot; side, both languages have specific syntax: the enhanced &lt;code&gt;for&lt;/code&gt; loop in Java and the &lt;code&gt;foreach&lt;/code&gt; loop in C#. However, there is one important difference: if the iterator returned by &lt;code&gt;GetEnumerator&lt;/code&gt; implements &lt;code&gt;IDisposable&lt;/code&gt; (which the generic form demands, in fact) C# will call &lt;code&gt;Dispose&lt;/code&gt; at the end of the loop, no matter how that occurs (reaching the end of the sequence, breaking early, an exception being thrown, etc). Java has no equivalent of this. Imagine that you want to write a class to iterate over the lines in a file. In Java, there&amp;#39;s just no safe way of representing it: you can make your iterator implement &lt;code&gt;Closeable&lt;/code&gt; but then callers can&amp;#39;t (safely) use the enhanced for&lt;/code&gt; loop. You can make your code close the file handle when it reaches the end, but there&amp;#39;s no guarantee that will happen. &lt;/p&gt; &lt;p&gt;Then consider the &amp;quot;server&amp;quot; side of the iterator - the code actually providing the data. Java is like C# 1 - there&amp;#39;s no specific support for implementing an iterator. In C# 2 and above, iterator blocks (i.e. methods with &lt;code&gt;yield&lt;/code&gt; statements) make life much, much easier. Writing iterators by hand can be a real pain. Reading a file line by line isn&amp;#39;t too bad, leaving aside the resource lifetime issue - but the complexity can balloon very quickly. Off by one errors are really easy to introduce. &lt;/p&gt; &lt;p&gt;So, if I were tackling a project which required reading text files line by line in various places, what would I do? In Java, I would take the reasonably small hit of a &lt;code&gt;while&lt;/code&gt; loop in each place I needed it. In C# I&amp;#39;d write a &lt;code&gt;LineReader&lt;/code&gt; class (if I didn&amp;#39;t already have one!) and use a more readable &lt;code&gt;foreach&lt;/code&gt; loop. The contortions involved in introducing that idea into Java just wouldn&amp;#39;t be worth the effort. &lt;/p&gt; &lt;p&gt;At a much higher level, we get into whole programming styles and paradigms. If your natural inclination is to write imperative code, you&amp;#39;re likely to create a mess (or get very frustrated) in a functional language. If the problem really does call for a functional language, find someone else to help you think in a more functional way. If the problem suits imperative programming just as well as it does functional programming, see if you can change the environment to something more familiar.&lt;/p&gt; &lt;h3&gt;Conclusion&lt;/h3&gt; &lt;p&gt;I&amp;#39;m not suggesting that Steve&amp;#39;s point isn&amp;#39;t valid - but he&amp;#39;s done his readers a disservice by only presenting one side of the matter. Fortunately, the rest of the book (so far) is excellent and humbling - to such a degree that this minor quibble stuck out like a sore thumb. In a book which had more problems, I would probably barely have even noticed this one. &lt;/p&gt; &lt;p&gt;There&amp;#39;s another possibility, of course - I could be competely wrong; maybe I&amp;#39;ve been approaching problems from a restrictive viewpoint all this time. How about you? &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1601545" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/jon_skeet/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://msmvps.com/blogs/jon_skeet/archive/tags/Java/default.aspx">Java</category><category domain="http://msmvps.com/blogs/jon_skeet/archive/tags/General/default.aspx">General</category><category domain="http://msmvps.com/blogs/jon_skeet/archive/tags/Books/default.aspx">Books</category><category domain="http://msmvps.com/blogs/jon_skeet/archive/tags/Book+reviews/default.aspx">Book reviews</category></item></channel></rss>