105 points · by Jeremy1026 · 13y ago · 60 comments
* complaints about features it has or has not
* a reference to that "a fractal of bad design" article
* how language x is better
* sarcastic notes about the above
* one guy pointing out we can't have anything involving PHP without the above
However, I don't think this is a worthwhile URL to point to on the grounds of near-irrelevance. There are no major new features being released here.
PHP, Python, Ruby, Perl and C# have a lot of overlap in terms of what they do, but the overlap between C++ and Python is way smaller. C#, C++ and Java have much more in common.
There are some things that C++ is very good at, where the alternative is usually C, something most would prefer to avoid.
There's nothing that PHP is very good at that Python, Ruby, Perl or C# can't do nearly as well. That's why it attracts so much criticism.
I don't see any PHP people coming into RoR security vulnerability threads just to have a field day, but vice versa this happens all the time.
Admittedly, I could have chosen C++ and Go instead of Python, but in the end it doesn't make much of a difference.
I've used a large number of languages and environments over the years, and I liked a lot of them. Stop forcing people into one camp only.
That is a little bit of an overstatement. Php is good at a lot of things that others aren't. Most of all ease of use and deployment. It MAY also be faster than other languages in certain circumstances. Example [1]. All in all, choose what you are comfortable with and what you feel is right for the job.
[1] http://benchmarksgame.alioth.debian.org/u32/benchmark.php?te...
PHP does have a very important thing going for it. Its super easy to throw in a PHP script on s cheap webhost. No configuration needed, and if you need database access, there are many libraries that are simply a file drop, and include_once away.
Sure, its not perfect. But no language is.
By any chance, do you have "show dead" turned off? Because you are missing out.
So far, these features will probably make it to version 5.6:
* Internal Operator Overloading
* Variadic functionsDoesn't PHP have that already? http://us2.php.net/func_get_args
Edit - Checking out that parent link it seems: Currently variadic functions are implemented by fetching the function arguments using func_get_args(). The following code sample shows an implementation of a variadic function used to prepare and execute a MySQL query (I'll be making use of this example throughout the RFC):
Firstly, by just looking at the function signature public function query($query) you cannot know that this is actually a variadic function. You'd think that the function can only run a normal query and doesn't support bound parameters:
public function query($query, ...$params) { /*...
$userData = $db->query('SELECT * FROM users WHERE id = ?', $userID)->fetch(); function query($query, ...$params) {}
and $params = [3];
query('SELECT * FROM table WHERE a = ?;', ...$params);That's scary
finally! /s
Humor aside, it's nice to see how OPCache has displaced APC and is under active maintenance in step with the core.
https://wiki.php.net/rfc#implemented
Granted, this was a minor point release, so there are no new features (only bugfixes and minor perf improvements).
Unless you need a 5.5 feature, best to wait.
Of course you can manually install the open-sourced zend opcode cache into PHP 5.4 and get the speed improvement from that.
Obviously going the "there is/isn't performance gains" flamewar route alone is a conversation nobody would win. So I would through this out there: If you have the capability to move to PHP 5.5, because there aren't performance penalties, you should - if for no other reason than it'll help you stay ahead of the PHP EOL sythe.
Like it or not, PHP is THE most popular language for developing web applications. And it didn't reach that rank without merits.
Sun pushed Java, Microsoft pushed C#, Google pushed Python in direct and indirect ways (but Google gave up on Python and created Go).
No big company spent a lot of money to push PHP (Yahoo started using PHP when it was already popular). PHP reached there because it had some merits in it.
- PHP is easy to get started and it helps people without CS background to learn it quickly and code apps to solve problems.
- PHP doesn't force you to use OOP unless you need or want that.
A musician named Derek Sivers who had no CS background created CDBaby website after following instructions in a PHP book. When Rails fanboys were making a lot of news, Derek decided to use Rails and scrap the original PHP codes [1]. He hired a top Rails developer and spent a lot of money (compared to the money - i.e. cost of a book on PHP - spent on his original PHP code) to rebuild CDBaby in Rails. The project eventually failed - time and money lost. CDBaby continued to grow rapidly and the site was powered by PHP codes. By telling this story, I am not trying to say Ruby and Rails are hard or bad. Ruby and Rails are tools just like PHP. The point I want to make with this story is PHP can get almost anyone up and running without much difficulties. Many people could get into business easily because of the ease of PHP. Just think if Derek had tried to make his first site using Rails! Probably, we would have never known the story of CDBaby.
I believe, the purpose of a programming language is to make it easy for user (of the language) to create solution instead of trying to prove the greatness (e.g. lot of features) of itself or it's creator.
Why is PHP easy?
PHP is easy because Rasmus Lerdorf didn't have CS background. He didn't want to create a language to have all the features and concepts taught/learn in a CS class of programming languages. Rasmus just wanted to create a tool to easily publish pages dynamically on web.
On the other hand, you can take a look at Java if you want to know how a language looks when the creator has PhD in CS and wants to apply all his knowledge of CS in the language. I am NOT trying to bash Java or Gosling, just trying to explain why some languages are created complex and difficult.
TL;DR: PHP is just a tool like Ruby or C. It has plus and minus points like any other language. PHP makes it easy to get up and running (even if you don't have a degree in CS). If you like PHP (after you try it), stick to it (because with PHP, you can get atleast as big as Facebook). If you don't like it, pick another language that works for you. And this last point is mainly for Snake lovers on HN : never bite a language (or users of that language) because you don't like or use that language.
[1] http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_swit...
"then he revise him opinion about the ruby/rails" : Derek didn't revise his opinion (at least I am not aware of that). But I know this. The creators of Rails read the article [1] by Derek. Since, Derek is a popular person on the Internet and he has a lot of followers, his article on his failure to switch to Rails can really make a lot of people stay away from Rails. And this is bad news for the the creators and promoters of Rails. So, the obvious strategy, for the creators of Rails, was to convert Derek into a Rails user to reduce the damage on popularity of Rails caused by Derek's article. So, he was invited to RailsConf. When Derek is invited at RailsConf, do you expect him to talk against Rails at the conf? So, you get the point! Derek can get invited to RailsConf and talk a bit of good things about Rails (and he tried to learn Rails, once more, later), but that doesn't change the original experience he had with Rails when he tried to switch from PHP to Rails. * I don't dislike Rails. I just made an attempt to present the the facts in response to your comment *
"Some language are better than others" : Some language are better than others depending on what you are building.
"PHP suffers for some serious design" : True. So, does any other language. There is no perfect language available on this Earth.
"The are A LOT of articles on the internet" : True. There are many articles that point out problems - Some of them list problems in PHP, some list problems in Rails, some list problems in Python and so on.
"Is so easy to start with php that even a non programming guy will succeed!" : Yes, That is why Derek, without a background in CS, could buy a book on PHP and create first CDBaby site. There are many other examples available on Internet.
"The same for java/ruby/python/go" : I don't deny, because I am not here to talk against any language. If a language works for you, that's great.
"But when you have to use your brain, when you have to do some stuff that are than CRUD then is complicated." : If it is not easy to get started, then you will never reach a point when you will need to use your brain.
"And is so fuckin' easy to screw up in php" : If you don't know how to handle something you can screw up easily with anything. Programming is a skill one acquires over time. It takes time because you learn to avoid the ways that make you screw up. You can screw up easily with any language if you don't know how to use the language.
"facebook is using php not because is cool, but because of legacy code" : Where is the link to source to prove your claim? Facebook has enough money to replace all PHP codes, but instead of replacing PHP they have invested money to improve PHP (HipHop is one example).
[1] http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_swit...
-pattern matching
-atoms
-tuples
-lists
-hot code loading
-function arguments matching
-tail recursion
-term_to_binary binary_to_term
-lightweight green processes with PIDs
-receive...end
-begin...end
-pash
-and other nice features from erlang
Im sorry for love Erlang and PHP but it is true.
10/10.
And rate what? Rate that they fix many things, or rate that they have so much bugs to fix ?
Thais, meanwhile, are laughing their asses off (555 means hahaha in Thai).
EDIT: radioxid, you're silentbanned.