2,079 reputation
1921
bio website gordiansolution.co.uk
location United Kingdom
age
visits member for 3 years, 6 months
seen Dec 3 at 7:35

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.


Nov
27
comment Determining a class structure
I haven't had time to look at this in a while but to be brief a ProductBundle is basically a collection of products that are to be treated as a single unit addressed by a distinct SKU. Its price is the sum of all the prices of its bundled products, its weight is the sum of those products, its stock is equivalent to the stock of the bundled product with the least stock, etc. This is a bit different from a component because while a component can be purchased separately, a component is implicitly already assembled into its product, which is a single unit.
Oct
28
comment Determining a class structure
The adaptor idea sounds interesting, but I'm not sure it's right as weight would be part of the business logic rather than just a presentation thing. For example the total shipping weight could determine how much delivery is going to cost.
Oct
27
comment Determining a class structure
I'm glad you mentioned Magento and that EAV tables can be a pain to work with. :) That's the kind of design I'm trying to avoid if at all possible (assuming that this project sits purely on an SQL database and not entirely or partially on another storage mechanism, a decision I've not made yet). It's not just a matter of storing inapplicable data though, it's also a case of what constitutes a "clean" design, and putting stuff in the superclass because some subclasses might need it feels like a very wrong approach.
Sep
21
comment Is my work on a developer test being taken advantage of?
You're being taken for a ride. Even if they do offer a job I doubt it's going to be one you really want. Drop them and make it very clear why.
Jun
23
comment Do objects maintain identity under all non-cloning conditions in PHP?
@RPM That hasn't been true since PHP 5.0.0. Class instances are always passed by reference (with some caveats, php.net//manual/en/language.oop5.references.php)
Apr
22
comment Why is Global State so Evil?
@Navin assuming that one was implemented in the first place. If state is global than all bets are off.
Mar
1
comment Using a single table for identity and metadata
@BartvanIngenSchenau Am still in the early design stages and am just playing with ideas so hadn't thought of that. I guess I'd need a column in the business object table to indicate the class of the object being queried.
Oct
6
comment Writing my problem solving approach on paper?
Whoever told you that real programmers don't use paper is dead wrong. Most programmers worth their salt will try to get a feel for any non-trival problem and its solution before writing any code, whether it's a formal method like UML or just a rough sketch. The kind of programmer that just tears into writing code without any kind of planning is the kind who writes pretty crappy code. I expect it's just cos you're new to it and your definition of "non-trivial" is still pretty broad.
Aug
16
comment Which programming languages are multi-platform, fast, and object-oriented with non-limiting low-level os access?
One big caveat with Java though, it's very difficult to give GUI apps a native "look and feel" because Swing is the default GUI library. While Swing does try to emulate the look and feel of the host OS, Swing never looks or behaves quite right. I've not tried it but I'm told SWT gives better results. On the plus side, porting your program's core logic to Android should be pretty easy (though you will have to redesign its GUIs)
Aug
16
comment How to maximise chances of success in an HR interview?
If the hiring company are using HR mooks with no technical experience to hire technical staff then you really don't want to be working for them anyway.
May
28
comment What are the alternatives to “overriding a method” when using composition instead of inheritance?
@AmoghTalpallikar Chances are that if a person can have multiple roles, then there will probably be a requirement to acquire or lose roles during the course of the person's existence in the system. As classes are in theory immutable (a thing, once created as a particular class shouldn't be able to change its class during its lifetime), composing roles in is almost certainly the correct choice.
Apr
27
comment Recursion or while loops
One thing you forgot to mention, iterative code tends to perform better when you're dealing with a single thread of execution, but recursive algorithms tend to lend themselves to being executed in multiple threads.
Apr
7
comment How important is it to reduce the number of lines in code?
Comments are comments. They're not code. Therefore they don't apply to LOC counts. While self-documenting code is better than well-commented code, removing comments from code that's less obvious isn't helpful to anybody.
Mar
3
comment How can I deal with a team member who dislikes making comments in code?
Not saying anything at all isn't a good idea obviously, but threatening people is just going to foster a climate of fear, especially over a relative minor thing such as commenting style. If you explain to him reasonably why the team considers commenting important that's fine. But I know if someone threatened me with the sack over something relatively minor I'd be more inclined to just start looking for another job instead.
Feb
27
comment A simple definition of client-server
Is this a homework question?
Feb
17
comment How can I deal with a team member who dislikes making comments in code?
I don't think threats are necessarially going to be effective, they can come across as bullying (even if that wasn't the intent) and coders as a rule tend to be resentful of edicts from higher ups and in this case he may just dig his heels in even more. It may come to that as a last resort, but only as a last resort.
Feb
17
comment How can I deal with a team member who dislikes making comments in code?
Clean Code is a decent book, but it should not be treated as gospel. You have to apply common sense and decide for yourself what works. I disagree with the advice on comments, because programming languages are geared towards expressing the how of a problem with scant regard to the why. I was writing code for Google Shopping that appends a country code to the product SKU. It's obvious what the code is doing, but unless you know that you can only use the same product code once, even in different markets, you wouldn't know why I was doing this. The comment I added clarifies it.
Dec
9
comment How can I give my client “full access” to their PHP application's MySQL database?
I have to say that from the sound of it the client doesn't really know what they want, or if they do they don't know how to articulate it to you. I think you need a good long sit down with them to find out what it is they think "full access" and "data mining" really mean.
Sep
23
comment Pointers in C vs No pointers in PHP
LOL @language snobbery.
Sep
3
comment What to do when you inherit an unmaintainable codebase?
Given the state of things here, I don't think I can depend on any management support at all, so the choice I think boils down to standing on the deck and playing on as the ship sinks or making a run for the lifeboats. Whilst I don't want to screw other peoples' lives up I've decided to put number one first and make a run for the boats. Thanks for the advice