Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy. This forum is not for asking programming related questions.
I personally dislike loosely typed languages like PHP...always have...I truely miss a compiler informing me when I try and use a variable already defined as an array as an integer...
Not exactly a mistake I make...as I consider myself a very disciplined developer...but when working on others code...does it ever lead to overly complicated, convoluted source code...
How do you deal with these issues, either in your own source or someone else's?
I just type cast anything that could be potentially disasterous if it's the wrong type. If type casting could be equally disastorous I sanity check. If it's feasible I make it a class and type check against that.
feyd wrote:Then stop using PHP and go back to C or switch to Java.
That simply isn't feasible considering developing web apps in C is a nightmare (I've tried it - it's how I got started) and Java...well...
It's interesting...I can certainly appreciate the community and it's efforts...but from a business standpoint (my own anyways) Java doesn't make sense either.
d11 wrote:I just type cast anything that could be potentially disasterous if it's the wrong type.
PHP4? Also...it's not so much a problem in my own code...as I'm pretty strict about everything I do but when working on someone else's...using the same variable for an array and object and/or integers or floats...OMG it's just messy and slightly annoying - having to decrypt someones code.
Hows that adage go? "It was difficult to write so it should be equally difficult to understand"
Hockey wrote:How do you deal with these issues, either in your own source or someone else's?
I charge through the @$$ for a rewrite, or charge less for a new app.
But what if you develop PHP applications and rely purely on volume to make income? Supporting a single application to operate efficiently on mulitple platforms and more importantly under various versions of PHP is a demand which justifies having them in the first place...
Keeping two or more versions synchronized is a PITA...
Hockey wrote:But what if you develop PHP applications and rely purely on volume to make income?
You could find a different means by which to acquire income with your work...
Hockey wrote:Supporting a single application to operate efficiently on multiple platforms and more importantly under various versions of PHP is a demand which justifies having them in the first place...
Keeping two or more versions synchronized is a PITA...
It might be a PITA, but if you rely on it for income, then complaining about it is not going to earn you any more money than actually kicking that PITA in the teeth and taking cre of business, no?
"I don't care to support concurrent versions of the same application due to different versions of PHP remaining popular at the same time..."
or
"I find it advantageous and benefitial to my business to support at least 3 different versions. It seperates me from my competitors and here is how I do it..."