KBD

Keith Devens .com

Friday, March 19, 2010 Flag waving
This is not The Greatest Song in the World, oh no. This is just a tribute. – Tenacious D
← Design of my CMS, or Template problemRick Santorum is awesome →

Daily link icon Wednesday, November 12, 2003

PHP has too many functions in the core

Here's an interesting comparison between the mess of functions PHP has in the core and what Perl has in the core. It makes Perl look much simpler than PHP.

It also points out the inconsistent naming of functions, but what it doesn't point out is the often inconsistent arguments to functions. Finally, it covers PHP vs. Perl's scoping.

Update: You can find the link to the article here.

← Design of my CMS, or Template problemRick Santorum is awesome →

Comments XML gif

George Schlossnagle wrote:

I agree with the premise, but the analysis is flawed.

PHP extensions (which comprise teh vast majority of the 'builtin funcitons', are almost all toggleable at build time. They are equivalent to the 'core' Perl modules that ship as part of a Perl distribution. $dbh->quote() is faulty, since it relies on all the underlying quoting apis in the DBD modules it loads. (Yes, the consistent api and delegator/aggregator model of DBI are really nice - php5 will have pdo).

The consistent naming and consistent argument ordering critiques are spot-on.

∴ George Schlossnagle | 12-Nov-2003 4:38pm est | #3247

Adam Vandenberg (http://flangy.com/) wrote:

And according to Randal Schwartz, what Perl "got right" (http://www.stonehenge.com/merlyn/LinuxMag/col44.html) is having all sorts of UNIX C functions dumped right into the default namespace. Bluuuuuh.

∴ Adam Vandenberg | 12-Nov-2003 5:28pm est | http://flangy.com/ | #3252

George Schlossnagle wrote:

Well, if that is 'right', then PHP's strategy rocks. Just about every library function in any library on your system is in the default namespace. Smiley

∴ George Schlossnagle | 12-Nov-2003 5:33pm est | #3253

Adam Vandenberg (http://flangy.com/) wrote:

Three of the reasons I like Python are "namespaces".

∴ Adam Vandenberg | 12-Nov-2003 7:20pm est | http://flangy.com/ | #3254

Simon Willison (http://simon.incutio.com/) wrote:

If we're counting bulit in functions, Python only has 71:

len([fn for fn in dir(_builtins_) if fn.islower() and '_' not in fn])

I agree with the above posters. The critical thing missing from PHP (and that Python and Perl do so well) is modules. Python's namespaces truly are a thing of beauty, allowing the Python standard library to include functions for pretty much everything you can think of without resulting in a huge mess of functionality dumped in to the global namespace.

∴ Simon Willison | 13-Nov-2003 11:41am est | http://simon.incutio.com/ | #3258

cagrET (http://g0su.net) wrote:

The link does not work:

"Scribblet '1692HYPE' not found"

Smiley frowning

∴ cagrET | 15-Nov-2003 6:56pm est | http://g0su.net | #3272

Keith (http://keithdevens.com/) wrote:

Well, that sucks. I searched Google and it couldn't find another version of that article. That's the last time I link to anything from that site.

Keith | 15-Nov-2003 7:02pm est | http://keithdevens.com/ | #3273

Keith (http://keithdevens.com/) wrote:

Actually, it turns out that site isn't meant to be linked to.

Keith | 15-Nov-2003 7:04pm est | http://keithdevens.com/ | #3275

Aankhen wrote:

Try this instead: http://tnx.nl/php

Who added the .txt bit?

∴ Aankhen | 9-Jan-2005 5:49am est | #6814

Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

March 2010
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
28293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 2 posts

Recent comments XML

I hate ASP.NET

I hate ASP... I was doing wonders​with PHP, then suddenly one of my​clients...

Johnies: Mar 17, 6:14am

Quantum physics and free will

I knew you were going to say that....

Tom Massey: Mar 15, 9:26pm

Generated in about 0.116s.

(Used 8 db queries)