Wednesday, September 16, 2015

How to Find Programming Errors Using HTML5 Builder

Most common programming errors are simple things like
  • forgetting a trailing semicolon
  • starting with a single quote and ending with a double (or the reverse)
  • forgetting a trailing } marker
  • forgetting to use an initial { marker in an if clause
  • mismatching catch blocks
  • etc.
HTML5 Builder highlights your code so you might spot such  errors if you look close enough.  But if you aren't looking at the correct line, you might miss the highlighting.

Most of Embarcardero's programming products have an auto-reformat function when you press Ctrl-D.  HTML5 Builder is not an exception.  It will try to beautify your source.  However, unlike Delphi, it will fail if you have a syntax error but won't tell you where the problem is.  That's frustrating and I hope it gets fixed.

There are a few solutions I've used. 
  1. Get a better PHP beautifier
  2. get a PHP LINT program.
  3. just be lazy, press F9, and wait for the PHP interpreter to complain about a particular line
 Erick

No comments:

Post a Comment