Shaded Pixel PHP Syntax Highlighter
With the support of Shaded Pixel LLC I am working on a PHP syntax highlighter that is like no other made since the last on you ever used.
The Shade Pixel Syntax highlighter will not only be useful for PHP once this project culminates.
Initial Syntax Highlighter Project Ingenuity, The Good Stuff
The Shaded Pixel Syntax PHP Code Highlighter will format your programming Language of choice with not only coloring of your code, but the ability to increase the readability of your code. As Programmers we look a flat screens that has not changed since the good ole green screen and our infamous blinking text cursor placement. The future is here...
Shaded Pixel Programming Code Highlighter
Changing your life soon. Late 2010...
The Shaded Pixel Syntax highlighter increases the readability of your code, and will decrease the time it takes to visually look over a page of code and disseminate the content quickly. Time is money and the personal computer's power has increase tenfold and our ability to absorb a page of programming language in a fraction of the time. Starting in 2010 you life will change if you happen to be a programmer all thanks to Shaded Pixel Syntax highlighter.
Supported Languages
- PHP (Phase One)
- JavaScript (Phase Two)
- HTML (Phase One)
- XHTML (Phase One)
- CSS (Phase One)
- XML (late 2011)
- Pearl (late 2012)
- Action Script (late 2011)
- After Effects Scripting (late 2011)
Balancing Parenthesis and Brackets (Equally Paired)
How to Balance Braces and Parenthesis
Making sure your braces and Parenthesis are always paired with one another properly, you can use a simple counting technique.
Starting at the initial parenthesis OR brace in the series, "starting from ZERO" for every"("OR "{" add one to the initial count of ZERO. For every "(" OR "}" subtract ONE from your ongoing count.
Do as follows:
Open: "(" OR "{" = plus 1 OR = +1 such as starting at ZERO 0+1 = 1")"
OR
Close: ")"OR "}" = minus 1 OR = -1 such as starting at ONE 1-1= 0
Start at zero = (some code 1)+(some( code)) || ((some)( code3)) = 0
Brace 1 is#1 = +1.............-1..+1...+1....-1-1...+1+1..-1+1...-1-1 = 0
Actual count = 1...............0....1.....2.......1.0....1.2.....1.2.....1..0 = 0
Remember we started at zero prior to counting anything and added and subtracted for every parenthisis character, starting with the initial one. Our final count ended up being ZERO if our brackets are balanced.
Dreamweaver CS5 now offers the ability to count the braces or parenthesis for you, and notify you of your mistake.
PHP Code Survival Guide “Rules to Live by”
Throughout my learning of PHP I have gained a few outstanding ideas as to how to make your PHP code survive the test of time. First of all read as many books and articles as time permits. If you truly want to be a proficient programmer of any type, you will never stop reading. Nor will you say, "I am the expert of all experts" no matter what stage your career is in.
Words to live by: One thing I have learned, that is now engrained into my soul is, "Every day I do not learn PHP. I learn how much PHP I do not know."
"Rules to Live by" while programming PHP:
- Never assume you know anything. If you have a doubt about the interaction of any function no matter if you created it or not, or whether it is a built in PHP function. Assume you know nothing about it, and research it to the best of your ability prior to using it for the first time, or the one hundredth time.
- Always use the XML style PHP open and closing tags:
- Or use the Script style tags, to defeat hiccups with older style tags:
- I suggest you never use the short stye PHP tags, as it will make all your code far less portable.
- One other major concern when using scripts created during the rein of PHP 4 I see far too often is the use of the PHP environment configuration setting of register_globals to be turned on. This prior to PHP 5 was nativly turned on, in PHP 5+ is is nativly off. The environment variable register_globals can cause your scripts to be breached due to security holes. The setting register_globals when on creates a variable automatically for any form field using the name of the field itself as a variable name. For instance if we had a form field as follows:
- The PHP register_globals would automatically create a variable using the form field name of "fieldOne". That would look like "$fieldOne" in your PHP code. The ability to use this might seem advantageous, however it could allow your users or a hacker to inject their own variables into your script at will unless you take the necessary steps to prevent this from happening. The easiest way to ensure that your scripts are not vulnerable through this type of attack is to turn register_globals off when using a PHP version below version 5, or just use the default setting that come with PHP version 5 or higher.
<?php /*your code*/ ?>
<?script language='php'> /*your code*/ </script>
<? /*your code*/ ?>
<input type="text" name="fieldOne" />