Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Debugging and code quality

 
Don Schaefer
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking (briefly) at the TOC for the book it is not clear if there is a sections on best practices, debugging, code organiztion etc. Lately I have been using JSLint for improving code and would like to know what else people use.

Thanks!
 
Christophe Porteneuve
Author
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Don,

The book is concerned with code quality insofar as it attempts to provide a best-practice approach for every task it tackles, and highlights related decisions in the explanation page.

However, as the book is task-oriented, it doesn't have a dedicated part about general principles. You'll have to look at other JS resources for that; I'm a fan of EloquentJavascript.net. A lot of people abide by Douglas Crockford's every principle, as outlined in his "JavaScript: the Good Parts" talks and book.

JSLint is certainly a good tool to use (particularly bound to Command+S in TextMate ;-)) as it promotes good habits, although some of them are not about code design or code quality per se, but more about making sure your code minifies well :-)

In general, the quality principles for JS are much the same as for other languages: clarity (e.g. meaningful identifiers, pertinent use of comments…), conciseness (which is not just brevity, but brevity without losing readability; 5 readable lines running adequately fast are better than half a line running at lightspeed but being unfathomable), modularity, etc.
 
Don Schaefer
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response! "JavaScript: the Good Parts" is a book that I use for my work and think it is a fine book. Its discussion on modules is a good one when consider good practices. Likewise I use JSLint from within Textmate!

Another source I follow is the google group - JSMentors.

Thanks,
Don.

 
Christophe Porteneuve
Author
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSMentors is pretty good, and the intent and guidelines for it are commendable. Good resource!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic