Hmmm, I don't think other programmer's sloppy coding practices are a good argument for having to declare variables or against loose typing. There are crappy coders in whatever language you use. The good coders will do the right thing. If you are concerned about scripts on hotscripts.com where the coder doesn't seem to understand the principles of security or fully understand what is happening with their variables, then perhaps you should be writing the code yourself or hiring someone who does understand the language more completely. Caveat Emptor. Part of PHPs simplicity and attractiveness is that you DON'T need to declare variables, and you DON'T need to do manual casting. Start adding these and you may as well be writing Java or C/C++.
Cheers, Rob. On Wed, 2004-01-21 at 17:45, Martin Hjort Eriksen wrote: > I agree with Chris... > > In contrast you can also see a common problem in many of the > downloadable scripts from different collections on the net, like > hotscripts.com, where the programmers start building control structures > whitout having the different variables they use set. > > For instance if($name) instead of if(isset($name)), and it is done, > simply bacuse php does not force you to declare your variables. > > I also help out in different danish internet forums, and there are some > of the newbees that have no clue about type juggeling, which at times > can cause problems. And start explaing to another person, who is not an > experienced programmer about types over the net, is not that easy, and > many times only leads to more confusion. > > /Martin > > > I'm sure many will disagree with me on this but, this is EXACTLY why I > > think all this loose type conversion in php, perl and others, is a bad > > idea. An int should be an int and a string should be a string. It's > > not that hard to write and use functions like strtoint() and > > inttostr(). If you want an easy way to compare 2 strings with out the > > old C function strcmp(), then use operator overloading like in C++. I > > also think that not forcing the user to declare variables and types > > before they are used is also a very bad idea and will lead to far more > > subtle bugs than if you do use type declarations. > > > > Chris W > > -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php