Head First HTML and CSS, 2nd Edition – An effective and entertaining guide now updated for HTML5 – #bookreview

Head First HTML and CSS, 2nd Edition
Elisabeth Robson and Eric Freeman
(O’Reilly,
paperback)

As a techie, I am admittedly a bit mediocre. I do know most of the critical differences between a couch and CouchDB. But I don’t speak fluent JavaScript or Klingon. I seldom eat regular expressions for breakfast. And I never brush my teeth with JSON or even SQLite.

In other words, I have to look up stuff in books, mess around with code examples, and try to puzzle out why I just wrote a function that completely blew up when I called it.

The clearer the how-to instructions and code examples, the better for my time-battered brain.

So, here is no surprise: I love the “Head First” series from O’Reilly. Its books introduce topics in amusing, easy-to-handle bites (and bytes) that are well illustrated and presented in orderly progressions. Typically, you create a simple project and spend the rest of the text learning how to add functions or features to it and improve its appearance and overall usability.

When I am in a mood to play for a few minutes or an hour or so, I enjoy opening a “Head First” volume. I can quickly teach my old-dog-self new tricks by working through a few of the examples and lighthearted explanations.

First published in 2005, Head First HTML and CSS has now been updated to cover HTML5. If you are a newcomer wanting to work with web pages or expand some basic web-page knowledge, Elisabeth Robson’s and Eric Freeman’s new 2nd edition is an excellent guide. It shows, step by step, how to create standards-based web pages using HTML5 and cascading style sheets (CSS).

Do not be intimidated by the book’s size (723 pages) and heft (nearly four pounds).  It will get you off to a fast start learning basic Hyper Text Markup Language (HTML). Then it introduces each new topic in small steps, with plenty of screenshots, diagrams, notes, tips, exercises, and Q&A sessions to help you stay on track.

Here is how the book is organized:

  1. The Language of the Web: getting to know html
  2. Meet the “HT” in HTML: going further, with hypertext
  3. Web Page Construction: building blocks
  4. A Trip to Webville: getting connected
  5. Meeting the Media: adding images to your pages
  6. Serious HTML: standards and all that jazz
  7. Adding a Little Style: getting started with CSS
  8. Expanding your Vocabulary: styling with fonts and colors
  9. Getting Intimate with Elements: the box model
  10. Advanced Web Construction: divs and spans
  11. Arranging Elements: layout and positioning
  12. Modern HTML: html5 markup
  13. Getting Tabular: tables and more lists
  14. Getting Interactive: html forms

The authors introduce basic HTML before taking you into HTML5. And they deliberately advocate “a clean separation between the structure of your pages and the presentation of your pages.” They teach you “to use HTML for structure and CSS for style….” They also show you how to test your web pages using more than one browser, so you can learn how to create pages “that work well in a variety of them.”

They do not try to cover everything in their “brain-friendly guide.”  They offer Head First HTML and CSS, 2nd Edition as “a learning experience, not a reference book.” (The book’s appendix, by the way, is titled “The Top Ten Topics (We Didn’t Cover): leftovers.” It focuses on more things you might want to consider and try.)

Once the authors have tossed you in head first and helped you develop a reasonably good feel for HTML5 and CSS, then you can go look for the fancy stuff.

You will have better notions of what to do with it once you have it.

Si Dunn

Learning JavaScript Design Patterns – For better JavaScript and jQuery coding – #programming #bookreview

Learning JavaScript Design Patterns
Addy Osmani
(O’Reilly, paperbackKindle)

New to JavaScript and jQuery or looking to expand your skills? This well-focused how-to guide can help you learn how to recognize and apply reusable design patterns to your coding.

“A pattern is a reusable solution that can be applied to commonly occurring problems in software design—in our case, in writing JavaScript web applications,” Addy Osmani notes in his new book. He is a developer programs engineer on the Chrome team at Google, and he is a frequent contributor to publications such as JavaScript Weekly.

“Another way of looking at patterns is as templates for how we solve problems—ones that can be used in quite a few different situations,” Osmani adds.

In his view, design patterns offer three key benefits for JavaScript and jQuery developers. First, the patterns offer “proven solutions….They provide solid approaches to solving issues in software development using proven techniques….” created and tested by others. Second, design patterns “can be easily reused” and offer “an out-of-the-box solution that can be adapted to suit our own needs.” And, third, “patterns can be expressive…there’s generally a set structure and vocabulary to the solution presented that can help express rather large solutions quite eloquently.”

Osmani also emphasizes that patterns do not provide “exact solutions…the role of a pattern is merely to provide us with a solution scheme.” But a key goal of his book is to convince JavaScript and jQuery  developers that “[r]eusing patterns assists in preventing minor issues that can cause major problems in the application development process.”

Learning JavaScript Design Patterns (235 pages) is structured with 14 chapters and an appendix.

  1. Introduction
  2. What Is a Pattern?
  3. “Pattern”-ity Testing, Proto-Patterns, and the Rule of Three
  4. The Structure of a Design Pattern
  5. Writing Design Patterns
  6. Anti-Patterns
  7. Categories of Design Patterns
  8. Design Pattern Categorization
  9. JavaScript Design Patterns
  10. JavaScript MV* Patterns
  11. Modern Modular JavaScript Design Patterns
  12. Design Patterns in jQuery
  13. jQuery Plug-in Design Patterns
  14. Conclusions

The appendix, “References,” includes 39 links for additional information related to JavaScript design patterns.

The author offers numerous code samples and graphics to help illustrate his explanations. He provides looks at more than 20 “classical and modern” design patterns in JavaScript. And he explains several choices for writing modular code, including the Module pattern, Asynchronous Module Definition (AMD), and CommonJS.

He also describes design patterns available within the jQuery library and explores “a number of jQuery plug-in patterns that have worked well for other developers in the wild.”

Addy Osmani’s well-written book provides clear guidance to understanding how adapting and using existing design patterns can help software developers work more efficiently and effectively in JavaScript and jQuery.

Si Dunn