Re: Conclusion of "use strict"...
| From: | Jochem Maas | Date: | Wed, 04 Mar 2009 22:35:50 +0000 |
| Subject: | Re: Conclusion of "use strict"... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-289288@lists.php.net to get a copy of this message | ||
Hans Schultz schreef:
> Thanks for reply, I completely understood your answer even in previous thread, but you should
> understand few very simple things1. I am not working alone, so I can't make other people use
> tools I use (eclipse + PDT at the moment)
> 2. even if somehow I manage to do number 1 we also have some legacy code from where
> ocassionally popup some idiotic bug (like that I mentioned with typo in property name)I hope
> (because of 1 and 2) you can understand that eclipse + PDT is not answer to my problem. Now, since I
> need some way to do these checks for all code paths (and not just currently running one) that is why
> I am more interested for something able to do those checks in compile time (ie, my javac will report
> to me uninitialized variable if I have some code path that could miss initialization of variable I
> am using later); since almost everyone agreed that could be done by some compiler I found php
> compiler (that for fact really exist, and I even posted llnk to it), since I need to use windows for
> development and compiler has trial version for linux I was curious if someone used it and if it
> could help me with my problems.. So, question is NOT whether php is interpreted or compiled, or is
> there a compiler, question is rather is that compiler useful for my problem.Best regards
1. you should *try* to standardize everyone on a single IDE/tool-chain
2. a decent IDE will give warnings about vars that are [seemingly] uninitialized or used only once.
3. a compiler can't cover all situations (variable variables, vars defined in optional
includes, etc)
4. there is no silver bullet.
5. try to compartmentalize code so that the scope of a var doesn't exceed the number of
lines you can view in a single screen (makes it easier to spot typos, etc)
6. I am not a number.
> --- On Wed, 3/4/09, 9el <lenin@phpxperts.net> wrote:
>
> From: 9el <lenin@phpxperts.net>
> Subject: Re: [PHP] Conclusion of "use strict"...
> To: h.schultz78@yahoo.com
> Cc: php-general@lists.php.net
> Date: Wednesday, March 4, 2009, 4:20 PM
>
> You got it all wrong. As explained, php dont have real compile time like other languages. And
> if you want to learn a language, you have to start the way it acts. the E_STRICT setting will tell
> you most of the errors possible from a php script.
>
> At production level programmers keep the errors away from visitors eyes by redirecting them all
> to log files.
> If you use PDT like NetBeans (which is regarded as the best one yet... there's one version
> of Visual PHP for Visual Studio developers as well)
>
> As you have got to check the errors for typos its the best way to get aid of the PDT IDEs.
> Thats my personal opinion.
>
> Lenin
>
> www.twitter.com/nine_L
> www.lenin9l.wordpress.com
>
>
> -----------------------------------------------------------------------
> Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get
> a Free CD of Ubuntu mailed to your door without any cost. Visit :
>
> www.ubuntu.com
> ----------------------------------------------------------------------
>
>
>
> On Wed, Mar 4, 2009 at 4:03 PM, Hans Schultz <h.schultz78@yahoo.com> wrote:
>
> Concluding, and one idea...I think I received satisfying advices on everything but first
> question (Detection of typos and other simple mistakes). And we were talking also about being able
> to catch them at compile time, then if php at all has compile time etc. Today one thing crossed my
> mind -- if there is compiler for php maybe it can catch these errors natively, like java compiler
> for java? Unfortunatelly there is no recent version available for windows so I can't test it
> myself (http://www.roadsend.com/home/index.php?pageID=compiler). I am interesting if someone is
> using it, and if it can detect this simple mistakes (I am using eclipse + php plugin, but I feel
> there is something wrong in depending on editor to detect programming errors :-) )
>
>
> Regards to all,
>
> --- On Thu, 2/26/09, Ovidiu Rosoiu <ovidiu.rosoiu@gmail.com> wrote:
>
> From: Ovidiu Rosoiu <ovidiu.rosoiu@gmail.com>
>
> Subject: Re: [PHP] "use strict" or similar in PHP?
>
> To: "Hans Schultz" <h.schultz78@yahoo.com>
>
> Cc: php-general@lists.php.net
>
> Date: Thursday, February 26, 2009, 9:14 PM
>
>
>
> Hans Schultz wrote:
>
>> Hello,
>
>> I am beginner with PHP and prior to PHP I have worked with java for some
>
> time
>
>> and with perl for very short period. I can't help to notice some
>
> things that
>
>> are little annoyance for me with PHP, but I am sure someone more
>
> experienced
>
>> can help me :-)
>
>> Is there in PHP something like "use strict" from perl? I find it
>
> pretty
>
>> annoying to need to run script over and over again just to find out that I
>
>> made typo in variable name.
>
>> Is there some way for PHP to cache some data on the page? I like very much
>
>> PHP's speed but it would be even better to be able to cache some
>
> frequently
>
>> used data from database?
>
>> Also regarding databases, I liked a lot java's way of sending data to
>
> database
>
>> using parameters ("select * from user where username = ?" and
>
> then passing
>
>> parameter separately with database doing necessary escaping and
>
> everything).
>
>> Is there something like PHPDBC similar to JDBC?
>
>
>
>
>
>
>
>
>
>
>
>
>