Refactoring HTML: Improving the Design of Existing Web Applications (paperback)

Overview

Like any other software system, Web sites gradually accumulate “cruft” over time. They slow down. Links break. Security and compatibility problems mysteriously appear. New features don’t integrate seamlessly. Things just don’t work as well. In an ideal world, you’d rebuild from scratch. But you can’t: there’s no time or money for that. Fortunately, there’s a solution: You can refactor your Web code using easy, proven techniques, tools, and recipes adapted from the world of ...
See more details below
Other sellers (Paperback)
  • All (7) from $39.25   
  • New (5) from $39.25   
  • Used (2) from $40.23   
Refactoring HTML: Improving the Design of Existing Web Applications

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac

Want a NOOK? Explore Now

NOOK Book (eBook)
$19.99
BN.com price
(Save 44%)$35.99 List Price
Sending request ...

Overview

Like any other software system, Web sites gradually accumulate “cruft” over time. They slow down. Links break. Security and compatibility problems mysteriously appear. New features don’t integrate seamlessly. Things just don’t work as well. In an ideal world, you’d rebuild from scratch. But you can’t: there’s no time or money for that. Fortunately, there’s a solution: You can refactor your Web code using easy, proven techniques, tools, and recipes adapted from the world of software development.

In Refactoring HTML, Elliotte Rusty Harold explains how to use refactoring to improve virtually any Web site or application. Writing for programmers and non-programmers alike, Harold shows how to refactor for better reliability, performance, usability, security, accessibility, compatibility, and even search engine placement. Step by step, he shows how to migrate obsolete code to today’s stable Web standards, including XHTML, CSS, and REST—and eliminate chronic problems like presentation-based markup, stateful applications, and “tag soup.”

The book’s extensive catalog of detailed refactorings and practical “recipes for success” are organized to help you find specific solutions fast, and get maximum benefit for minimum effort. Using this book, you can quickly improve site performance now—and make your site far easier to enhance, maintain, and scale for years to come.

Topics covered include

• Recognizing the “smells” of Web code that should be refactored
• Transforming old HTML into well-formed, valid XHTML, one step at a time
• Modernizing existing layouts with CSS
• Updating old Web applications: replacing POST with GET, replacing old contact forms, and refactoring JavaScript
• Systematically refactoring content and links
• Restructuring sites without changing the URLs your users rely upon

This book will be an indispensable resource for Web designers, developers, project managers, and anyone who maintains or updates existing sites. It will be especially helpful to Web professionals who learned HTML years ago, and want to refresh their knowledge with today’s standards-compliant best practices.
This book will be an indispensable resource for Web designers, developers, project managers, and anyone who maintains or updates existing sites. It will be especially helpful to Web professionals who learned HTML years ago, and want to refresh their knowledge with today’s standards-compliant best practices.

Read More Show Less

Editorial Reviews

From the Publisher
“Wow, what a compendium of great information and how-to’s! I am so impressed! Elliotte’s written a book whose title comes nowhere near to doing it justice. Covering much more than just refactoring, this book explains how to do it right the first time around, in a clear and lucid voice. Harold obviously knows his stuff. A must-read!”
–Howard Katz, Proprietor, Fatdog Software

“After working with people who require the skills and tools necessary to continually improve the quality and security of their applications, I have discovered a missing link. The ability to rebuild and recode applications is a key area of weakness for web designers and web application developers alike. By building refactoring into the development process, incremental changes to the layout or internals efficiently averts a total rewrite or complete make-over. This is a fantastic book for anyone who needs to rebuild, recode, or refactor the web.”
–Andre Gironda, tssci-security.com

“Elliotte’s book provides a rare collection of hints and tricks that will vastly improve the quality of web pages. Virtually any serious HTML developer, new or tenured, in any size organization will reap tremendous benefit from implementing even a handful of his suggestions.”
–Matt Lavallee, Development Manager, MLS Property Information Network, Inc.

Read More Show Less

Product Details

Meet the Author

Elliotte Rusty Harold is an internationally respected writer, programmer, and educator. His Cafe con Leche Web site has become one of the most popular sites for information on XML. In addition, he is the author and coauthor of numerous books, the most recent of which are Java I/O (O’Reilly, 2006), Java Network Programming (O’Reilly, 2004), Effective XML (Addison-Wesley, 2003), and XML in a Nutshell (O’Reilly, 2002).
Read More Show Less

Table of Contents


Foreword by Martin Fowler xvii
Foreword by Bob DuCharme xix
About the Author xxi

Chapter 1 Refactoring 1
Why Refactor 3
When to Refactor 11
What to Refactor To 13
Objections to Refactoring 23

Chapter 2 Tools 25
Backups, Staging Servers, and Source Code Control 25
Validators 27
Testing 34
Regular Expressions 48
Tidy 54
TagSoup 60
XSLT 62

Chapter 3 Well-Formedness 65
What Is Well-Formedness? 66
Change Name to Lowercase 69
Quote Attribute Value 73
Fill In Omitted Attribute Value 76
Replace Empty Tag with Empty-Element Tag 78
Add End-tag 81
Remove Overlap 85
Convert Text to UTF-8 89
Escape Less-Than Sign 91
Escape Ampersand 93
Escape Quotation Marks in Attribute Values 96
Introduce an XHTML DOCTYPE Declaration 98
Terminate Each Entity Reference 101
Replace Imaginary Entity References 102
Introduce a Root Element 103
Introduce the XHTML Namespace 104

Chapter 4 Validity 107
Introduce a Transitional DOCTYPE Declaration 109
Remove All Nonexistent Tags 111
Add an alt Attribute 114
Replace embed with object 117
Introduce a Strict DOCTYPE Declaration 123
Replace center with CSS 124
Replace font with CSS 127
Replace i with em or CSS 131
Replace b with strong or CSS 134
Replace the color Attribute with CSS 136
Convert img Attributes to CSS 140
Replace applet with object 142
Replace Presentational Elements with CSS 146
Nest Inline Elements inside Block Elements 149

Chapter 5 Layout 155
Replace Table Layouts 156
Replace Frames with CSS Positions 170
Move Content to the Front 180
Mark Up Lists as Lists 184
Replace blockquote/ul Indentation with CSS 187
Replace Spacer GIFs 189
Add an ID Attribute 191
Add Width and Height to an Image 195

Chapter 6 Accessibility 199
Convert Images to Text 202
Add Labels to Form Input 206
Introduce Standard Field Names 210
Turn on Autocomplete 216
Add Tab Indexes to Forms 218
Introduce Skip Navigation 222
Add Internal Headings 225
Move Unique Content to the Front of Links and Headlines 226
Make the Input Field Bigger 228
Introduce Table Descriptions 230
Introduce Acronym Elements 235
Introduce lang Attributes 236

Chapter 7 Web Applications 241
Replace Unsafe GET with POST 241
Replace Safe POST with GET 246
Redirect POST to GET 251
Enable Caching 254
Prevent Caching 258
Introduce ETag 261
Replace Flash with HTML 265
Add Web Forms 2.0 Types 270
Replace Contact Forms with mailto Links 277
Block Robots 280
Escape User Input 284

Chapter 8 Content 287
Correct Spelling 287
Repair Broken Links 292
Move a Page 298
Remove the Entry Page 302
Hide E-mail Addresses 304

Appendix A Regular Expressions 309
Characters That Match Themselves 309
Metacharacters 311
Wildcards 312
Quantifiers 313

Index 327

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)