Review: Eloquent Ruby (Russ Olsen)

If you are new to Ruby programming, Eloquent Ruby should be the book you read right after you finish your introductory Ruby book. It’s not a beginner’s tutorial, but with a little background on Ruby, it would be easy to follow.

This is one of the better programming books I’ve read. It has plenty of short and clear example code snippets, a very conversational and humorous writing style and most importantly, covers exactly the kind of topics a newbie should understand about Ruby.

The book is divided into 4 parts – (1) The Basics, (2) Classes, Modules and Blocks, (3) Metaprogramming (4) Pulling It All Together.

The firsts section covers the basic Ruby idioms in a way that you wouldn’t normally get to read in most books. It has chapters like “Choosing the Right Control Structure”, “Write Specs”, “Embrace Dynamic Typing”.

The second section — the most useful one, in my opinion — covers classes, modules and blocks with chapters like “Use Class Instance Variables”, “Use Blocks to Iterate” and “Use Modules as Name Spaces”. This section does an excellent job of explaining how to effectively use blocks, which are probably Ruby’s most useful feature.

The third section talks quite a lot about using, and of not misusing, the powerful method_missing method. Other Ruby metaprogramming topics such as monkey-patching are also covered.

The final section talks about one of Ruby’s greatest strengths — building DSLs — and also about creating and packaging gems. The book wraps up with a quick note on the the available ruby implementations.

At the end of each chapter there is a section “In the Wild” where the author points to real world code relevant to that chapter. Knowing where to look for real world examples will be especially useful for newbies who haven’t read a lot of other people’s code.

Another useful section in each chapter is “Staying Out of Trouble”, where the author explains the common pitfalls associated with the topic being discussed.

The examples that are used in the book make it extremely easy to understand. I often find books choosing overly elaborate examples and thereby distracting readers away from the language idiom being discussed. Eloquent Ruby doesn’t have that problem. The author starts with a simple Document class and uses the same example throughout the book, making it easy to focus on the idiom being discussed.

There are no real negatives I can point out, except for the slightly outdated chapter on packaging gems. However, I was reading the Safari’s Rough Cuts edition of the book, and it’s a work in progress, so it might get updated soon enough.

This book is a must read if you are a beginner to intermediate level Ruby programmer. It teaches the Ruby way of writing code, and answers many of the questions that one might have on the effective use of Ruby idioms.

You can read the Rough Cuts edition on Safari Books online.

Review: AOC F22 (22 inch widescreen monitor)

A month ago, I finally decided to switch to an LCD display, having been using CRT all this while. After looking around for a good but not too expensive monitor, I finally bought AOC’s recently released F22.

The F22 is a 21.5 inch widescreen monitor with a native resolution of 1920×1080, which means you can watch 1080p high definition video at 16:9 aspect ratio rather than the 16:10 available in most widescreen monitors.

So far I’ve been mostly satisfied with the monitor, and it is especially useful when I’m coding. Being able to use NetBeans with all that screen real estate feels great. This screenshot should give you an idea.

Apart from NetBeans, Photoshop is perhaps the only application I run in a maximized window. I’m not much of a designer, and I’ve only used it for minor tasks like slicing and resizing images, so I’m not really qualified to say whether or not it’s good for Photoshop work, but it’s definitely a huge step up from the two LCD monitors I’ve used at work (LG L1742S and Acer x153w) or my old CRT monitor.

Has it changed the way I use my desktop for browsing? I think so. I no longer run Firefox in a maximized window. Most websites out there aren’t really meant to look good at this resolution (including this blog) and some of them look outright hideous.

The only feature I can really use in a maximized window is the side-by-side multiple inboxes in gmail, but I stopped using that because I had to constantly switch it back because it looks terrible in the 1280×768 monitor I use at work. Now I’m resigned to using a window around 1280px wide so that the browser window looks the same as the one I have at work.

One category in which AOC definitely beats all competition is when it comes to the design and looks. The F22 monitor doesn’t have a conventional base like other monitors and instead has a base inspired by a photo frame with an adjustable single post stand that allows adjustment of the tilt angle. (see image below) This definitely has to be one of the best looking monitors I’ve seen.

When it comes to watching videos on this one, I’m happy with the colors and contrast. I played a high definition video to check what it would look like, and it exceeded my expectations in that regard. The clarity and the level of detail was stunning.

However, the brightness dips drastically at wider angles, and videos are almost unwatchable if I’m lying on my bed which is right next to my desk. I don’t really take the manufacturer’s viewing angle specs of 170/160 at face value, but unless I’ve really messed up the trigonometry calculations here, the viewing angle wouldn’t be more that 120-130 degrees at a 6ft distance from the desk. That for me is the major disappointment with this monitor. But then, I’m used to the CRT monitor’s viewing angle and that’s probably why I’m so harsh on this point.

Another drawback is that the pixels per inch is on the higher side at 102 PPI, (24″ displays have 91) which means fonts look smaller, but then that’s a trade off you have to make when you choose a 22″ monitor with 1080p resolution. This doesn’t normally bother me much, but when I visit websites that use smaller font sizes, I have to zoom in to be able to read comfortably.

AOC claims a dynamic contrast ratio (DCR) of 30,000:1 for this monitor, but in case of these specs, seeing is believing. (There are monitors claiming DCR of 1,000,000:1) There is a DCR mode in the luminance options of the OSD, but I would recommend wearing sunglasses to avoid being blinded by the extremely high brightness levels. I might be wrong here, but isn’t DCR all about reducing the illumination for the dark pixels rather than increasing it for the brighter pixels?

There are VGA and DVI inputs for the dislpay. Strangely enough, there is no HDMI port, which is fairly standard these days on monitors with this resolution. However, I don’t have any complaints ther as I only use it with my desktop. Also, it does not feature any USB ports, which are also standard on monitors these days.

Despite all that grumbling in the previous 2-3 paragraphs, I’m kind of happy with my choice of monitor. The viewing angle is the only thing that irks me about the display. The large screen area obviously helps a lot when I’m working, and it’s nice watching videos on it, even though I have to stay within a narrow viewing angle to enjoy it fully.

My rating: 8/10