Deprecated: Assigning the return value of new by reference is deprecated in /home/melaloui/public_html/ueckerman/wp-settings.php on line 520

Deprecated: Assigning the return value of new by reference is deprecated in /home/melaloui/public_html/ueckerman/wp-settings.php on line 535

Deprecated: Assigning the return value of new by reference is deprecated in /home/melaloui/public_html/ueckerman/wp-settings.php on line 542

Deprecated: Assigning the return value of new by reference is deprecated in /home/melaloui/public_html/ueckerman/wp-settings.php on line 578

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/melaloui/public_html/ueckerman/wp-settings.php on line 18

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/melaloui/public_html/ueckerman/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/melaloui/public_html/ueckerman/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el(&$output) in /home/melaloui/public_html/ueckerman/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el(&$output) in /home/melaloui/public_html/ueckerman/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/melaloui/public_html/ueckerman/wp-includes/classes.php on line 1244

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/melaloui/public_html/ueckerman/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/melaloui/public_html/ueckerman/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el(&$output) in /home/melaloui/public_html/ueckerman/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el(&$output) in /home/melaloui/public_html/ueckerman/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/melaloui/public_html/ueckerman/wp-includes/classes.php on line 1442

Strict Standards: Redefining already defined constructor for class wpdb in /home/melaloui/public_html/ueckerman/wp-includes/wp-db.php on line 306

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /home/melaloui/public_html/ueckerman/wp-includes/cache.php on line 431

Strict Standards: Declaration of Walker_Comment::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/melaloui/public_html/ueckerman/wp-includes/comment-template.php on line 1128

Strict Standards: Declaration of Walker_Comment::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/melaloui/public_html/ueckerman/wp-includes/comment-template.php on line 1128

Strict Standards: Declaration of Walker_Comment::start_el() should be compatible with Walker::start_el(&$output) in /home/melaloui/public_html/ueckerman/wp-includes/comment-template.php on line 1128

Strict Standards: Declaration of Walker_Comment::end_el() should be compatible with Walker::end_el(&$output) in /home/melaloui/public_html/ueckerman/wp-includes/comment-template.php on line 1128

Strict Standards: Redefining already defined constructor for class WP_Dependencies in /home/melaloui/public_html/ueckerman/wp-includes/class.wp-dependencies.php on line 31

Strict Standards: Redefining already defined constructor for class WP_Http in /home/melaloui/public_html/ueckerman/wp-includes/http.php on line 61
ueckerman.net » Programming Languages

Archive for the ‘Programming Languages’ Category

Book Review: JavaScript: The Good Parts

{Tuesday, March 16th, 2010}

I had been looking forward to reading Doug Crockford’s book since I enjoyed his similarly titled presentation one year ago. I came across the presentation searching for a better way to develop JavaScript, a language I had considered terrible since I knew better. Of the languages I have used in web application development I assumed it encouraged the most obfuscated code of all. This book, I hoped, would be JavaScript’s redemption and would show me why the UI Freaks love the language. My intention in this blog is to review the book, briefly listing Pros and Cons and finally a summary and rating.

Pros

  • JavaScript as a functional language: While JavaScript’s syntax attempts to disguise the language as a conventional imperative language, Doug convinces that the language is functional at its core.
  • Extending the features of the language: While it’s fundamental features are limited, Doug explains how to extend those features to include constructs such a currying.
  • There are plenty of bad parts: Doug, while being involved in the language for sometime, is clearly impartial presenting more negative than positive parts. I’m grateful the appendices on the awful and bad parts are included - I found them particularly education and entertaining.

Cons

  • 100 pages = not many good parts?: While arguably a Pro, the length itself implies JavaScript doesn’t have many good parts.
  • Focus on JavaScript: 15% of the book focuses on Regular Expressions. One complex example is painfully analyzed over 5 pages. Nasty. Just refer me elsewhere to learn more already.
  • Unexplained complex examples: A chapter dedicated to standard methods available on Objects, Arrays and Functions presents hypothetical implementations that are not discussed. Either explain them or don’t include them at all - their too complex to be given the silent treatment. Don’t throw-in one page of continuous, unexplained script - any site can give me that experience for free just by looking at the source.
  • Presentation aimed at experts, book aimed at novices: The presentation was targeted to an expert audience - it’s a shame the book doesn’t follow suit. Initial chapters discuss the basic language syntax for those who’ve never seen it before.
  • Poorly factored code: The book talks about The Good Parts, but in the process why not show Some Good Code? Yet another author who discusses good coding form, and has even authored JSLint, yet publishes some shocking code. Worst case is one method spread over an entire page - unexplained to boot.
  • Filler content: You get the impression that the author has thrown in some content as filler - maybe it was a challenge to make 100 pages? The last two chapters are simply essays in general programming for the novice. Throw in detail on Regular Expressions, unexplained code examples and laborious syntax discussions and you get the impression the good parts can be covered in 30 pages. Maybe a whitepaper was a better alternative?
  • Stop mid-way: I’d argue you don’t need to go the distance on this one. The experienced JavaScript developer will get little from the final 4 chapters.

Summary

I am a better JavaScript developer because of this book, and that alone makes it worthy of a recommendation. For such a small book though, you’ll feel like you’re taking the long way to reach your destination. Overall 4.5/10.

Book review: Programming Scala

{Wednesday, March 10th, 2010}

I was introduced to Scala by a colleague around 4 years ago via the Lift framework. At the time I dismissed the language, preferring to focus my energies on Ruby and Ruby on Rails. 4 years later and Scala is getting some serious water-cooler time - especially since the Ruby vs Scala flame wars prompted by Twitters move from Ruby to Scala for back-end grunt. So I choose Programming Scala - Tackle Multicore Complexity one the Java Virtual Machine as the book to guide me learning the language as a relative noobie. This blog is a brief review; Pros and Cons followed by a brief summary and rating.

Pros

  • Writing style: The author keeps the language simple and the content flows nicely. My cover-to-cover read time was a near record.

Cons

  • Unusual chapter order: Introduce exception handling constructs after explaining concurrent programming and test frameworks? Exclude XML pattern matching from the pattern matching chapter? Explain reverse function calls in the midst of explaining collections? Some very strange decisions were made about the books structure.
  • Repeated explanations: The last few chapters briefly describe syntax covered in depth earlier. This gives the impression the author brain-dumped latter chapters without thought of earlier chapters.
  • Depth of content: It falls short explaining how the Scala library implements some of the language features. As it targets the experienced Java developer, the audience will find it falls short explaining how the features are realized through Java. The library apparently has some great examples of how to use the language effectively - yet these are never explained. It would also be great to appreciate why the language authors preferred syntax cryptic to the untrained eye like this:

    for(node @ {_*} <- nodes) { ... }

    or this:

    val total: Int = (Map[String, Int]() /: (rootNode \ “element”)) { (map, element) => … }

  • Idiomatic use not mentioned: No mention is made of idiomatic use of the language other than encouraging use of a few methods accepting closures. I expect more from a language guide.
  • Code examples poorly factored: Too often code examples in language guides stink. This is no exception. Don’t explain to me the value of refactoring and TDD and then proceed to present poorly structured code. Authors should encourage good form in their readers by consistently presenting good form themselves - no excuses. Show me you are an expert in what you do.
  • ‘Tackling Multicore Complexity’?: There is only one chapter on concurrency. It only goes so far as to explain the language constructs without going into details on patterns of their use. The hardest consideration of concurrency is how to test it - but there’s no mention of approaches for that. This makes the title of the book misleading. The main sales pitch falls short.
  • Summary

    It’s not a detailed language guide. It doesn’t cover functional programming in depth. It only touches on concurrency. I am now confident I understand Scala’s syntax, however, I’d be short on the confidence to apply it solving real world problems without an understanding of similar languages. Overall 5/10.

Equality: 4 times the charm

{Thursday, August 9th, 2007}

Ruby’s equality options have baffled me in recent times. No surprise that JRuby has encountered related problems.