

How the first PHP functions were named - lukashed
http://phpmanualmasterpieces.tumblr.com/post/70257636397/im-crying-literally-crying-actual-tears-in-my

======
choult
Rasmus created PHP for his own benefit to begin - how was he to know back in
1994 that it would grow to power so much of the web? We all make mistakes; we
all learn from them. Lets move on.

Of course, noone in this day and age would make any dodgy design decisions...
would they?

[http://www.chmod777self.com/2013/08/sigh.html](http://www.chmod777self.com/2013/08/sigh.html)

~~~
growse
The problem isn't making mistakes. The problem is not correcting them when
you've learned they are a mistake and have had ample opportunity to do so.

~~~
choult
Very true; I would be disappointed to discover that PHP is still using the
same hashing function.

However, changing the function names (especially some of the core ones) is
fraught with backwards-compatibility issues - PHP code written 15 years ago
should, for the most part, still work, and not enough hosts out there run with
the right error reporting to point out deprecation warnings, so you would
probably end up with a lot of PHP sites with code silently failing when a host
upgraded.

~~~
laumars
I completely disagree. As a language matures, features need to be depreciated
as newer / better features are implemented. It's actually quite common for
languages to do this.

In fact PHP _HAS_ depreciated functions over it's life, so 15 year old code
might not run on modern web servers anyway. Yet we still have the same
function names where they _should_ have been renamed.

~~~
sudomal
One thing I like a lot about PHP is its version stability, it has changed
somewhat over time, but not to the point where it breaks important features.

I have seen many a framework and language (the sort that you might see hyped
on this website) that make drastic changes and only their most ardent fans
stick with the new version. It's often an opportunity to switch to the next
big thing.

~~~
laumars
I'm not asking for PHP to break it's compatibility over night, but it's fairly
reasonable for a language to depreciate a function over several major releases
which might span a few years.

ie version 5.6 will raise a warning when _some_function_ is called, saying
that _some_function_ will be depreciated in future versions of PHP. So you
have both the old and new functions running in parallel for a while. Then a
couple of major versions later, you drop support for the older function name.

As I said before, PHP has already been doing just this for some stuff for a
while now, so it's not an alien concept to PHP developers.

------
itafroma
Note the original source of the screenshot was posted to Hacker News a few
days ago:
[https://news.ycombinator.com/item?id=6919216](https://news.ycombinator.com/item?id=6919216)

It has since spread like wildfire. This appears to be simple blogspam
(tumblrspam?) of that.

------
todorstoyanov
According to this stats:
[http://w3techs.com/technologies/history_overview/programming...](http://w3techs.com/technologies/history_overview/programming_language/ms/y)
PHP has 80% market share and growing. There must be some other advantages over
this badly picked function names.

But if we talk about disadvantages, me personally do not like WordPress
because of its slowness.

~~~
berkes
I find it hard to use this survey as actual statistics. I could not find any
details on how they measure, how many sites and servers are measured and so
on. As far as I know, someone emailed his 400 friends on Facebook and placed
the results in an excel-sheet.

* Does it take volume into account? Github (Ruby, Java, Scala) alone serves more pages then your average 10K Wordpress-sites will. Yet Facebook (PHP) serves such a huge number that it might even dwarve all the "enterprice" C#, Java and Cobol sites of probably all governments in the entire EU.

* Does it take economic value in account? One gov. site, or one large application (say, google docs) alone costs a multitude of what a 100K mom&pop PHP-webshops have cost. I, personally (as in: this is not a statistic nor any proof of anything) see a lot more value going around in the Ruby on Rails webdevelopment-economy then in the PHP-economy; the latter seems to consist of mostly a few-hundred-bucks Drupal installs or WordPress themes, whereas the first is almost always custom built and startup-development growing far over the 1K.

* How do they adjust for "not recognised"? I mean: it is hard to hide the fact that you are running a Drupal site, even for something large as the Whitehouse.gov. Whereas your average custom-built Django-backend is probably not even accessible for crawlers and even if so, most probably not recognisable as being Python/Django powered. In other words: off-the-shelve stacks are far more often recognised; and are, quite probably, nearly always PHP.

* How does this account for all the backend? Sure, WordPress is written in PHP, but many WP sites run off MySQL, which is just as important as the PHP-part; is WP not, PHP and MySQL powered then? Or other backends: the startup where I work now, has 90% of its code in the backend, Rails, with a tiny 200 lines PHP-app facing our users. This is certainly not a PHP-app, but would this survey count it as such?

~~~
warfangle
> Facebook (PHP)

Facebook (PHP transpiled to C and compiled into a binary)

~~~
plorkyeran
They abandoned that a while ago. Facebook now runs on HHVM, which is a JIT-
compiler implementation of PHP.

~~~
warfangle
Oh, neat. Didn't realize they had. Thanks.

------
neals
Yes, PHP has some odd function names. We know. Move on already.

~~~
awestroke
Why should people move on? I want people to be educated in how horrible PHP
is, I want to see PHP burn and be abandoned.

~~~
userbinator
I like the story of PHP because it is a very powerful reminder that ultimately
what matters is that something works, not that it is beautifully designed or
appeals to some other higher-order train of thought. It's a very grassroots-
style of innovation where pragmatism prevails, and there is no "right" way
that people dogmatically follow. You don't have to know much about data
structures or hashing to do anything useful, just find a way that works. You
don't have to worry about finding the "perfect design". If people can learn a
language like English with far more irregularity, inconsistent function names
are the least of their worries. Just do it. And I find that very inspirational
and motivating because it says that anyone who puts enough effort into getting
something done, will.

~~~
awestroke
I completely lost interest in programming because of PHP. When I discovered
other languages where I didn't need to search the documentation every time I
tried to remember a function name, or debug crazy text encoding/silent failure
bugs, programming because fun again.

I have written good amounts of PHP code since then, and maintained even more
of it. I've also used MVC frameworks like Symfony2, where few of the usual
arguments against PHP apply, but it still feels like a low quality language
with the tens to hunddeds of pitfalls one has to watch out for. And don't get
me started on the Wordpress development that seems to be the main technology
for webdev jobs today.

The argument that PHP is easy to get started with for beginners is a lie.
Sure, you can install LAMP and start writing echo statements and it just
works, but what then? The behavior of your code is sometimes weird, functions
have cryptic names, and there's really nothing to point you in the right
directions. There's no enforced or even encouraged conventions, and there's
heaps of "Common Knowledge" one must acquire to write safe code.

------
alphadevx
1\. Write a blog post about how horrible PHP is.

2\. Instant up-voting on HN. Yay traffic!

3\. Profit!

Full credit to the underpants gnomes: I couldn't have done it without you
guys.

~~~
nir
> 1\. Write a blog post about how horrible PHP is.

For extra bonus, do it on Tumblr, a PHP-powered website.

~~~
alphadevx
Oh delicious irony ;-)

------
pete_b
[https://twitter.com/rasmus/status/413669330216185856](https://twitter.com/rasmus/status/413669330216185856)

No such thing as bad publicity?

------
ErikAugust
I find the inconsistency of the ordering of parameters in core PHP functions
to be more frustrating than the names of them.

Either way, I guess I have to agree that people are spending a lot more time
than necessary referencing php.net.

But then again, no need for all the anger and rage. There are a lot of things
in the World much worse than PHP. There are things that are horribly wrong and
yet still ubiquitous. Go fight racism, not web programming languages.

------
easy_rider
And while PHP has been screaming to its community to "CHECK ALL INPUTS
SDGY&F⁴8943%#$%#"

and then we have the Ruby guys coming along, butthumping Rails and mass
assignment fests.

Name a perfect language/framework?

------
jimhart3000
When I was visiting my brother for Christmas last year, my 14 year old nephew
told me he was interested in coding and really wanted to learn Java and PHP.
My reaction was "you clearly don't read Hacker News".

------
userbinator
Interesting trivia I've wondered about (like "why are the registers in x86
named in A, C, D, B order), not really any issue though; you memorise them
just as well in any case if you work with enough code.

~~~
phaemon
> why are the registers in x86 named in A, C, D, B order

Umm...they're not. Who names them in that order?

~~~
userbinator
Intel does.
[http://code.google.com/p/corkami/wiki/x86oddities#register_o...](http://code.google.com/p/corkami/wiki/x86oddities#register_order)

~~~
phaemon
Ah, Ok, I did not know that. You learn something new every day. Thanks!

