2,056 reputation
819
bio website gordiansolution.co.uk
location United Kingdom
age
visits member for 3 years, 2 months
seen 17 hours ago

I'm a professional PHP programmer with almost a decade of professional experience and considerably more as a hobbyist programmer. I've also had some exposure to Java, Object Pascal and am interested in learning objective C

I've started work on a PHP framework, though it's still at a very early stage and not yet really useful. The current source is available on GitHub.

I've also begun development of a CSS3 elastic grid for use on my own projects and had published that on GitHub as well.


Feb
5
comment Handling Errors In PHP When Using MVC
I agree that in most cases error codes are fairly meaningless. However, throwing exceptions willy nilly is extremely bad! Exceptions should be reserved for exceptional circumstances only. Exceptions cause unpredictable program flow, can make code hard to follow (and therefore maintain), and in PHP they carry a rather significant performance penalty compared to IF/THEN/ELSE. I tend to prefer methods to return true on success, false on failure, and only throw an exception of something goes egregiously wrong.
Jan
6
awarded  Editor
Jan
6
revised Can we compare programming languages ergonomically?
deleted 1 characters in body
Jan
6
answered Can we compare programming languages ergonomically?
Jan
5
awarded  Commentator
Jan
4
comment I've unit tested my class, now how do I get started with an integration test?
I would add that scenario testing is probably not really something PHPUnit is suited to. Yu might want to look at some tool you can run in a browser such as Selenium, or a tool that can simulate a browser, like jMeter.
Jan
4
comment I've unit tested my class, now how do I get started with an integration test?
+1 for good question, but also voted to migrate to Programmers. Seems that's where questions on testing strategies belong
Jan
4
comment Is this the correct approach to an OOP design structure in php?
You might want to consider implementing an autoloader instead of explicitly requiring everything.
Jan
3
awarded  Citizen Patrol
Jan
2
comment Unit testing methods with indeterminate output
Actually, the class is designed such that the password is generated on the first call to getPassword () and then latches, so it always returns the same password for the lifetime of the object. My test suite already checks that multiple calls to getPassword () on the same password instance always returns the same password string. As for thread-safety, that's not really a concern in PHP :)
Jan
2
answered Unit testing methods with indeterminate output
Jan
2
awarded  Student
Jan
2
awarded  Scholar
Jan
2
awarded  Nice Question
Jan
1
comment Unit testing methods with indeterminate output
All the answers given had good suggestions that I used, but this is the one that I think nails the core issue so it gets the accept.
Jan
1
comment Unit testing methods with indeterminate output
The regex you gave proved useful so I included a tweaked version in my test. Thanks.
Jan
1
comment Unit testing methods with indeterminate output
The PW class maintains a constant that's essentially the pool of characters the password should be generated from. By subclassing it and overriding the constant with a single character I managed to eliminate one area of non-determinacy for the purposes of testing. So thanks.
Jan
1
comment Unit testing methods with indeterminate output
Huh, thanks for the comment. Didn't even notice that, but now I'm wondering the same thing. Only thing I could think of is that's about a general case rather than a specific one, but I could just post the source for the above-mentioned password class and ask "How do I test that class?" instead of "How do I test any indeterminate class?"
Jan
1
asked Unit testing methods with indeterminate output
Jun
23
awarded  Teacher