It is by far the most anarchic and disorganized major OSS project and yet it still thrives. It still moves forward, it still gets better. Yes, it's design foundations as a language are not particularly elegant (to put it mildly), but that's pretty much the only major thing that's wrong with the resulting product.
According to all known wisdom about how an OSS community should function, PHP should have imploded and forked a long time ago. It should no longer exist.
And yet, despite this "I quit" rant, PHP has had relatively few major conflicts. The PHP way is unique, and while it may offend the sensibilities of people who like a nicely organized and disciplined community ran by a benevolent dictator or inspiring visionary, dammit, it works.
I strongly suspect that any successful attempt to solve PHP's organizational "problems" would actually result in killing it stone dead.
We already have Python and Ruby ea. PHP should stay weird.
It's unquestionably gotten better in recent years, but it still has a long and seemingly never ending list of warts. I don't see PHP getting forked anytime soon, but I do see developers moving to other languages routinely. And that's a shame since PHP is still, for better or for worse, the easiest language to get into for the novice.
I can see that.
Also i can imagine two major reasons PHP is not forked:
1) You have a small committed developerbase which is too much invested in the ecosystem (Zend and others).
2) Every other user (aka webdeveloper and PHP developers that want a major change) in the ecosystem may rather move on to another language then try to fork it. In the end: What what you do with a PHP fork that doesn't move in the direction of Ruby, Python and Co.?
Your contributions and voice will be missed.
Ahahaha, it's all coming back now. I used to find his emails funny.
I also remember why I unsubscribed from php-internals as well, though...
If you read that IRC log and truly believe that a multi-million/billion dollar ecosystem/environment should be ruled by what reads like kids between 12-16 chatting, then go ahead. I won't. Apart from that there is enough rant on PHP on the internet already ;)
It also turned off the suhosin author to the point where he moved onto other stuff.
He had some great ideas, now lost (no longer works with PHP > 5.3 )
But Zend shows up and folds back in some great stuff into PHP once in awhile.
Take a look at their now opensourced opcode cache, it's faster than all others.
That's kind of the exception instead of the rule, really. Andi and Zeev are very, very infrequent contributors to php-internals.
They proposed releasing the thing that became opcache after Rasmus finally convinced everyone how much of a pain in the rear end maintaining APC was.
The video to those slides : https://www.youtube.com/watch?v=ZSFDm3UYkeE
I have never seen a large open-source project that uses "forums" in a way that doesn't impose massive overhead. Without fail, forums for open source projects are dreadful while mailing lists are, with a few notable exceptions, pleasant. When I am looking for information about a project and discover that all the project officially has is a forum, my heart sinks; it ranks up there with finding out the project is still hosted on sourceforge or a mega/rapidshare/whatever clone.
It's probably about time to reinvent it again, tunneled over Websockets with a Flat Responsive html5 Retina-Aware Interhyperface or something.
What is the alternative here though? Instead of making it client agnostic, make it not client agnostic? How does that not make the situation even worse? Being client agnostic means that it doesn't matter if one particular client is discontinued. That is practically the entire point of being client agnostic...
Any solution that will be viable in the long-term needs to be decentralized and client agnostic. Otherwise you are not reinventing Usenet, you are just reinventing web forums poorly.
Edit: Aaaah, I need more sleep.
I was actually just griping.
A second problem with mailing lists is that unless you keep old messages, you generally have to go to some horrible web-based archive.
Why not use an NNTP server? Newsreaders are great at handling threads, whether they are simple linear threads like those suited for email, or massive trees with dozens of participants and many side discussions.
Those web-based mailing list archives, while usually unstyled and therefore "ugly", are well-indexed by search engines, easy to navigate, fast, and uncluttered. They are not perfect, but they offer a much better browsing/reading experience than standard web forums.
Going back to NNTP would be idea. I don't know how we actually do that en-masse though.
Instead of nested replies, it encourages "Creating new threads linking back to a post", which I find to be way more orderly than "conversation trees". They're also aiming for feature-parity with mailing lists, allowing people to participate effectively with threads by e-mail alone.
I've tried to drum up attention to it before now:
But it's less like a technical discussion list and more like an open forum. The signal to noise ratio is pretty low.
My main purpose for learning PHP is for web-development. I have looked into java code and I felt like I am going to shit pants if I have to learn that.
- Am I wasting my time with PHP?
- What are some good alternative for web-development that preferably doesn't have a steep learning curve?
If you are learning PHP in 2013, yes, you are wasting your time. PHP's killer feature was (not any more) $5 web hosting, where you could upload your index.php with FTP and you're done with deployment. This is no longer the case. PHP stands for (at least used to) "Php is a Html Preprocessor", but at some point it turned into a general purpose programming language, largely as an afterthought.
Yes, you can learn web programming using PHP and that skill won't be wasted. But a lot of the PHP specific issues you'll be dealing with is just going to be a waste of time. There is a lot of WTF issues in PHP that you'll inevitably stumble into. This will be a major factor in the time wasted.
In addition, the world is full of bad PHP code. Yes, there is good PHP code too but the proportion of bad code is probably larger than in other languages. This will mislead you and make you learn bad practices more than you would perhaps do if you'd be learning another language. These are cultural, not technical issues.
For learning purposes (not production code), I would perhaps even recommend staying out of big monolithic frameworks like Django and Rails and learn how things work internally. You'll get a better idea from HTTP and other web technologies if you build your own "framework" from building blocks like WSGI, SQL alchemy and a templating engine like Mako or Mustache (these are Python-specific, for another language, you'd pick other tools).
This is my recommendation for a beginner looking into web programming and my motivation is to keep a beginner away from bad technologies that may teach bad practices.
- GO: google's lang, seems to be trending lately. Lets you build potentially more elegant, higher performance web apps (if you believe the benchmarks) than node but will have a higher learning curve, less of a userbase.
- Python: Someone else will have to comment on python (and probably GO). Afaik it's a useful language to use overall.
What do you mean? What's the "global namespace" in PHP and why do you need to use it?
And it is easy to use it ... and you don't want to maintain code written like that.
Ruby, Python, and Node are all reasonable next things to try. Large communities, lots of resources, and plenty of example code to look at.
PHP has a problem, the "old stuff" / compatibility, like all older projects have.
They change things, but slowly and sometimes inconseqent.
I hope the will really renew everything with a new version, even if that mean that they lose many users.
In the last years so many new languages and styles were born, you feel really old with PHP ;-) ... that does not mean that the others were better.
Be a "programmer". Learn other languages. It makes you a better programmer in general.
> That, and if you are just starting to get into web development
These two things don't square well, and is a major reason why I discourage PHP. It's pedagogically suboptimal to be encouraging the sorts of behavior that culturally accepted PHP often does.
You can write good PHP. After many years I got to the point where I could say confidently that I can. But it took me most of a decade to get to that point of confidence.
The code I'd write in say, Clojure day one would be terrible when compared to the code I'd write a year or two later. Does that mean I shouldn't learn and use it?
You and yours really need to read up on what you hate so much so you don't look like a bunch of fools arguing about things that don't exist.
That said: There are many projects still using crap like that, but that is because of bad programmers. This stuff is deprecated in core and its use is heavily discouraged.
Anytime someone new to PHP or not at a higher level asks a question, I point them to proper resources.
I'm in ##php and #phpmentoring on Freenode helping out with questions.
I write articles that are, in my humble opinion, not bad and have received many compliments from people who learned from my writings.
I'm doing my part, and so are many other PHP-centric developers, and it's annoying as hell to have us lumped in with code that's several years old, or sweatshop programmers that know nothing more than the very basics.
That being said, it's a small sample size of maybe just over 100 over the last few years. Weigh accordingly.
Important point, whether you like php or not, you need to know why. If you like it because you are comfortable with it, make sure to know why. Being comfortable in a dev environment is great when you are learning, but very dangerous in the long run, since learning something new will be much (much) more painful.
Also, what is your final goal ?
If you just want to learn to build websites, regardless of top notch ways of doing things, just stick with what you are productive and comfortable with. The more reputable tech you use, the better, but it's not the point.
If you want to learn websites because it looks like a good way to learn programming in general, don't stay in the comfortable zone, don't fear the steep learning curve, embrace it. Well, it's not masochism either, if it's too painful, just stop. You have been intimidated by Java, but don't let it divert you from all other techs. Django/Python, Ruby on Rails, NodeJS and some others are much more easier to step into, will teach you much more about programming in general.
Employment wise it is a safe bet - there is a lot of legacy code for a person to maintain for a few lifetimes and then more.
The hatred towards PHP is explainable - if you use Haskell or Clojure today it is because you chose it. If you use php it is because you were forced to use it. So every little and not so little gotcha in the language (and there are a lot of them) is causing a lot of pain.
I have used python/(tornado/gevent)/flask/ stack with success.
Disclaimer - PHP programming 4 years, python 1
Having said that, learning a language's syntax is not the same as learning programming (or web development). If you are serious about what you are doing, learn OOP theory, design patterns, the internals of the web (TCP/IP, the HTTP protocol, etc.), security, and a bit of cryptography can't hurt.
So you can use PHP while learning all those things, and you will be golden. Ignore all the FUD and hate around it, eg: "php is insecure", "php websites are a mess", "php is for noobs", "php is slow". Using a different language won't fix any of that, learning how to program will.
If you like the "accessibility" of PHP, if you like programming in it, if you like the learning resources you have and you like the forums you've found, then go for it.
In due time you'll discover what the criticism about PHP was all about, form your own opinion and might check out other options (and Java won't be scary any more - just different syntax and a few concepts that you'll appreciate better when you have some experience).
Fact is PHP, for all its faults, still runs far more websites than all of those others combined and then some (http://w3techs.com/technologies/overview/programming_languag... - eg PHP 80%, Ruby 0.5%, Python 0.2%)
I learned PHP in 2003, and haven't regretted it since. There are quite a few PHP jobs here, and I like the culture that this language brings - unlike ASP.NET which is very corporate.
So yeah, use what makes you happy, PHP is a great start into a lot of other languages as it isn't as intense as others.
PHP is mostly ok as tool to get shit done with but it is one of the worst possible options for something to learn as a first programming language for many reasons, including:
- you will not learn how most real programming languages are, as PHP was not designed or engineered as a programming language, instead it is a collection of tools and commands that mutated and evolved into a programming language
- most code you will encounter written in PHP is very bad code (not all, but most), so you will find it very hard to learn from other people's code (this is the main reason to stay away from PHP imho!)
- it either lacks or has weird variants of the constructs that permit certain very useful styles of programming: no real closures until 5.3 and the need for the `use (...)` syntax to have them behave like in other languages, it has two namespaces for functions and variables (not other common language has this - yeah, there's Perl and Common Lisp, but...), weird stuff when it comes to namespaces, weird rules and stuff like autoloading, more weird stuff around the OOP features...
- so it leads to you learning all sorts of details that are basically untransferable skills - i.e. they won't make you a better programmer in general they will just make you a more effective PHP coder
With that said, I agree it's probably more worthwhile to learn than PHP.
Separate namespaces for variables and functions in Perl? Huh?
Perl at least had the "if it's different, it should look different" philosophy as a justification for its sigils. PHP just makes functions and variables look different and it feels like CLs two namespace system with `foo(...)` / `(foo ...)` and `$foo` / `(funcall foo ...)` being different, but it was mostly useless in CL too and it has the same side effect of adding extra cognitive overhead to passing functions around, which imho should be as simple and natural for a beginner as possible to ensure that later on he has a safe landing in functional programming land...
Different languages have different libraries, different communities, different philosophies, different purposes. Sure, a person who started in C can go and write C-ish code in many other languages. But that's bad code. Good code is idiomatic and takes advantage of the strengths of the language and platform it's written for.
Take php and ruby (two languages I happen to have used a fair bit both). If you're writing your typical web app, you'd probably use mysql for a database. That's the same. You talk http to the client - same. You want to parse xml? Probably going to use libxml underneath the covers. And so on. So yes, there's different libraries for the two, but there's also a lot that is shared.
As for different philosophies, they are both pretty much imperative languages. Php has a simpler object model than ruby and ruby has some fp features, such as co-routines, but by and large you write programs in the same style.
And different purposes? I'll dispute that. You pretty much use both languages for more or less the same things.
Mind you - I'm not saying they are exactly the same. Clearly they're not. But I'm saying the difference is in the nuances.
And while I do agree that ruby is a nicer language than php, I think the trend of treating it as if it was toxic is completely out of proportions.
I think you could pick better examples. PHP and Ruby are both interpreted, Perl-inspired languages started by hobbyist first-time language designers who released 1.0 versions about months apart. So yes, if you apply them to similar problems and use similar techniques in the same languages, you'll have similar experiences.
But even so, I think PHP's purpose, which is rooted in letting amateurs simply render web pages, is very different than Ruby's purpose, which is a flexible, general purpose, objects-first scripting language. I also think their design philosophies are pretty different. PHP has never worried much about elegance or consistency; Ruby inherited Perl's DWIM approach, but tried to do it in a way that was not just functional, but beautiful.
That point being that languages such as Perl, Php, Ruby and even Python is relatively minor. I'll claim that any programmer who is competent with one of these will easily be able to transition to one of the others. There may be reasons why people don't always do this, but I don't think they are intellectual.
I've learned quite a bit from working in different languages. You may not have, but that doesn't indicate there's nothing to learn.
You can create whole web app in one PHP file from scratch and it will have everything including API and DB management layer and be secure and fully functioning.
And it will work on all servers and on all operating systems.
Millions are made by average developers developing themes and plugins for wordpress.
Hard to beat all that.
#drama is for queens :)
You can. But I shudder to imagine one file containing everything you just said. Also, I'm skeptical about the security claim. I'm not talking about PHP-specific vulnerabilities here. Rather, the developer of such an app might be pretty naive, and might build in his own vulnerabilities.
> And it will work on all servers and on all operating systems.
The same is true of most mainstream languages. Ruby, Python, Java, and Node are probably the big competitors in the web dev space. All of them can run on Windows.
Look on my works ye mighty and despair (i know I have): https://gist.github.com/kennethrapp/0ebbd15b509d8f18b095
The same can be said of any language, it just happens that PHP makes it a bit easier than the others.
Granted, it's been a while since I went shopping for hosts, but I thought these days more and more hosts (even cheap ones) at least support 5.3+ if not 5.4. PHP got a huge swath of improvements in these releases so I'd imagine these were more well supported. I mean we're in the middle of 2013 for crying out loud.
I also see more and more cheap VPSes popping up and these may be a more attractive alternative (for novice admins/developers, I think these are still a bit too intimidating).
The biggest hurdle is still the lack of quality tutorials that use PDO for complex projects. You still see a whole bunch of older examples out there that still use mysql_query() and the like and not many that do "A-Z of Building a blog with PDO" or similar.
The power of quality free tutorials shouldn't be underestimated.
VPS is a better alternative, but at that point it's just as easy to use something other than PHP.
I hope there will come a time for some standardization for web hosts where minimum versions for software packages and sane defaults are enforced. I agree, anyone deploying on VPS really don't have shared host bounds any more.
And it's very, very difficult to do that properly, because PHP seems to go out of its way to make all of those things (APIs, DB management, security, functioning) difficult.
>And it will work on all servers and on all operating systems.
Except for UNIX, where function X does Y instead of Z, which it does on Windows. Usually, except in PHP 5.5 and above.
WARNING! If php.ini variable A is set to B, then the above does not apply and instead behaviour C takes effect.
Security? DB-wise, use PDO and named parameters. It's passing in an array. Sessions? For private servers, using file-based is fine. For shared or for scaling, use DB/memcache.
APIs? It's dead easy to implement a RESTful interface. Interacting with remote APIs is nothing more than some curl commands, or your tool of choice.
Explain to me what's so difficult here?
Having a language behave slightly differently between different operating systems is ... expected? Maybe? I'm not sure, I never use PHP on Windows. Why would I?
You can create a whole web app in one CL file from scratch and it will have everything including API and DB management layer and be secure and fully functioning.
Also hard to beat that.
There are only two kinds of languages: the ones people complain about and the ones nobody uses - Bjarne Stroustrup
> Millions are made by average developers developing themes and plugins for wordpress.
Yep, and thanks to people actually believing in that, php is also keeping the security industry alive and well.
The prehistoric luddites and trolls on the list would shout down any truly language-improving proposals in the same way they always do, regardless of source.
The only way to get rid of those unwanted elements would be a fork, but that would be unproductive. The remaining thing keeping PHP so popular is how amazingly ubiquitous it is. A fork wouldn't have that advantage, especially in comparison to languages and environments that are objectively better anyway.
Initially, I believe you are correct, but I am not sure long term. PHP is easy for a system admin to install. Other than perl, I am not sure if there is anything out there that is as easy. I would imagine a fork, if it wants to survive, would need to be just as easy.
I do wonder why PHP has never really had any competition in the "super easy for my system admin" category.
I can walk my mother through installation of a PHP script. I can almost walk her through installation of a CGI script in any language, really. But unless that shared host has already set up a Python or Ruby environment (few do; I can count the ones I know on my left hand), I'd never, ever dream of trying to walk her through setting up something in other languages.
Making running scripts as easy as dropping them onto a filesystem would be perhaps the killer feature for other languages to target, if they want to take a bite out of PHP's consumer market share.
Of course, then there's another battle: shared hosting providers. The vast majority are running some sort of third-party control panel software with very opinionated hooks deep into every bit of configuration on the machine. Unless that killer feature can be baked into that software, and unless the shared host actually updates their software, there's no hope.
You wouldn't believe how many shared hosts are running ten+ year old installations of everything, not giving a crap that they're out of date. And hey, that ten year old version of PHP still installed there is still going to work just fine with the majority of scripts...
With their "Move fast, break things" motto I can only shudder at the imagination of the scenarios happening at Facebook HQ:
"Hey, so you are the new developer in town? Can you build service X which service Y and Z can use? Just write a proper API, we need this ASAP."
- "So what do I write this service in? Any framework already build to support these operations?"
"Pick your poison! Check our internal repository collection and see if you can re-use anything useful. As long as we can communicate with it via the API!"
Facebook has their own PHP fork, which they use/and modify. I do not believe that Facebook pushes their modifications to PHP as a whole.
- Cassandra (Java) was created by Facebook http://en.wikipedia.org/wiki/Apache_Cassandra
- Giraph (Java) has significant contributions from Facebook and I believe was founded there http://giraph.apache.org/
- FP (Erlang IIRC) at Facebook http://cufp.org/videos/functional-programming-facebook
- Facebook's page listing some of the open source projects they contribute to https://developers.facebook.com/opensource/
The backend is written in everything from Erlang to C++.
Then they use it only for the view layer, it only pull some data from memcache to render HTML.
But all the hard work is C++ / Java / Tornado / etc
I found a page from 2010, but I couldn't find a more up-to-date source.
PHP is powering a huge industry. A lot of money is flowing on PHP code, from PHP developers banging out code for paying clients to companies like Facebook which got started as PHP apps. Wordpress powers a ridiculous number of companies which run on its code.
PHP may be a mess, but lets keep things in perspective. The state of what really matters is alive and well.
Taking one of the worst language out there , and creating these well crafter libraries , that's insane. I think type hinting and basic POO saved PHP.
Do we really need a sudo-sql language for creating object->db table relational mappings?
I used Doctrine extensively at my last job..and I will not be using it for any personal projects. It's bloated and when I need to optimize a sql query, I have to essentially create a hack outside of the main ORM..which kinda defeats the purpose in the first place.
I much prefer Zend or Codeigniter.
Doctrine2, mixed with entities, is awesome. Its relationship manager is fun and easy to work with and it works very well.
You can even create hand-written custom queries if you want, using its own DSL that's fairly similar to what you would expect.
"To illustrate why this is an issue, I posted this reply explicitly asking
for feedback on two items. How many replies did I get? One. A single reply.
Oh, there were more replies to the thread afterwards. But they were too
busy arguing over the other off-topic or non-constructive things in the
above list to actually discuss the open issues with the proposal."
I suppose a core problem is that before the current process, a very large number of the people causing trouble happened to also be the self-appointed leaders.
As long as they not see, that there is something wrong, they will be against any change.
This is absolutely normal, this ist humanly.
He did the only right thing, he change himself and leave them. He want a change.
I haven't followed the full discussion and events leading up to here, but would it be very wrong to assume this just a case of a bystander starting a discussion that didn't really catch on with any of the active maintainers?
Anthony (ircmaxell) contributed some patches to the past few major releases (including the new password API and PBKDF functions) and is well-respected by a large number of PHP developers.
He's also proposed nearly a dozen RFCs including working patches, most of which include incremental but major feature improvements. He and some of the others are trying to improve PHP as a language.
The problem is that there are a handful of people that do not want language changes, think that some changes are confusing for developers, and are generally not actually able to understand the use case behind things, like, oh, I dunno, named parameters. So instead of having a well-reasoned discussion, they basically shout the proposal down.
Thankfully the RFC and voting process can bypass the volume of their arguments, but not always.
Internals suffers from simply having too many voices. As with all things you need a leader that is reasonable and can push things in the right direction.
For example, I don't think I've seen a constructive discussion on having some kind of object literal in the language to replace something like
$obj = (object)['prop' => 'val', ...];
Geniuses can have temper-tantrums, too. Just because he has made worthy contributions doesn't mean that he isn't acting like a drama queen.
You've implied that what he's in charge of right now are "toys". Does that qualify?