Archives For book

I’m just about finished with Chapter 7 of the fourth edition of my “PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide”. I thought I’d take this time to finally share the rough version of the Table of Contents (this is actually version 2, as the first version was changed while working on the SQL and MySQL chapters).

In my newsletter, I had presented some of my thoughts as to changes for the fourth edition, and I received a ton of very useful replies. Before showing the TOC, I want to discuss the feedback and how that impacted my plan. Continue Reading…

I’m very pleased to say that the fourth edition of my first book, “PHP for the Web: Visual QuickStart Guide,” is now available. This book was written for the average computer user wanting to begin developing dynamic Web sites. No prior programming experience is assumed, although you should already be familiar with the basics of HTML. The focus of the book is the PHP language itself, but two chapters introduce MySQL and SQL, in order to start using a database backend.

With the fourth edition of the book, I started by fixing any minor problems and updating the code for the latest version of PHP. New in this edition is a “Review and Pursue” section at the end of
each chapter. The review prompts revisit the chapter’s key points. The pursue prompts are specific recommendations for how to apply what you just learned on your own. As with any of the book’s material, you can turn to the book’s supporting forum for help or feedback on the “Review and Pursue” section.

Also new in this edition is an added chapter, called “Putting It All Together.” The chapter demonstrates how to use everything covered in the book to assemble a mini-Web application, with authentication and full CRUD (Create, Retrieve, Update, and Delete) functionality.

At the time of this writing, Amazon is selling the book for $25.06. I don’t currently know when it will be available in other languages, countries, or formats.

In a previous post, I previewed my forthcoming, self-published JavaScript book: why I’m writing it, when, and how. Here, then, is the current Table of Contents, with some explanatory text. To be fair, this is the first draft of the table of contents, and it’s probably more inclusive than the final book will be. As I write the text, the order and specifics will no doubt change, and I may need to cut some of the most advanced and esoteric content if the book gets to be too long or complex.

As always, any and all feedback you may have on the proposed book is most welcome.

Part 1: Getting Started

The first section of the book introduces JavaScript as it is today, in all its facets. The first chapter talks about what JavaScript specifically is and what it’s used for, what JavaScript isn’t, and what the current landscape looks like. The second chapter has the reader creating some real-world code—client-side and server-side form validation, using both hand-written JavaScript and the jQuery framework (even if he or she doesn’t know JavaScript yet, which is really how we all begin with JavaScript anyway). The third chapter discusses development tools that are useful as one is learning JavaScript. This includes things like JavaScript-aware IDEs and text editors, the JavaScript-specific features of different Web browsers, and debugging tools. The focus in this first part is on a grasp of JavaScript as a whole, also providing a context within which the reader can continue through Part 2 of the book, the most important part.

  • Chapter 1: (Re-)Introducing JavaScript
    • What is JavaScript?
    • How JavaScript Compares to…
    • JavaScript Isn’t…
    • Why JavaScript is a Good Thing
    • JavaScript Versions and Browser Support
  • Chapter 2: JavaScript in Action
    • Embedding JavaScript into HTML
    • Acknowledging No JavaScript Support
    • Cobbling Together Some Code
    • Applying a Framework
    • Steal This JavaScript
  • Chapter 3: Tools of the Trade
    • The Great Debate: Text Editors vs. IDEs
    • A Handful of Text Editors
    • A Couple of IDEs
    • The Browser: Your Friend, Your Enemy
    • Online Resources

Part 2: JavaScript Fundamentals

The second section of the book is the meat of the text, useful for all readers. Here are the fundamentals for programming in JavaScript, i.e., the treatment of JavaScript as a language in its own right. Some of the early material may be too basic for some, but none of the material will be beyond the needs of the standard Web developer. By the end of this section, the reader will be able to understand most JavaScript code just by looking at it, and will be well prepared for the more advanced examples in the third part of the book. Most of the fundamental concepts will be demonstrated using a real-world example. Many examples will also be presented in an alternative syntax (e.g., an ExtJS or jQuery demonstration of the same technique).

  • Chapter 4: Simple Variable Types
    • Basic Variable Syntax
    • Creating Calculators
    • Formating Numbers
    • Constructing Strings
    • Deconstructing Strings
    • Generating Dates and Times
  • Chapter 5: Using Control Structures
    • Comparing Numbers
    • Comparing Strings
    • What is true?
    • More Complex Conditionals
    • Performing Iterations
  • Chapter 6: Complex Data Types
    • Arrays
    • Objects
    • Arrays are Objects!
  • Chapter 7: Creating Functions
    • Defining Your Own Routines
    • Passing Values to Functions
    • Returning Values from Functions
    • Variable Scope
    • Anonymous Functions
  • Chapter 8: Event Handling
    • Browser Events
    • Keyboard Events
    • Input Device Events
  • Chapter 9: JavaScript and the Browser
    • The Window
    • DOM Manipulation
    • Cookies
  • Chapter 10: Working with Forms
    • Handling Form Submissions
    • Form Validation
    • Regular Expressions
    • Handling File Uploads
  • Chapter 11: Ajax
    • Understanding Ajax
    • Providing Dynamic Content
    • Form Validation
    • User Interactions
  • Chapter 12: Working with Other Data
    • XML
    • JSON
  • Chapter 13: Debugging and Error Management
    • Simple Debugging Errors
    • Handling Problems Gracefully
    • Creating Informative Errors
    • Creating Useful Errors

Part 3: Next Steps

The final part of the book extends what has already been covered in two ways. First, it more formally discusses major topics like frameworks, things that have been shown in bits of pieces already. Second, Part 3 goes into some of the secondary uses of JavaScript, like server-side JavaScript, Google Gears HTML5, and Adobe AIR. These extensions demonstrate the breadth and usefulness of today’s JavaScript. Realistically, these chapters will be more of an introductory tutorial to the topic than a full-fledged resource. In each chapter of Part 3, the reader will develop one or more (mostly) complete applications.

  • Chapter 14: Frameworks
    • Choosing a Framework
    • Introducing jQuery
    • Introducing ExtJS
    • Introducing YUI
  • Chapter 15: Server-Side JavaScript
    • What is Server-Side JavaScript?
    • What You’ll Need
    • Validating Form Data
    • Performing Database Queries
  • Chapter 16: Google Gears HTML5
  • Chapter 17: JavaScript for Desktop Applications
    • What is Adobe AIR?
    • What You Need to Know
    • Creating a Knowledgebase Application

Appendix A: Basic JavaScript Reference

The appendix provides a simple reference guide to JavaScript. Tables and other listings cover the kinds of things that are easily forgotten: operators, defined objects, methods, etc.

For years and years now I’ve thought about writing my own JavaScript book. The idea started because many readers requested that I write one, hoping to read a JavaScript book that teaches that language as directly, and in as simple terms, as can be found in my PHP books (apologies for how egotistical that probably sounds). Of course, by now, pretty much every publisher already has their own JavaScript book. This, I believe, is part of the problem.

Most JavaScript books (and probably all that attempt to teach the language entirely) were first written in the late 1990’s, when JavaScript was mostly used for annoying and tedious tricks, such as alert boxes, status bar scrolls, and so forth. A decade ago, image rollovers and basic form validation were about as good as JavaScript got. Because of JavaScript’s own poor usage, any book written about JavaScript at the time was limited as to how good and useful it could be. Readers who appreciated my PHP and other books would often ask if I had written a JavaScript book. After saying “No”, they then would ask what JavaScript book I could recommend. For the most part, I couldn’t recommend many (the “JavaScript: The Definitive Guide”, written by David Flanagan and published by O’Reilly is one of the better ones, but like most O’Reilly books, is much better as a reference guide than an instructional book for beginners).

JavaScript today is a vastly different language, primarily because of how it’s being used, than the JavaScript I first learned in the 1990’s. Ajax, more consistent browser support, and the rise of frameworks are just three reasons JavaScript has evolved into such a useful, worthwhile language. In fact, JavaScript today is an important language to know. Over time, the original books on the language have been updated and updated to acknowledge these changes, but the results are largely kludge-y texts. My desire is to write a JavaScript book that teaches the language itself, as it is today, without all the deadwood that’s long since been left behind (and thankfully so).

There is one publisher that does not have its own JavaScript book, though, and in 2009 I spent a couple of months discussing my proposed JavaScript book with them. Perhaps we could have made that happen, but for many reasons, I eventually decided it was not a good fit and ended the conversation. This still left me with the desire to do a JavaScript book, readers interested in said book, and an outline of what that book might look like. As I’ve been meaning to get into self-publishing for some time, this JavaScript book seemed like the right topic to test the waters. I’ve been thinking about this book for two years now and am actively working on it now, I’m happy to say, and feel confident enough with how it’s progressing to start formally speaking about it. Here’s my approach…

There is a quality of the JavaScript language that is simultaneously both a strength and a weakness: it’s easy to use. Without really knowing JavaScript, you can probably search around, find some code, and cobble together something that does what you need done. In the book I aim to both embrace this attribute, and build upon it: while the first criteria is getting something working, at the end of the day, most of us would prefer to know why it works. The book will teach everything you need to know to understand and use JavaScript, including the most important aspects of what JavaScript is today. There will be tons of real-world code, demonstrated in both hand-written JavaScript and using one or more JavaScript frameworks (while frameworks are a great, reasonable way to quickly accomplish what you need to do, you ought to have a good understanding of JavaScript aside from the frameworks). In a subsequent post, I’ll provide the current table of contents.

I’m hoping to have the book available by this summer and will distribute in both print and electronic formats (PDF, Kindle, and ePub). The electronic formats will not use DRM and most likely a purchase will qualify you for free updates of future revisions. The prices will be determined later on, once I have a better sense of cost, but expect the price to be somewhere between $10 and $20 (US). I may even do a Radiohead thing and let people pay what they want for it. We shall see. I will likely also put the entire content available online in HTML format.

I began actually writing the book recently and have about 6,500 words, constituting rough versions of the first three chapters. I’m writing the book on a Mac using Scrivener. I’m writing the book using MultiMarkDown. Between the amazing capabilities of Scrivener and MultiMarkDown, I’m going to be able to write the book once, and easily output it in every format I need.

And now, I’m going back to writing! I’ll continue to post updates both here and in my newsletter. My thanks to everyone for their interest in this book and my other work.

In continuing my posts of extra bits from my Effortless E-Commerce with PHP and MySQL book, here are two pages intended for the end of Chapter 11, “Site Administration ”. This chapter is from Part 3 of the book, which covers the example that sells physical products. The particular extras in the PDF are a handful of tips on how you would expand the site administration.

EffortlessECommerce_BONUS_Ch11.pdf