Re: [PHP] PHP is a Bloated Kludge, discuss!

2002-01-25 Thread Emile Bosch

Don't feed the troll..

Php [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On a conceptual level, I for one am a great fan of the kludge.

 Every piece of software is a trade off between performance and speed of
 development.

 You can have the fastest app in the world for $1,000,000 in development
time
 OR
 you can write up a in-elegant solution in 5minutes ($50) and if its slow
buy
 a bigger
 server for  $5000.

 You choose.

 Taken in relation to PHP. I would rather have the developers of it release
 new code
 that is not optimized, then have 1 release every two years, full of very
 pretty blocks
 of code designed to make the hardcore OOP textbook fanatic orgasm.

  Check out mozilla.org if you want to see what elegant programmers can do.
 - 2 years later a web browser intended to be small and fast, can know take
 out your trash,
  wash your car - and guess what?
 no release 1.0 yet.


 Sean










-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP is a Bloated Kludge, discuss!

2001-10-04 Thread php

On a conceptual level, I for one am a great fan of the kludge.

Every piece of software is a trade off between performance and speed of
development.

You can have the fastest app in the world for $1,000,000 in development time
OR
you can write up a in-elegant solution in 5minutes ($50) and if its slow buy
a bigger
server for  $5000.

You choose.

Taken in relation to PHP. I would rather have the developers of it release
new code
that is not optimized, then have 1 release every two years, full of very
pretty blocks
of code designed to make the hardcore OOP textbook fanatic orgasm.

 Check out mozilla.org if you want to see what elegant programmers can do.
- 2 years later a web browser intended to be small and fast, can know take
out your trash,
 wash your car - and guess what?
no release 1.0 yet.


Sean








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP is a Bloated Kludge, discuss!

2001-10-04 Thread Steve Edberg

At 4:48 PM +0200 10/4/01, [EMAIL PROTECTED] wrote:
(From behind filing cabinet where I am ducking preparing for flames).

Is it just me or is there anyone else that thinks PHP suffers from not
being modular.  Let me explain myself.  If you write a module for a lot of
procedural languages it sits on the filling system and is called up when it
is needed , loaded into memory and executed. There maybe some cashing which
happens but this is basically how it works.

PHP on the other hand seems to load in ALL the code that MAY be run. i.e.
an include brings things in which are inside an if,  even if the if equates
to false.


Not true; require() has this behavior, but include() does not. See

http://php.he.net/manual/en/function.require.php
and
http://php.he.net/manual/en/function.include.php


-steve



This means that the language is not extendible in the way others are.  If
you do write a function you wish to include in 'only the pages you wish to
use'  you have to first include it, then call it.

This has also meant that things like spell checking functions are built
into the core module rather than called in as or when they are needed.

Then there is the way database connectivity is handled.

There are a load of functions (again in the core language) with there NAMES
containing the name of the database you are connecting to.

For example all MySQL functions are mysql_something and I guess all oracle
ones are oracle_something.  This would only be a minor inconvenience
because wrapper functions can be written but from what I can gather
different databases have different functionality available.

I know this is partly because different databases have different
functionality.  what I would expect to see is a load of generic function
which attempt to provide same functionality where it is available or
implement some of the functionality themselves.  Obviously for some of the
less sophisticated databases these functions would have to do more work and
maybe some functionality wouldn't be available in certain databases (but
only the things like stored procedures).


If you can deal with the 'lowest common denominator' approach, use 
ODBC. Or, as you mentioned, use one of the db wrapper classes 
available in PHPLIB, PEAR or Metabase.


-steve

-- 
+ Open source questions? +
| Steve Edberg   University of California, Davis |
| [EMAIL PROTECTED]   Computer Consultant |
| http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
+--- http://pgfsun.ucdavis.edu/open-source-tools.html ---+

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP is a Bloated Kludge, discuss!

2001-10-04 Thread Rasmus Lerdorf

 PHP on the other hand seems to load in ALL the code that MAY be run. i.e.
 an include brings things in which are inside an if,  even if the if equates
 to false.

That's not true.

  if(condition) include 'file';

That will only include the file if the condition is true.  Very easy to
verify for yourself.  So a bunch of your points related to this are void.

 Then there is the way database connectivity is handled.

 There are a load of functions (again in the core language) with there NAMES
 containing the name of the database you are connecting to.

 For example all MySQL functions are mysql_something and I guess all oracle
 ones are oracle_something.  This would only be a minor inconvenience
 because wrapper functions can be written but from what I can gather
 different databases have different functionality available.

There is both a C-level abstraction layer called dbx and a user-space one
in PEAR.  Plus a number of others.  So again, this makes your next points
void.

 Got a nast feeling that ASP (spit) does something like this.

As does PHP if you had bothered to look.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP is a Bloated Kludge, discuss!

2001-10-04 Thread Ben . Edwards


Exelent, as I said I was playing devels advicate, I like PHP a lot, I am
trying to get someone else to use it to and they came up with this stuff.

 if(condition) include 'file';

Is exactly what I was looking for.  As 'if () {}' loaded, or at least
parsed things I did'nt think another form of if would be different ( RFM-;)
).  Maybe I should stop developing for a while and have a good wade through
the manual.  Its so easy to do stuff in PHP it's easy to get lazy!

Thanks,
Ben





Rasmus Lerdorf [EMAIL PROTECTED] on 04/10/2001 18:21:28



To:   [EMAIL PROTECTED]
cc:   [EMAIL PROTECTED]
Subject:  Re: [PHP] PHP is a Bloated Kludge, discuss!


 PHP on the other hand seems to load in ALL the code that MAY be run. i.e.
 an include brings things in which are inside an if,  even if the if
equates
 to false.

That's not true.

  if(condition) include 'file';

That will only include the file if the condition is true.  Very easy to
verify for yourself.  So a bunch of your points related to this are void.

 Then there is the way database connectivity is handled.

 There are a load of functions (again in the core language) with there
NAMES
 containing the name of the database you are connecting to.

 For example all MySQL functions are mysql_something and I guess all
oracle
 ones are oracle_something.  This would only be a minor inconvenience
 because wrapper functions can be written but from what I can gather
 different databases have different functionality available.

There is both a C-level abstraction layer called dbx and a user-space one
in PEAR.  Plus a number of others.  So again, this makes your next points
void.

 Got a nast feeling that ASP (spit) does something like this.

As does PHP if you had bothered to look.

-Rasmus








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


Re: [PHP] PHP is a Bloated Kludge, discuss!

2001-10-04 Thread Rasmus Lerdorf

 Exelent, as I said I was playing devels advicate, I like PHP a lot, I am
 trying to get someone else to use it to and they came up with this stuff.

  if(condition) include 'file';

 Is exactly what I was looking for.  As 'if () {}' loaded, or at least
 parsed things I did'nt think another form of if would be different ( RFM-;)
 ).  Maybe I should stop developing for a while and have a good wade through
 the manual.  Its so easy to do stuff in PHP it's easy to get lazy!

  if(condition) {
 include 'file';
  }

is no different.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP is a Bloated Kludge, discuss!

2001-10-04 Thread Maxim Maletsky \(PHPBeginner.com\)



 (From behind filing cabinet where I am ducking preparing for flames).
 
 Is it just me or is there anyone else that thinks PHP suffers 
 from not being modular.  

It is just you and some other people similar to you. Thought this
question was up for a while :-)

 PHP on the other hand seems to load in ALL the code that MAY 
 be run. i.e. an include brings things in which are inside an 
 if,  even if the if equates to false.

Is it really true? I always though it wasn't.
AFAIN: Long time ago require() was working this way. But now, require()
and include() are the same. Loaded only when needed.

 This means that the language is not extendible in the way 
 others are.  If you do write a function you wish to include 
 in 'only the pages you wish to use'  you have to first 
 include it, then call it.

Well, it has it's pluses and it's minuses, it is extendable, though OOD
works a little different in it. But hey, it compiles on the fly,
remember? That's a plus for developers, especially newbies.

 This has also meant that things like spell checking functions 
 are built into the core module rather than called in as or 
 when they are needed.
 
 Then there is the way database connectivity is handled.
 
 There are a load of functions (again in the core language) 
 with there NAMES containing the name of the database you are 
 connecting to.

OK, true. But, this is necessary if you want PHP to automatically
connect to different DBs. 
A plus to portability and a minus to... (to what?)

 For example all MySQL functions are mysql_something and I 
 guess all oracle ones are oracle_something.  This would only 
 be a minor inconvenience because wrapper functions can be 
 written but from what I can gather different databases have 
 different functionality available.

That is why Sascha Sunmann wrote PHPLIB and (Stig?) Bakken created PEAR
(released with every PHP distribution, btw - just waiting for you to use
it)

 phplib.netuse.de
 php.net/pear

 I know this is partly because different databases have 
 different functionality.  what I would expect to see is a 
 load of generic function which attempt to provide same 
 functionality where it is available or implement some of the 
 functionality themselves.  Obviously for some of the less 
 sophisticated databases these functions would have to do more 
 work and maybe some functionality wouldn't be available in 
 certain databases (but only the things like stored procedures).
 
 Got a nast feeling that ASP (spit) does something like this.
 
 You may cry, it cant be done.  however I remember a 
 connectivity product that came from Borland (this was back in 
 the Paradox Days) which did just this, it even had 
 transaction handling built into this connectivity layer for DBase!
 
 Anyway I am playing Devils Advocate.

We all play it once at least ;-)

 What I do like about PHP is how quickly it can be learnt and 
 how quick you can build apps with it.  Maybe this is at the 
 expense of elegance.  Maybe PHP5 will address these issues -;)

Isn't it the greatest thing of it?
Just think of this - where else you can become a programmer in a short
time?
Compliling/executing/libraring/connecting just to make a simple
guestbook for your site.

 And there are certainly some very busy PHP sites, you should 
 see the traffic levels on indymedia.org during 
 anti-capitalist demonstrations and I am sure during the New 
 York attacks they went belistic.

Search archives for php sites or something like this. The topic comes
up every week or so :-)


Maxim Maletsky
www.PHPBeginner.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP is a Bloated Kludge, discuss!

2001-10-04 Thread Maxim Maletsky \(PHPBeginner.com\)

  PHP on the other hand seems to load in ALL the code that 
 MAY be run. 
  i.e. an include brings things in which are inside an if,  
 even if the 
  if equates to false.
 
 A quick check in the manual, it states that:
 
 Unlike include(), require() will always read in the target 
 file, even if the line it's on never executes. If you want to 
 conditionally include a file, use include(). The conditional 
 statement won't affect the require(). However, if the line on 
 which the require() occurs is not executed, neither will any 
 of the code in the target file be executed.  
 http://www.php.net/manual/en/function.require.php
 and
 http://www.php.net/manual/en/function.require-once.php
 
 
 So to do what you said i.e. conditionally load the 
 function/files that you want then you should use include(). 
 http://www.php.net/manual/en/function.include.php
 and
 http://www.php.net/manual/en/function.include-once.php
 
 So I don't buy this agument.

This is outdated. Look int othe archives - I had this discussion with
Zeev close to a year ago - since PHP 4.0.(something) require and include
behaves in the exactly same way.

Test it yourself on the latest release of PHP:


  require.test.php
 
 ?

 echo 'included?';

 if($go)
require 'require.error.test';

 ?
 

  require.error.test
 
 ?

 echo 'H1yup!/H1';

 parse error;

 ?
 

Access it with:
 1. require.test.php?go=e

And then try it with:
 2. require.test.php


What do you buy now?


Maxim Maletsky
www.PHPBeginner.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP is a Bloated Kludge, discuss!

2001-10-04 Thread Maxim Maletsky \(PHPBeginner.com\)


Of cource changing the require with include would explain everything :-)
Sorry, forgot to mention that :-)

Maxim Maletsky
www.PHPBeginner.com


 -Original Message-
 From: Maxim Maletsky (PHPBeginner.com) 
 [mailto:[EMAIL PROTECTED]] 
 Sent: venerdì 5 ottobre 2001 3.33
 To: 'Opec Kemp'; [EMAIL PROTECTED]
 Subject: RE: [PHP] PHP is a Bloated Kludge, discuss!
 
 
   PHP on the other hand seems to load in ALL the code that
  MAY be run.
   i.e. an include brings things in which are inside an if,
  even if the
   if equates to false.
  
  A quick check in the manual, it states that:
  
  Unlike include(), require() will always read in the target
  file, even if the line it's on never executes. If you want to 
  conditionally include a file, use include(). The conditional 
  statement won't affect the require(). However, if the line on 
  which the require() occurs is not executed, neither will any 
  of the code in the target file be executed.  
  http://www.php.net/manual/en/function.require.php
  and
  http://www.php.net/manual/en/function.require-once.php
  
  
  So to do what you said i.e. conditionally load the
  function/files that you want then you should use include(). 
  http://www.php.net/manual/en/function.include.php
  and
  http://www.php.net/manual/en/function.include-once.php
  
  So I don't buy this agument.
 
 This is outdated. Look int othe archives - I had this 
 discussion with Zeev close to a year ago - since PHP 
 4.0.(something) require and include behaves in the exactly same way.
 
 Test it yourself on the latest release of PHP:
 
 
   require.test.php
  
  ?
 
  echo 'included?';
 
  if($go)
   require 'require.error.test';
 
  ?
  
 
   require.error.test
  
  ?
 
  echo 'H1yup!/H1';
 
  parse error;
 
  ?
  
 
 Access it with:
  1. require.test.php?go=e
 
 And then try it with:
  2. require.test.php
 
 
 What do you buy now?
 
 
 Maxim Maletsky
 www.PHPBeginner.com
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: 
 [EMAIL PROTECTED] To contact the list 
 administrators, e-mail: [EMAIL PROTECTED]
 
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP is a Bloated Kludge, discuss!

2001-10-04 Thread php


I think the implication of the oringal poster was not the include/requires
stuff,
but more a build of PHP with --enable-100 options vs php-sharedetc



-Original Message-
From: Maxim Maletsky (PHPBeginner.com)
[mailto:[EMAIL PROTECTED]]
Sent: Friday, 5 October 2001 11:33 AM
To: 'Opec Kemp'; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP is a Bloated Kludge, discuss!


  PHP on the other hand seems to load in ALL the code that
 MAY be run.
  i.e. an include brings things in which are inside an if,
 even if the
  if equates to false.

 A quick check in the manual, it states that:

 Unlike include(), require() will always read in the target
 file, even if the line it's on never executes. If you want to
 conditionally include a file, use include(). The conditional
 statement won't affect the require(). However, if the line on
 which the require() occurs is not executed, neither will any
 of the code in the target file be executed. 
 http://www.php.net/manual/en/function.require.php
 and
 http://www.php.net/manual/en/function.require-once.php


 So to do what you said i.e. conditionally load the
 function/files that you want then you should use include().
 http://www.php.net/manual/en/function.include.php
 and
 http://www.php.net/manual/en/function.include-once.php

 So I don't buy this agument.

This is outdated. Look int othe archives - I had this discussion with
Zeev close to a year ago - since PHP 4.0.(something) require and include
behaves in the exactly same way.

Test it yourself on the latest release of PHP:


  require.test.php
 
 ?

 echo 'included?';

 if($go)
require 'require.error.test';

 ?
 

  require.error.test
 
 ?

 echo 'H1yup!/H1';

 parse error;

 ?
 

Access it with:
 1. require.test.php?go=e

And then try it with:
 2. require.test.php


What do you buy now?


Maxim Maletsky
www.PHPBeginner.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP is a Bloated Kludge, discuss!

2001-10-04 Thread Maxim Maletsky \(PHPBeginner.com\)


conditionally load the function/files that 
you want then you should use include(). 

Was the implication of the poster I replied to.


To the original I replied commenting each of his arguments, therefore I
knew his points.

Maxim Maletsky
www.PHPBeginner.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]