So I started writing some javascript code. Didn’t test it (tsk tsk). Then I started writing tests.
Then a user reported a bug in an untested part. Since I am writing tests now I resist the urge to fix it quickly, and take the time to understand the problem.
Here is how our little regression happened. First [...]
February 16, 2010
Isolating/Testing Legacy Javascript Code (w/ jquery’s bind & trigger)
February 2, 2010
New Guerilla Marketing Campaign by Hollywood, “The Union” “Artiforg”
There is a new guerilla marketing campaign running on the digg homepage. Upon clicking it it takes you to this humorous site claiming to sell you prosthetic organs for half a million bucks. After a while I was starting to get frustrated as to who is behind it. This was probably their marketing tactic. Heh.
After [...]
January 28, 2010
Javascript Unit Testing, Test Pages (test classes).
I have known about javascript testing for a while, about a year. I mostly wrote it off as something “too advanced” for me. I looked at it as overkill, and in the past just have not had the time to take it seriously, despite TDD changing the way I do things server side.
Well I finally [...]
January 24, 2010
Phing ** Work-Around
When you use this in a fileset tag in PHING:
<include name="Vaf/**" />
You would expect it to include Vaf/foo.php, but not Vaffoo/bar.php
This works on windows, but not on Linux? Reading the manual I see "In patterns, one asterisk (*) maps to a part of a file/directory name"… so I found a way to exploit that feature [...]
January 6, 2010
PHP Pitfalls Part 2 – Code Blocks
In PHP blocks may stand on their own line. For this reason if you take the following code:
public function foo()
{
$array = array( 1, 2, 3 );
$copy = array();
[...]
January 5, 2010
How the Data Mapper pattern enhances code refactoring
We all know code needs to be refactored. Duplication sometimes need to be factored out. Sometimes we think of a more clear name for a method or variable and wish to rename something. Sometimes we accidentally use names that are ambiguous together and need to rename something, etc…
Using the data mapper pattern it is much [...]
January 2, 2010
Tony Marston. Programmer fish or Troll?
Tony Marston is a troll.
He doesn’t understand the difference between a pattern and a methodology. If anyone writes him and says they find patterns useful, he will immediately assume you use patterns as a methodology (like him).
I mean why else would you write an article called “design patterns are dead”.
Ps > this post has been made in satire of his “crazy headlines” writing style. Maybe he should write a pattern on language on this next.
November 23, 2009
Windows Vista / “restricted mode”. Why I will not purchase Windows 7.
Today Windows Vista booted into “restricted mode”, all I could access was FireFox (my default browser). See when Vista came out I went down to the store and picked up a copy of “Ultimate” for $300. Later I found out it was the upgrade. Being a power user I am always changing hard drives (when [...]
November 19, 2009
PHP Pitfalls, common causes of bugs
Crazy E_NOTICE behavior
.
Turns out
$foo = null;
count( $foo['bar'] );
is Valid!
.. Where as..
$foo = array();
count( $foo['bar'] );
Will blow up your application in your face (will trigger E_NOTICE errors ). Which we actually want to happen (if we are good developers). You want to know about these types of problems so you can figure out why the incorrect [...]
November 18, 2009
PHP Auto Test – Automatically monitor your project for changes and run your unit tests
I read about stakeout.rb but read that it might not work on windows. Rather then waste time even trying I just ported it to PHP, and started to make it object oriented.
I have posted the code on devnetwork
Using this you can just work on your files, and keep PHPAutoTest open in another window. It will [...]