Re: [PHP] Conclusion of use strict...

2009-03-06 Thread Hans Schultz
Hehe,I don't agree with either :-) But I am still searching for some solution, 
and when (and if) I find it I will be happy to share with you (btw, obviously 
nobody shared experiences about that compiler)



Hans is the OP, the one you thought got it all wrong., you're actually

agree with me ... which is as natural as it is inevitable ;-)



LOL, right  :)




  

Re: [PHP] Conclusion of use strict...

2009-03-06 Thread Jochem Maas
Hans Schultz schreef:
 Hehe,
 
 I don't agree with either :-)
 
 But I am still searching for some solution, and when (and if) I find it
 I will be happy to share with you (btw, obviously nobody shared
 experiences about that compiler)
 

no, but did the comments I made about var vars and vars included via other
[optional files] register?

also you might consider something low key as a starting point, here's
a handy little oneliner for the [bash] shell:

find . -name \*.php \! -exec php -d error_reporting=4095 -d display_errors=1 -l 
{} \;

 
 Hans is the OP, the one you thought got it all wrong., you're
 actually
 agree with me ... which is as natural as it is inevitable ;-)
 
 LOL, right  :)
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Conclusion of use strict...

2009-03-05 Thread 9el
---
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 Thu, Mar 5, 2009 at 4:35 AM, Jochem Maas joc...@iamjochem.com wrote:

 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.


I completely agree with Hans, as PHP cant be directly compared to that of
java's behaviour.
All of your team should be using a single IDE or at least good IDEs  like
Zend Studio, Eclipse PDT, NetBeans PDT while Netbeans is currently the best.
PHP is more of a loosely typed language you cant really rely on compile time
or something like that to be able to detect old typo bugs etc.

The other way is writing a separate engine to detect those sorts of bugs,
but using IDE and checking them manually can only ensure the perfectness.





Re: [PHP] Conclusion of use strict...

2009-03-05 Thread Jochem Maas
9el schreef:
 ---
 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
 --

do we need these extra bytes in every email?

 On Thu, Mar 5, 2009 at 4:35 AM, Jochem Maas joc...@iamjochem.com wrote:
 
 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.

 
 I completely agree with Hans, as PHP cant be directly compared to that of
 java's behaviour.

Hans is the OP, the one you thought got it all wrong., you're actually
agree with me ... which is as natural as it is inevitable ;-)

 All of your team should be using a single IDE or at least good IDEs  like
 Zend Studio, Eclipse PDT, NetBeans PDT while Netbeans is currently the best.
 PHP is more of a loosely typed language you cant really rely on compile time
 or something like that to be able to detect old typo bugs etc.
 
 The other way is writing a separate engine to detect those sorts of bugs,
 but using IDE and checking them manually can only ensure the perfectness.
 

 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Conclusion of use strict...

2009-03-05 Thread 9el

 do we need these extra bytes in every email?


Extremely sorry about that  :)



 
  I completely agree with Hans, as PHP cant be directly compared to that of
  java's behaviour.

 Hans is the OP, the one you thought got it all wrong., you're actually
 agree with me ... which is as natural as it is inevitable ;-)

 LOL, right  :)


Re: [PHP] Conclusion of use strict...

2009-03-04 Thread 9el
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.schult...@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.ros...@gmail.com wrote:
 From: Ovidiu Rosoiu ovidiu.ros...@gmail.com
 Subject: Re: [PHP] use strict or similar in PHP?
 To: Hans Schultz h.schult...@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?






Re: [PHP] Conclusion of use strict...

2009-03-04 Thread Hans Schultz
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
--- On Wed, 3/4/09, 9el le...@phpxperts.net wrote:

From: 9el le...@phpxperts.net
Subject: Re: [PHP] Conclusion of use strict...
To: h.schult...@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.schult...@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.ros...@gmail.com wrote:

From: Ovidiu Rosoiu ovidiu.ros...@gmail.com

Subject: Re: [PHP] use strict or similar in PHP?

To: Hans Schultz h.schult...@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?







      




  

Re: [PHP] Conclusion of use strict...

2009-03-04 Thread Jochem Maas
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 le...@phpxperts.net wrote:
 
 From: 9el le...@phpxperts.net
 Subject: Re: [PHP] Conclusion of use strict...
 To: h.schult...@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.schult...@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.ros...@gmail.com wrote:
 
 From: Ovidiu Rosoiu ovidiu.ros...@gmail.com
 
 Subject: Re: [PHP] use strict or similar in PHP?
 
 To: Hans Schultz h.schult...@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