The Pragmatic Craftsman :: Simplicity from complexity :: | Home | About Me |

DOM Scripting


DOM Scripting
by Jeremy Keith
ISBN 1-59059-533-5
Date Read 5/2009

My Rating

I believe in doing things the right way. So does the author of this book. In this regard, this is a great book: You learn what the right way is.

Not for hard-core developers. The intended audience is web designers. I second that. This book is also an excellent choice if you're just thinking whether web-development with JavaScript is for you. Or if you want to read about web-development's best practices (read chapter 5). It is not thorough and does not cover the advanced topics, like OO programming, etc.

Doing things right. And how to get there. This the nicest feature about this book. Slowly, sometimes first showing the bad approach and then refactoring to a more best-practices oriented solution. Nicely done. I wish more beginning books had an approach like this.

Separation of concerns: Separation of layers. My main objective for reading this book was so I learn more about the best practices. I did not learn anything new, but reading about the best practices again is a nice refresher. Separating structure, presentation, and behavior is the most important best practice when doing web development. The author does a good job explaining and really diving into this concept.

To say it once more, HTML, CSS, and JavaScript should be separate. You'll learn that in this book.


Object-Oriented JavaScript


Object-Oriented JavaScript
by Stoyan Stefanov
ISBN 1847194141
Date Read 5/2009

My Rating

After reading my last JavaScript book, Professional JavaScript for Web Developers, I was looking for some more JS books to read. Something good. Then a few days ago I read a post by Klaus Komenda, Book Review: Object-Oriented JavaScript, and he highly recommended this book. (In the process, I also discovered DOM Scripting, and Pro JavaScript Design Patterns.) I picked up this book and had high expectations.

Decent book. After finishing the excellent Professional JavaScript for Web Developers book, the standards were set very high. This book is good, but not as deep, and not filled with as many full examples. It's good, but not as good.

Quick. This book reads very quickly. The examples are short, the writing style is very conversational. That's a nice feature. On the downside, sometimes a feature you're reading is not easy and you'd like a bit more on the subject. You're out of luck.

I learned a few things. Firebug console can execute JavaScript -- I did not know that! I also got an overview of regular expressions syntax in JavaScript. Good job there. I also learned couple other things, but majority of the concepts in this book were included in the Pro book I mentioned.

Overall, not a bad book, but I don't recommend it. By now, you know which JS book I do recommend. :-)


Javascript Resources

Over the past couple of weeks I have digged into learning Javascript on a deeper level. I have learned a great deal. Along the way, I've come across some very good Javascript resources. Listed below are links to the best I've found.

Douglas Crockford articles - Javascript guru

JavaScript core skills -- list of very good articles on Javascript by Opera developers

JavaScript Programming Patterns - an excellent articles about OO programming in Javascript

Professional Javascript Development -- excellent Javascript book


Professional JavaScript for Web Developers (2nd ed)


Professional JavaScript for Web Developers (2nd ed)
by Nicholas C. Zakas
ISBN 047022780X
Date Read 4/2009

My Rating

This book has opened my eyes in the JavaScript development world. For real. I did not know object-oriented JavaScript. I did not a lot of JavaScript patterns available. Nor did I now the best practices for JavaScript. Until now. :-)

This is the best JavaScript book out there now. I checked out almost all of them (Pro JavaScript Techniques, Javascript: Definitive Guide, and others). This book gives you all the coverage of JavaScript you need. Explained in a clear and intuitive manner. Full of examples. Great examples. I really love this book!

Excellent JavaScript coverage. Basics. Object Oriented. Events. DOM. Ajax. Best Practices. It's all here. Plenty more, actually.

Focus on best practices. This is where this book shines. I love authors like Mr. Zakas. He tells you how you should be developing, what the best practice is.

Excellent examples. Another great aspect of this book. I learn by examples. I like to see a lot of examples. Great job by the author.

Great object-oriented coverage. There are different ways of object-oriented programming in JavaScript. Some better than others. Some more efficient than others. I have learned a great deal about JavaScript OO from the author. The author discusses numerous OO patterns and techniques.

Read this book. You will become a better JavaScript developer. I am sure about that. You will learn much, much more about the capabilities of JavaScript. I am amazed how far JavaScript has progressed.

I am more of a Java developer than a web developer. However, JavaScript is becoming used more and more. There are patterns, OO programming in JavaScript -- more of a typical programming language. I predict we'll see more and more back-end developer doing JavaScript. This book is of great help.


What is Maintainable Code

While reading the excellent Javascript book, Professional Javascript for Web Developers, I came across a very good definition of maintainable code. It's one that I fully subscribe to, but since it was put so well in the book, here it is.

What is Maintanable Code?

Maintainable code has several characteristics. In general, code is said to be maintainable when it is all of the following:

  • Understandable -- Someone else can pick up the code and figure out its purpose and general approach without a walkthrough by the original developer.
  • Intuitive -- in the code just seem to make sense, no matter how complex the operation.
  • Adaptable -- The code is written in such a way that variances in data don't require a complete rewrite.
  • Extendable -- Care has been given in the code architecture to allow extension of the core functionality in the future.
  • Debuggable -- When something goes wrong, the code gives you enough information to identify the issues as directly as possible.

Being able to write maintainable JavaScript [any language] code is an important skill for professionals. This is the difference between hobbyists who hack together a site over the weekend and professional developers who really know their craft.

Very well said, Mr. Zakas!

Being able to write maintainable code is what distinguishes you as a programmer. It's a difference between a craftsman and an apprentice.

Reference
Professional Javascript for Web Developers (2nd ed), Nicholas C. Zakas


Effective Java (2nd Edition)


Effective Java (2nd)
by Joshua Bloch
ISBN 0321356683
Date Read 2/2009

My Rating

One Minute Review
Positives
* Best advanced Java book
* Loaded with excellent tips
* Expert voice
* Broad coverage of best practices

Negatives
* Some chapters too complex

General Overview
This is the best Java book available for the advanced/experienced programmers. (For beginners, see Thinking in Java by Eckel.)

Why? Bloch shows you HOW you should be programming in Java. He shows you what to avoid. He teaches you the things that you might not be aware, or things you would only find out after you dived in to it in much detail.

Negatives
I read the first edition, and this second edition is great, but some chapters have gotten a bit too complex, too difficult to understand. At least for me. I know this is really Java's fault, as it has become a lot more complicated with version 5, but I think perhaps the author could explain it a bit better. I lost focus at times. This was the case with the chapter on Generics. Perhaps it's just me. There are some obscure portions of generics, which are just very hard to read. (I should not blame the author for that.)

Bottom Line
Overall, a great book. A must read for serious Java programmers. The tips contained in this book, there is 78 of them, are all coming from the expert. Tried and tested. And even though you might be using only a small portion, these rules of thumb are good to know, good to refer to. A very good checking point as well if you've been developing in Java for a few years. This book will tell you whether you've been going in a right direction. Or perhaps it will help you steer there.


Make Quality a Requirement

As programmers, we want to finish things fast. We want to impress our boss. We want to be better and always finish before others.

So we do. We finish things as fast as possible. Because the requirement was to complete the things that were on the list.

Just make it work.

What's the end result? Code that is hard to read by others. Code that is rigid. Code that is fragile. Code that is over complicated. Basically, code that has the characteristic of "fast food" -- it does what is supposed to, right?

Wouldn't things be different if one of the requirements was "high quality."

The statement is ambiguous. Sure. It means different things to different people. It could be more specific: "code should be easy to read, easy to extend, and easy to modify."

High Quality. Enough said.

You could argue what quality really means. That's not the point. Just stating that it has to be of high quality puts everyone on the same page: it communicates the expectation to the team.

"Why don't we just add a special exception here." No, you would say. That's going to lower the quality of the code. That's going to make the code more fragile and harder to extend. It does not meet the quality requirement.

I personally don't need to be told that -- quality is always on my list. I always try to make the code that I write be of high quality. I put focus on that. I don't always get the results I want, especially after I look at my code after a period of time. But I learn. I improve.

There is just too much of low-quality code around. Too much pressure to finish fast and no pressure on quality.

Having quality a requirement would make a huge difference. I strongly believe that.

Even if your manager does not require it, "High Quality" should be one of the most important requirements when you write code. It's not easy to write high quality code. That's for sure. You learn with experience, by trying things out. Patterns develop after a while. Then you study a bit more. But having that focus we'll make you a better coder and distinguish you from the others.

Related
Code quality and the fat developer, very good post by Consulting jiujitsu

Quality and Speed

Uncle Bob wrote an excellent post, Speed Kills. Is there a tradeoff between speed and quality, he asks.

If by "speed" you mean delivering working software quickly and repeatably release after release after release; then maintaining high quality is your only option.
I couldn't agree more. In the long run, the only way you can move fast at high speed is if you have quality. Time and time again, I come across projects that were finished fast, with the thinking that they will never be modified again. (I'm not even sure if that's always the case, but rather that quality was not a requirement.) After a few months, things change. They often do. And the project needs to be modified. What is your speed then?

It would actually make more sense to rewrite the project. But that's almost impossible. Too many dependencies. Too much coupling. Who can read that and understand? Too risky. At that point, the easiest thing is to do is just add a special exception, an "if" statement that would make the thing work.

And the project quality degrades.

And the speed decreases.

Frustrating? You bet. Especially if you are not the original coder.

Wouldn't it be easier if it was written with quality in mind in the first place?

Reference
Speed Kills by Uncle Bob

Java EE 6: Moving in a right direction

I just read an overview of the Java EE 6 release. It looks like Java EE is becoming simpler, smaller, and less configuration hungry. Glad to that.

Few things that sound exciting to me: WebBeans, Profiles, JPA 2, JSF 2.

It's probably a year or so away. I wish the process moved a bit faster.

Reference
Java EE 6 Overview

Related
On a related note, this article puts this direction into perspective, Towards Java EE Nirvana

jQuery in Action


jQuery in Action
by Bear Bibeault, Yehuda Katz
ISBN 1933988355
Date Read 1/2009

My Rating

One Minute Review
Positives
* Excellent overview of jQuery
* Full of examples
* Focus on effective usage
* Live samples (Lab)

Negatives
* In the API docs, an example would be really helpful

General Overview
I read the majority of another good book, Learning jQuery, but jQuery in Action is much better! Much more thorough, covers more material. I think this is the best book available on the subject.

This book covers a lot of material: core jquery, events, effects, utils, extending jquery, Ajax, useful plugins, OO Javascript, and more! Each topic is not covered too deeply, but enough to get a grasp. Each topic has good examples also, which made reading and comprehending it much more easier. It also makes this book a good reference book.

This book has a live lab! As you read the book, you see the examples in action! It's really cool and useful. I think it's a great learning tool.

I liked the authors emphasis on doing things the right way. This is especially important when learning a new framework. The examples presented in the books were not trivial but not too difficult either, nice balance.

Negatives
I really liked the API documentation for the functions, in which the params are listed and explained. What would have made it even better, is if it also contained examples as part of it. It would have made this book much more reference friendly.

Summary
All in all, this is an excellent book. The authors are detail oriented and put a lot of thought into creating this book. It shows! If you want to learn jQuery, this book is your best bet.


© 2001-2009

Random Quote

Topics

Architecture & Design :12
Better Coder :30
Books :50
Books I Recommend :21
Career :25
Craftsmanship :17
Java :16
Quotes :25
Recommended :11
Software Engineering :3
Uncategorized :34
Web Development :2

Archive

May 2009 (2)
April 2009 (3)
March 2009 (1)
February 2009 (3)
January 2009 (2)
December 2008 (1)
May 2008 (1)
April 2008 (3)

...since January 2002

Currently Reading

Shelfari: Book reviews on your book blog

:: The Pragmatic Craftsman recommends

:: The Pragmatic Craftsman book reviews

Info

© 2001-2009 Stanley Kubasek About me :: Contact me