11 ms·
What PHP Needs
- mehlah 15y agoLove!
- citricsquid 15y ago"What PHP really needs is: Strong leadership and an official process to submit new ideas, extensions", "New blood, and less old blood.", "A plan for the future of web development". PHP is an opensource project: volunteer!
- daeken 15y agoPHP is an open source project, sure. But really, have you ever tried to volunteer for the PHP core? I've never gone through a more painful process -- so much political bullshit, resistance to change (even backwards-compatible change), and echo chamber nonsense. I attempted to volunteer on PHP for a long while, but finally realized it just wasn't worth it and gave up.
- Produce 15y agoSomeone should fork the damn thing.
- sc68cal 15y agoSomeone did. http://news.ycombinator.com/item?id=2640756 http://news.ycombinator.com/item?id=2640756 Self plug: I cleaned up his original repo and put the patch against the official PHP git repo. https://github.com/sc68cal/php-src https://github.com/sc68cal/php-src
- Zak 15y agoFrom what I've observed, when people try to contribute things most programmers, and even most PHP users consider to be improvements, the core team seems to reject them. Array literals are the example that jumps to mind, but I know I've seen other things along the same lines. The core team has a vision for PHP that doesn't match what most of us think of as good, so few people waste their time trying to fix it.
- wccrawford 15y agoI'm disappointed in the people who put disparaging comments in as ideas, and the people who voted them up. This was an attempt to generate awareness and that kind of behavior doesn't help anything.
- ChiperSoft 15y agoThe lack of commenting and downvoting means this list will lack any kind of real curation. There's several large blocks of text on the popular list that should have been submitted as multiple items.
- skrebbel 15y agoWhy the hell does this site need to be able to read my Twitter direct messages for me to be able to cast a vote?
- courtewing 15y agoThe application doesn't access your direct messages, but the bare minimum privileges for authenticated API access is "read only", and that happens to include the _access_ to direct messages. Feel free to peruse the source, if you don't believe it: https://github.com/gwoo/phpneeds https://github.com/gwoo/phpneeds
- simonw 15y agoIt doesn't want to read your Twitter direct messages. Here's what's going on. The Twitter API currently has two levels of permission: "read" (can access your data, which includes your tweets and followers even if you have a private account, and unfortunately also your DMs) and "write" (can update your account, including posting new tweets, adding new followers, creating new lists etc). Most Twitter users were unaware that granting "read" access to an application gave that application access to their DMs. This was a problem. Twitter opted to solve it by introducing a new permission level, "direct messages", which is write-plus-direct-message access. They plan to remove the direct message ability from the "read" access. To give developers time to fix any apps that this would affect, the switch-over date for direct message access is set to June 30th. Up until that date, the Twitter OAuth authentication screen includes copy that tells you that the application will be able to access your direct messages until June 30th. This does NOT mean that the application author intends to access them - it just means that the permission level you are granting gives them that ability up until the cut-off date. This issue is a big problem for people like us ( http://lanyrd.com/ http://lanyrd.com/ ) who use Twitter for authentication, because it scares away potential users. At least after the 30th we won't have to worry about the DM clause, but we'll still suffer from users assuming that we're going to tweet on their behalf. Unfortunately, we need "write" access so that the follow buttons on our site work (Twitter's new JavaScript follow buttons aren't appropriate for our attendee directory because we show 20 people on a page: http://lanyrd.com/2011/europython/attendees/ http://lanyrd.com/2011/europython/attendees/ ) - we also need "write" access for our currently-in-alpha Twitter list management features. The best solution I can think of would either be finely grained permissions (so we could ask for list and follow access but not send-a-tweet access) or the ability for us to specify a reassuring message to be displayed on the Twitter OAuth screen clarifying our intentions.
- deleted 15y ago[deleted]
- sigzero 15y agoPHP to me is a hodge podge of ideas all thrown together with no real engineering sense behind them. That might be just how I feel though.
- ch0wn 15y ago> That might be just how I feel though. No, I got the exact same impression. PHP is a language that takes away all the fun in programming for me.
- glassx 15y agoI believe that this (ideas thrown around) is the truth, Rasmus Lerdorf comes across as a very pragmatic developer who's more interested in getting things done rather than being an architectural perfectionist. But I'm not saying that in a derogative way. Coming from C#, Java and Ruby, I feel that PHP is kinda fun and refreshing. The object model is quite simple, and I love the $$ (variable variable) syntax, and how 'reflection' is way simpler than any other language. It's language for hackers.
- mccutchen 15y ago"and how 'reflection' is way simpler than any other language" I've never heard this claim made, and it has been a long time since I've actually used PHP in any meaningful way. Care to expand on this? I'd be interested in a comparison to Python's support for reflection, which is simple and pervasive.
- glassx 15y agoJust a disclaimer: I have zero work experience with PHP, just personal experience. I put it inside quotation marks because it's not the true-reflection API per se, but I believe it was a mistake to even bring that up, and to generalize by saying it's easier than 'any other language'. I was talking about old methods like get_class_methods, get_class_vars, get_object_vars and $$. Here's an example which I used to answer another user above: $a = new A; foreach(get_object_vars($a) as $name => $var) { $a->$name = $a->$name + 1; echo $a->$name . "\n"; } By no means those things are absolutely "beautiful", but they get the job done and they're one-liners, hence, simple. They're simpler than Java and C#, languages which I worked for years. Also they're easier than Ruby sometimes. To be honest, I just think it is fun. I can make things in PHP with five lines that would take me multiple pages in C#, but the opposite is true too, for other areas.
- leftnode 15y agoI almost posted a new Hacker News story, but I saw this and figured my blog post belongs here better. It's an old post I dug it. http://leftnode.com/entry/what-php-needs-to-change http://leftnode.com/entry/what-php-needs-to-change
- qixxiq 15y agoI agree with most of the changes on your list, but to be honest (as I'm sure you're aware) what you're suggesting is not a viable solution. It would be far easier and more effective to simply create a new language based heavily on the good parts of php.
- wunderfool 15y agothe massive list of changes people want constitute a massive multiyear project. lexical scope....proper unicode...etc etc...these are not point release features instead of waiting five years for these to emerge in php, why not just learn python now? everything on that list from what i can tell is tested and available in python today
- cschiewek 15y agoA final nail in it's coffin.
- jessedhillon 15y agoWARNING: Frank opinions ahead. I added "To die", because that's my honest opinion after having been a PHP dev since ~PHP3. Whether it's the language's fault or not, my experience with other people's PHP code is that anything big tends toward spaghetti except in a few well-engineered cases. Non-pasta is the exception that proves the rule. People who actually know something about programming well, frankly, would not start new projects in PHP. Its only use to me is as a litmus test -- if your answer to "What do you think of PHP" doesn't include a significant critique of the language, I probably wouldn't like working with you. (Nor you with me)
- wvenable 15y agoThere's nothing inherent in the language that makes building non-spaghetti code difficult. All the weird annoyances and idiosyncrasies are a big pain in the ass but, unlike say COBOL or Basic (or even C), they don't fundamentally prevent you from building nice organized easy to understand code. That being said, I totally agree with you -- other people's PHP code tends towards spaghetti in the vast majority of cases. My take from this is that if PHP were to disappear tomorrow all these programmers building spaghetti would just inflict their level of skill on other platforms.
- jessedhillon 15y agoPossibly. I like to think -- informed by my own experience -- that PHP collects a disproportionate share of bad programmers because it's the easiest for bad programmers to use. Chiefly, it is possible to start writing scripts with not even a modicum of planning and forethought; you only need to know what your filename will be. So it stands to reason that they would move on to the new easiest language for bad programming. Or maybe they would rediscover their passion for something other than web dev, go back to school and get English degrees. I can hope, can't I?
- icebraining 15y agoI disagree; it's possible to write programs with planning and forethought in any language, and even simple languages like Python have much higher average quality code. I think it's a matter of culture, which is reflected in the language itself and in the community that surrounds it and writes code samples and OSS software.
- noduerme 15y agoThis is ridiculous. It's like saying hammers should include screwdrivers. Just know your toolbox and you won't have a problem. PHP is great. What's with all the hate? It's a good tool for a certain kind of job, not the right tool for others. Big deal. There isn't a single language that you can't find bones to pick with. It's all about what you do with it and how you like to code. If you're comfortable writing server-side script in brainfuck, more power to you.
- dexen 15y ago> What's with all the hate? Some people want every language to be just like Java, so they can switch between languages with little to no effort -- never mind we'd have only Java in the end. Some people want everything abstracted out, so no implementation details have to pe paid attention to -- nor leveraged, ever. Some people won't believe a language supports something until there's a class explicitly named after it (``proper unicode support'' my ass -_-'). Some people believe an object wrapped around something will magically make it better (``a core object that represents the HTTP Request and Response''). The list goes on... Please let PHP remain PHP, at least let it retain the good parts :-)
- noduerme 15y agoSo, uh, can't we all just get along? I mean, I could make a list about why Java's a nightmare, or Javascript or C# or something else, but if I were hiring a coder who said, "yes, we must write this server in Neko" I would say, "okay, why?" And if the reasons were good, then great. Do it. These are just tools. You should never lean on them for something they weren't designed to do; but if you find that one matches the job, then use it!
- giberson 15y agoPHP needs a champion, a Douglas Crockford and book entitled "PHP: The good parts". PHP faces a lot of similar discrimination that JavaScript did for the longest time. Sure, there are still criticisms for JavaScript but for the most part people have settled and realized that to make JavaScript good you have to write good code. Which is exactly the case for PHP. The trendiness of PHP bashing exasperates the actual issues of PHP which can easily be abated with good practices. We need a call for someone to get up and preach the best practices of PHP. And with that, a call for PHP Lint based on those best practices. There are a few individual attempts at providing JS Lint type analysis for PHP files but nothing from anyone with clout. We could use an official analyzer supported by recognized field leaders pushing quality coding practices.
- tjogin 15y agoAbsolutely, if PHP has good parts, I want to know what they are.
- Scriptor 15y agoIt looks like the book for that is already out: http://oreilly.com/catalog/9780596804381 http://oreilly.com/catalog/9780596804381
- rjbond3rd 15y agoI found that book to be disappointing, not up to O'Reilly's standards, and certainly not in the same league as JS: the Good Parts. I guess they rushed it out to capitalize, which is a shame.
- ryan-allen 15y agoPHP is a legacy programming language. The good part is when new systems are no longer written in PHP!
- ChiperSoft 15y agoPHP is roughly the same age as javascript, give or take a few months.
- angerman 15y agoJust an Idea. I think what causes so many sentiments against PHP is due in part to the mass adoption of PHP. These days, you find PHP almost everywhere. And how do you get to PHP? Let's assume we are in collage and want to write that next big website that's surely going to rule them all. Now, we don't really know that much about all this "tech" stuff. But hey, I can hit "show source" in the browser. This must be easy. After a few baby steps with a WYSIWY(WishYoud)G tool, you decide to learn /some/ HTML for good. Once you figure that HTML alone can't do a lot, there's a somewhat native path to PHP. You keep on reading tutorials written by others, who know as much as you or a little more. You are still on the cheap side, and need to keep tight on your money for that next big website you are going to write. And the more you read the more enlightened you feel. Wow! I can actually do that and my dead cheap webhost offers PHP as well. Life is good. Because you don't lack any minimal intelligence, you figure out how to write your next (big) website. You probably didn't succeed in writing the next FaceBook, but hey, you are now /one/ of the /web guys/. You probably think what you are doing is real fun. There are then two paths you can take: - A: stick with PHP and feel enlightened all the way, when ever you learn some new trick, or - B: wonder if PHP is the only true real thing. You don't know C or some other "ancient" language, so you are still a little afraid. Perl seems to look a lot like PHP but it's syntax is confusing and no one of your friends on the forums you are frequenting is using it anyway. Then there is Python or Ruby. Wow those look strange. No curly braces for function bodies. Why do people here talk about templating? What's this about? Do I need that? PHP was so easy... Anyway, you are still curious and learn about this "other" way of writing webapps (that's what we are still primarily concerned with). Once you start to figure out that variables do /not/ have to start with $ to be valid, you wonder what else PHP might have hid from your novice learning? There is a lot more. Not necessarily PHP's fault. Just the lockin in that PHP mindset. ---- The basic problem with PHP (to me) is that I've seen it to be more a motel on the way to enlightenment. Some just find it too comforting to move on. Others, once they've passed it, rarely(ever?) come back unless someone else tells (forces) them to do so.
- ivanbernat 15y agoI'd be happy if we moved to "+" for string concatenation and "." for object member access (but this would break every script out there). Though I've been a PHP user for 5+ years, I still do this when switching back from longer JS / Ruby development periods.