Friday, October 18, 2013

Book Review: iOS 6 Programming Cookbook By Vandad Nahavandipoor, O'Reilly Media

I reviewed this book as part of the O'Reilly blogger program.  

The format of the book consists of concise recipes which state the problem and show how to implement a solution with easy to follow code samples.  I love how the e-book has code samples in color with syntax-highlighting, and I found that the code was easy to translate to use with the Ruby Motion framework.  Of course, the recipes work fine with native Cocoa as well.

Being a cookbook, I don't think this book was intended to be read cover to cover, although I did just that when reviewing it. You could do that as well, but it might serve you better to use it as a reference. The good thing is that this book is organized almost like a non-cookbook; i.e. it has beginner topics in the first chapter(s) and gets progressively more advanced as you go on.

Although iOS 7 is available now, I would still highly recommend this book.
Read more about this book on its product page.

Saturday, October 06, 2012

Book Review: Code Simplicity: The Fundamentals of Software, by Max Kanat-Alexander, O'Reilly Media

Writing code seems like an easy task, and perhaps it is.  However, it can be difficult to write simple, clean code.

The book, "Code Simplicity: The Fundamentals of Software", explains:

  • Why do you want to write simple code?
  • How do you write simple code?
However, you will not find any code samples in this book.  While this may not be appealing to some readers, I did not feel that this lowered the quality of the book.  

It contains many guidelines and principles that experienced software craftsmen already know and might pass on to their apprentices.  Some of these principles:
  • Don't write code that isn't needed
  • Make the code easy to change
  • Comments -- should you add them? Why/why not?
A very experienced crafstman may not get much out of this book, but if you consider yourself a beginner or intermediate software developer, then I'd highly recommend this book.  It's full of great tips that will benefit you immediately and in the future.

You can find more about Code Simplicity on its product page on O'Reilly.

Thursday, March 01, 2012

Review: "The Little Book on CoffeeScript" by Alex MacCaw, O'Reilly Media

This book might be "little", but don't let that mislead you; it's packed with enough content so that you'll understand all of what CoffeeScript has to offer.

Alex MacCaw does a great job of covering the major features of CoffeeScript in six short, but detailed chapters.

He starts off covering the basic syntax, and then moves on to cover something that is frowned upon by many in JavaScript, but not so much in CoffeeScript: classes.  Initially, I was hesitant to use CoffeeScript's classes prior to reading this book, but after seeing how they are implemented, and how easy they are to use, I was sold.

After covering classes in Chapter 2, you'll learn about CoffeeScript idioms in Chapter 3, such as: each, map, select, min/max, etc.  Chapter 4 covers the Cake build system and shows you how to build and deploy CoffeeScript client-side applications, which is pretty awesome.

The book winds down in Chapter 5 talking about what CoffeeScript improved upon in JavaScript, and what it did not. The final chapter is written by the creator of CoffeeScript, Jeremy Ashkenas. It basically talks about the philosophy of CoffeeScript and invites you to create your own special language as well.

My thoughts on the book:
  • It's short and very easy to read.
  • You'll walk away feeling ready to write some CoffeeScript apps or sprinkle it in your Rails apps.
  • The one negative about the book is that in some parts, some syntax was explained after the fact, which made it difficult to understand some of the examples.
  • Overall, I'd highly recommend picking up a copy as it's concise and easy to read.

Friday, February 03, 2012

Book Review: "The Book of CSS 3" by Peter Gasston

Disclaimer: As part of the O'Reilly Blogger Review Program, I chose to review this book.  More details can be found here.


The ideal audience for this book is a web developer who is familiar with CSS and has designed several websites.  In other words, you won't learn how to design a nice layout but you will learn all of the details about CSS 3.

The things I liked about this book are that there are numerous examples in every chapter, with pictures that demonstrate different CSS properties.  Of course, what good is a book about CSS without pictures?
Another thing that you will find useful is at the end of every chapter, Peter provides a chart outlining how well the major browsers support a particular feature.  

There aren't many bad things about this book.  My suggestion is that you do not read it cover to cover, as I believe it would be better used as a reference book.  The only other thing that I didn't like about this book is that the examples are in black & white; it would've been nice to see the images in color, especially in the PDF version of this book.

Overall, it’s a great book to get to learn how to implement the latest cool features in CSS 3.  The numerous examples in the book are very helpful, and it will serve as a great reference book to keep on your desk.

Saturday, April 16, 2011

Replace Prototype with jQuery in Rails 3

Note: I'm using Rails 3.0.3.

I decided to use jQuery instead of Protoype on my personal Rails 3 project.  At first, I naively thought that I could simply include jQuery instead of Prototype, and everything would run just fine.  Instead, I noticed that Chrome was reporting an error in rails.js, which eventually led me to Josh Huckabee's blog post, as well as the official jquery-rails gem.

The installation instructions on the github page are straightforward and simple, so I won't reproduce them here.  After you add the gem to your Gemfile and install it, and you run the command:
rails generate jquery:install
it will pull down the latest version of jQuery.   You should answer "yes" when it asks if you want to overwrite rails.js.

I modified my default layout (application.html.erb) to include this line:
  <%= javascript_include_tag "jquery-1.5.2.min", "jquery.jeditable.mini.js", "rails", "application" %>

Of course, you might not need some of these, and you can include additional files as well.

Friday, December 31, 2010

vim tip: searching for word under cursor

I was motivated to use vim a few years ago, after watching Corey Haines do his number to LCD kata at the Simple Design and Testing Conference (SDTConf). Although I learned the basics while I was in college, I never really tried to progress beyond that until recently.

Now I try to make a habit of whenever I am doing something that just seems like it's the hard way, I'll google it and learn how to do it better.

Today, I was thinking: there has to be a better way to search for things rather than typing "/thing_to_search_for". So I found out how to search for the word under the cursor, which is # for searching backwards, and * for searching forwards.

Hope this helps, and motivates you to keep learning something new everyday.

Thursday, December 23, 2010

Installing ruby 1.9.2 with rvm

I've been having trouble installing ruby 1.9.2 with rvm on Mac OS X.
Although there are lots of great blog posts with solutions, for some reason, none of them worked for me.

The rvm page and many posts say to pass --with-iconv-dir to rvm install.
However, I kept getting errors about Tcl/Tk not being 64-bit, and iconv also not being 64-bit.
Why would it be complaining about iconv, especially since I used rvm to install it?



I noticed the config.log spit this out:

configure: WARNING: unrecognized options: --with-iconv-dir


I tried many options that were in configure, but none of them pointed the makefile to rvm's version of iconv.

So I took a look at /usr/local/lib/libiconv.2.dylib and noticed it was a symlink.
Perhaps this is taking the easy way out, but I backed it up by renaming it, and relinking that to the version inside $rvm_path.
After that, I recompiled by running:

 rvm install 1.9.2 -C --enable-shared


Success!
The output:


Hopefully, this helps some of you out there with similar problems.