Talk to a seasoned developer, and he or she will tell you, "Dreamweaver writes ugly code." What they are really saying is, "I prefer to write my own code." There is a grain of truth in this because hand-written code may only require one line, whereas Dreamweaver MX 2004 will do the same thing using four or five lines. Eventually, you are going to write some of your own code, and when you do, you will have to do some debugging. Debugging is the process of finding and fixing coding errors. This mainly involves checking the code for syntax errors such as spelling mistakes, misplaced or unbalanced brackets, and so on. It also involves following variables to ensure that they have the values they are supposed to have. Though serious debugging should always be in the realm of the team's " coder ," there is a rather interesting method of optimizing code in Dreamweaver MX 2004. Using the Clean Up HTML/XHTML CommandEven though Cascading Style Sheets (CSS) reduce the need for optimized HTML, the key word here is "reduce." As we are fond of saying, "Let the software do the work." Follow these steps to have Dreamweaver scoot through your pages and do the optimization for you:
The requested actions will be undertaken, and if the Show Log Option is selected, an alert will display any changes made. Balancing JavaScript BracesIf you have written JavaScript or Flash ActionScript, you know how easy it is to lose track of opening and closing curly braces, parentheses, and quotation marks. It's very easy for code to become entrenched in braces. Unbalanced braces can have implications ranging from syntax errors to unpredictable operations of the code. Though Dreamweaver leaves you to your own devices when it comes to quotation marks, there is help available with curly braces, square brackets, and parentheses. Here is how to use it:
Tip This doesn't work if you select a closing brace. Note If Mac users are wondering where the JavaScript Debugger is located, we are pleased to report that it is deceased. The JavaScript Debugger tool has been removed from the application. |