KBD

Keith Devens .com

Saturday, November 22, 2008 Flag waving
That is because you crazy! – Ikea
← 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)
:

November 2008
SunMonTueWedThuFriSat
 1
2345678
9101112131415
16171819202122
23242526272829
30 



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

Recent comments XML

Calif. Supreme Court to take up gay marriage ban

I would argue the point is not​definitional.  While the word​marriage is su...

Justin: Nov 20, 4:37pm

Java join function

Meh, don't have null strings in​your string arrays imo, but you're​welcome ...

Keith: Nov 19, 7:51pm

Girls, please don't get breast implants

sorry but another thing i have to​make a comment on about you​men...the men...

happynow: Nov 17, 11:36pm

Books by Vincent Cheung

to all Cheung​fans:

read:

http://www.progin​osko.com/aquascum/cheung.h...

Zamir: Nov 16, 9:07am

Generated in about 0.174s.

(Used 8 db queries)

mobile phone