Showing posts with label Book Review. Show all posts
Showing posts with label Book Review. Show all posts

Thursday, March 17, 2011

Book Review: Eloquent JavaScript

Eloquent JavaScript: A Modern Introduction to Programming


During my flight to and from Seattle, WA from the MVP Summit I was able to read Eloquent JavaScript: A Modern Introduction to Programming by Marijn Haverbeke (@marijnjh). It is kind of funny to say, but for some parts of the book it almost read like a novel. Read on for more details ;)

Table of Contents

  1. Introduction
  2. Basic JavaScript: Values, Variables, and Control Flow
  3. Functions
  4. Data Structures: Objects and Arrays
  5. Error Handling
  6. Functional Programming
  7. Object-Oriented Programming
  8. Modualarity
  9. Regular Expressions
  10. Web Programming: A Crash Course
  11. The Document Object Model
  12. Browser Events
  13. HTTP Request

An Enjoyable Read


I enjoy technical books anyway, but this one was quite unique. Not only did it get into the nitty gritty of JavaScript, techniques, and patterns, but it also did it in a light hearted and often times hilarious way. For example, there were two stories described in the book "Aunt Emily's Cats" and "The Sad Story of the Recluse" that really stood out to me. I don't know the last time I've read a technical book and the stories have made such an impression.

Aunt Emily's Cats

Story: A story of a guy whose crazy Aunt has over 50 cats living with her and she regularly emails you to keep you up-to-date. At the end of each email she appends what cats have been born and which cats have died. You want to humor your Aunt by keeping track of the genealogy of her cats so that you can ask about her cats, their birthdays, etc…

Solution: Write an algorithm to parse all the emails the Aunt sent and build up a genealogy using JavaScript and techniques that are taught along the way.

The Sad Story of the Recluse

Story: There was a recluse living in the mountains. He didn't do much, but one day he wanted to write something, so he decided to write a technical book. Instead of writing his book in HTML he decided to make up his own Markdown-ish language that he would later convert into HTML. Unfortunately, the recluse was struck by lightening and died.

Solution: In his honor, the book guides you on how to write the program that the recluse only had dreamed.

Funny Code Examples


Don't worry, there is no lack of code in this book. In fact some of the code is downright hilarious!

In his explanation of the stack in JavaScript he shows asking the computer a really hard question that causes it to run out of space or "blow the stack"!

function chicken() {
   return egg();
}

function egg() {
   return chicken();
}

print( chicken() + " came first." );

I wish I would have thought of that. A good example and funny! LOL

Memorable Quotes


As I wrote in my margins the following quotations from his book stood out to me, so I thought I would share them with you.

"The art of programming is the skill of controlling complexity" --Page 3

"Pure functions are the things that mathematicians mean when they say "function." They always return the same value when given the same argument and do not have side effects...Generally, when something can naturally be expressed as a pure function, write it that way. You'll thank yourself later. If not, don't feel dirty for writing nonpure functions." --Page 37

"...[don't] worry about efficiency until your program is provably too slow. When it is, find out which parts are taking up the most time, and start exchanging elegance for efficiency in those parts." --Page 38

"If we build up a big string by concatenating lots of little string, new strings have to be created at every step, only to be thrown away when the next piece is concatenated to them. If, on the other hand, we store all the little strings in an array and then join them, only one big string has to be created." --Page 88

Summary


I would target this book for both a beginner and intermediate developer. As I've mentioned before, the book was pretty easy to read and in some parts quite amusing ;)

Even thought you might be tempted to skip a chapter here and there because you think you know something, I would encourage you to read it from start to end. You never what what small nuances you've been missing all these years about JavaScript.

An older version of the material can be found free online ( HTML/PDF ) and also a revised and updated version is available from Amazon ( Paperback/Kindle ).

Thanks Marijn Haverbeke for an informative and enjoyable book!

Monday, January 18, 2010

Book Review: 51 Tips, Tricks, and Recipes with jQuery & ASP.NET Controls

842d59697bf6bdc2afa9cc8a899e8e52I recently finished reading the 51 Tips, Tricks, and Recipes with jQuery & ASP.NET Controls eBook by Suprotim Agarwal. The eBook is $14.99 and it comes with a 14 day 100% money back guarantee. It can be ordered from the DotNetCurry website.

This eBook reminded me a lot of Cody Lindley’s jQuery Enlightenment in that it split it’s eBook into small bit size installments (known as recipes) that can be consumed either sequentially or on a individual basis. The recipes are organized into situations or problems that you might want to solve using jQuery. This eBook differs from jQuery Enlightenment in that it focuses on the interaction with ASP.NET WebForms, which has a unique rendering of its server controls.

Most of my web development history has been doing ASP.NET WebForms (and more recently ASP.NET MVC) so, I enjoyed reading this eBook. I could understand the situations, problems, and pain points that the eBook addressed. It was nice to see how jQuery can resolve these issues in an unobtrusive and cross-browser way while only requiring a small amount of code.

Each recipe is formatted in the same way…

  • A challenge that explains the situation, problem, or pain point being addressed
  • The solution displayed in the form of HTML and jQuery
  • An explanation of the code broken up in paragraphs, code snippets, and screen shots
  • A link to a live demonstration
  • A list of supported browsers for the above recipe
  • Useful links that are appropriate to further explain features from the code.

I would have written some of the code differently and I did find some performance concerns, but nothing major and when push comes to push and shove many micro-optimizations become moot in the big picture. Selector optimization and looping performance can help make your code become more efficient, but it is really DOM manipulation that will kill your performance in the end.

Updated: I have updated this post with a link to my detailed findings, suggestions, and opinions. You can find my comments here.

Despite these minor issues, I do recommend this eBook for any ASP.NET WebForms developer hoping to learn how jQuery could be integrated into their environment.    

Tuesday, November 03, 2009

jQuery Enlightenment eBook Review

Introduction

I just finished reading the jQuery Enlightenment eBook by Cody Lindley (@codylindley) and let me tell you it was definitely worth my time ;)

You may be already familiar with Cody Lindley as the author of the modal jQuery plug-in Thickbox.

As stated by the author, this eBook is intended for 3 types of people

  1. A beginner jQuery developer looking to learn more
  2. Someone that already knows another JavaScript library
  3. Someone looking for an awesome set of reference material for jQuery

Review

The contents of this eBook range from basic to complex themes such as core library features, selectors, traversing, manipulation, forms, events, performance, animation, ajax, etc…

One of the great things about this eBook is that each section self-contained and could be understood apart from the other sections. So you could conceivably skip around in the book and still understand what is necessary fore that section.

The feature that I was most impressed upon was the JsBin integration with all of the 100+ code samples. JsBin is a service that allows you to share, execute, and modify code snippets to aid in the learning process. For example, you can take of the code snippets (example code snippet) from the jQuery Enlightenment eBook and click the Output tab for the results of the jQuery. Then you can double-click the HTML to experiment with your own examples.

A feature that you should definitely not skip over is the notes portion of each section. On numerous occasions I found very useful tips and insights clues into the jQuery framework.

Note: I found some minor typos and code snippets issues during my detailed reading of the eBook. You can review my comments and issues in a Google Document I put together…

Summary

I highly recommend this eBook to anyone hoping to not only understand how to write jQuery, but also to understand the why behind the how. If you have any JavaScript experience at all and would like to bring your jQuery game to the next level… then, this eBook is for you!

The eBook is very affordable coming in at only $15. You can also purchased printed version from lulu.com for $30 (black & white) or $45 (color). If the price is a factor, might I suggest you asking your work to buy it on your behalf ;)

Ohh, and 10% of the price goes back to the jQuery project… so you’ll be supporting open source software too ;)

Other jQuery Enlightenment Reviews

Thursday, September 10, 2009

ASP.NET MVC 1.0 TDD Book Review

AspNetMvcTdd I recently finished reading Emad Ibrahim’s ASP.NET MVC 1.0 Test Driven Development book and I thought I would do a detailed review and share my thoughts and findings.
Before I get into the details of the book, it is important to know that the audience of this book is not for novice programmers or experience non ASP.NET developers. To really get value from this book, you should have some decent exposure to ASP.NET under your belt.
With that said, this book is a very good overview of both ASP.NET MVC and Test Driven Development (TDD). It takes the reader through the process of developing a whole application using the Test First methodology. I found this interesting in that some decisions Emad made initially were later refactored in the book as the application evolved and changed, which is a great way to see the value of TDD and its approach.
This book covers quite a few advanced programming concepts that may be new to you such as various Design Patterns (Strategy, Null Objects, Repository, etc…), Design Principles (Open-Closed Principle, YAGNI, DRY, Inversion of Control, Single Responsibility, Convention Over Configuration, etc…). Emad does a good job about explaining these concepts as he approaches them in the application.
About the same time that I was reading this book, I was in the process of evaluating various tools and frameworks to use for a new ASP.NET MVC v2 project I am working on. I found it interesting that Emad ended up choosing most of the same tools that I had at the time such as: MbUnit, Ninject, Moq, and jQuery. If you are familiar with tools other than the ones he chose at the time of writing this book, you should be able to easily substitute your favorite tool instead. Most of the competitors for these tools have basically the same features.
Since this is a new book, I did run across numerous typos, references to code that wasn’t displayed, refactored code that wasn’t indicated in the text, and several other minor issues, but all in all I knew what Emad was getting at and it wasn’t hard to follow his train of thought. I submitted these inconsistencies to the Errata to hopefully clean up these small issues for future printings of this book. I posted my findings and you can review them online.
I highly recommend downloading the source code from this book (which you can do for free). It is one of the few projects that I’ve seen that has a plethora of Unit Tests to look at and get an idea of how to test your ASP.NET MVC project. I’ve seen numerous other ASP.NET MVC projects that only have a minimal number of Unit Tests and don’t really give you a good idea of how you could get good Code Coverage.
If you are interested in getting a jumpstart into both ASP.NET MVC and Test Driven Development, then I think this is a great book for you to get. However, if you aren’t so sure about TDD and you just want to get up to speed on ASP.NET MVC, then I might recommend you get one of the other beginning ASP.NET MVC books such as:
    Note: A danger of listing books is that I may have missed one ;) If so, please leave a comment listing any of another ASP.NET MVC book published as of the date of this blog post and I will be happy to add it to the list.
I haven’t read any of the above books yet, but I do hope to in the near future and as I do I plan to perform book reviews for those as well.
Thank you Emad for all of your hard work on your book. I enjoyed reading it over my extended Labor Day weekend :)
Updated: You can view the Errata document I put together listing all the inconsistencies, typos, minor issues, etc… online.