Re: Scripting practices
| From: | -{ Rene Brehmer }- | Date: | Sat, 24 Apr 2004 02:59:22 +0000 |
| Subject: | Re: Scripting practices | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184515@lists.php.net to get a copy of this message | ||
Same here ... I only initialize variables where's there any point to it ...
like the booleans I use for error checking ... all the others are normally
never initialized....
Rene
According to historical records, on Fri, 23 Apr 2004 17:15:58 -0400 Travis
Low wrote about "Re: [PHP] Scripting practices":
>Also, for the lazy variable typing. To me, strong typing means pounding the
>keyboard extra hard.
>
>cheers,
>
>Travis
>
>Travis Low wrote:
>> It's not necessary. If you want to go to that much trouble, I would
>> switch to Java for the speed. I stick with PHP for the shorter
>> development time.
>>
>> cheers,
>>
>> Travis
>>
>> Gabe wrote:
>>
>>> When scripting in a language (such as PHP) that doesn't require you to
>>> determine the variable type before you use it, is it still considered
>>> good technique to initialize it to the type you're going to use it as?
>>> Or is it considered ok to just use it?
>>>
>>> e.g.
>>>
>>> $strText = ""; //initialize
>>> $strText = "now i'll give it a useful value";
>>>
>>> Or is it just better to skip the first line? Just curious, thanks!
>>>
>>> Gabe
--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~
http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/