7 ms·
Here is another point that highlights the problem: If I want to write a hello world application in PHP, it's neither as long as <?php print("hello world");?> n
by z92 14y ago
Here is another point that highlights the problem:
If I want to write a hello world application in PHP, it's neither as long as <?php print("hello world");?> nor as short as <?="hello world"?>
Rather it's simply: hello world. Just type in those 11 characters in a text file and save it as hello.php. Now load it on your browser [or run it from command line] and it will print hello world. I don't think it can get any more simpler than that in other languages. PHP was developed from the ground up as a templateting language for serving HTML pages. These other languages are more of a general type.
Therefore the replacement for PHP should come through a new language targeted as a replacement for PHP as Jeff said. Otherwise there always be extra web/template stacks for the developers to take care of. And that will be the first hurdle to learn and overcome for novice developers looking for switching to something easier.
- andreasvc 14y agoAre you seriously basing a whole argument on what the hello world program looks like? That has nothing to do with actual real world programs. Mixing logic & presentation might make it easier to get something running quickly, but it's one of the downsides of PHP that these things get mixed up when they probably shouldn't for a project of reasonable size. The whole idea that it's an advantage of PHP that you can get something up and running so quickly is wrongheaded. Actually, it's much better if it requires some amount of thought and planning to code something up because that increases the likelihood that you'll do it right the first time and build on a solid foundation.
- maratd 14y ago> Actually, it's much better if it requires some amount of thought and planning to code something up because that increases the likelihood that you'll do it right the first time and build on a solid foundation. This is solid advice for an engineer. And absolutely moronic for a businessman. Choosing what platform to use is a business decision. If you take too long to get it right, you will never get the chance to make a dime off of your work. We are all working on limited time frames. It is far better to throw something together that works and rewrite later, when you're actually making money. PHP is amazing at letting you write something fast and rewrite it into something more manageable later.
- Splines 14y agoPlus, if you're trying to get new people to use your language, having a complex toolchain is going to scare them off. "Hey kid, first one's free"
- flatline3 14y ago> PHP is amazing at letting you write something fast and rewrite it into something more manageable later. From experience, the mountain of technical debt organizations acquire when starting with PHP can make it near impossible to rewrite it into something more manageable later, and it's a false dichotomy to claim PHP lets you write something fast while the alternatives do not.
- wpietri 14y agoThat's true only if your audience is well-educated engineers with plenty of experience under their belts working on projects with substantial backing. Unfortunately, nobody starts out well-educated and experienced. And many projects start out small and grow. If you want to make your platform a broad success, you need to have a good experience for noobs and quickies. PHP is an abomination as languages go, but it's massively successful because any idiot can quickly get something basic up.
- blindhippo 14y agoWhat people continue to fail to explain is why PHP needs to be replaced. Why not improve it? After the millions of man hours that have gone into the plethora of open source PHP based frameworks and tools (aka, what powers the internet) - wouldn't we as a community want to improve the foundations rather then scrap them entirely? You know, like what happened with Javascript...
- btilly 14y agoThe one thing that can never be fixed is a poorly chosen feature. PHP has a lot of them. And they interact badly.
- berntb 14y agoYes, but... All languages (like any system) will have cruft, after a while. Is the solution really to do a periodic break with backwards compatibility for purity reasons, Python 3 style? There should be a better way?! What about a low level machine like Java/.Net and just let the next language evolve on top of that -- so old libraries could run? (Maybe there could be Xcompilers for Ruby/Perl 6/xxx to the Perl "bytecode", to take advantage of CPAN?)
- btilly 14y agoSome things simply can never be fixed. Figuring out when that happened to you is a judgement call.
- blindhippo 14y agoList them out, explain them, show your work... If us PHP developers have such bad judgement, show us the error of our ways. And do not link to some other persons blog post - explain it yourself.
- btilly 14y agoWhy should I bother following your demands? If you've ignored a million blog posts that clearly explain it, you'll ignore me as well. And if you don't have enough experience of better programming languages that the warts are obvious, then what I could have to say would make no sense to you. To you it would be just the way things are - even though they aren't that way for other developers in other languages.
- jerf 14y agoI'm not convinced this is true. You see, way back in the day in 1997 when I was doing web dev, everything worked the way PHP does. ColdFusion, ASP (not ASP.net, ASP), PHP, and almost everything else that was seriously trying to do web pages worked that way. It took the community collectively a long time to stop seeing URLs as identifying anything but specific files. This is back when having those files be programs was still a bit of an innovation. After 15 years of one of the biggest bursts of innovation the open source world has ever seen, and with such diversity in frameworks that the mind boggles, nobody has returned to this model successfully. I've got MVC-inspired designs coming out my ears, continuation-based designs, frameworks just beginning to incorporate web sockets deeply (instead of as an afterthought), GWT, ASP.net, and other attempts at building a fundamentally different model and compiling it into another, and everything under the sun... but no return to the page-is-program model. I don't think it's the key to PHP's success, because even in the competitive-yet-very-fertile soil of the web framework world, nobody else can make it work anymore. I think it's vestigial, and nothing else. (Personally I think the key is simply that everybody has deployed it, and since there's basically no way to force every web hosting company to support Language X simultaneously, PHP isn't going away until the entire concept of web hosting goes away. Which isn't anytime soon.)
- mechanical_fish 14y agoThe page-is-program model still works as well as ever. It's just that, if your problem is so simple that the page-is-program pattern is most appropriate -- for example, if you are eight years old and you want to build a page that serves up a different picture of a dinosaur every time it gets reloaded -- you should just use PHP. Why choose anything else? It's true that other languages have not wasted a lot of time trying to displace PHP as the language of choice for anonymous random dinosaur servers. That's because there's no money in fighting PHP on its home turf. The turf just isn't worth enough. "Vestigial" is the wrong word. That's like describing a screwdriver as "vestigial" because the impact driver has been invented. Sure, impact drivers can accomplish many things that mere screwdrivers cannot, but that doesn't mean that screwdrivers aren't still useful, and numerous, and popular.
- 14y ago
- randomdata 14y agoIt is not that support is completely non-existant. Ruby, for instance, can be executed in a PHP-like fashion using ERB. $ echo 'hello world' | erb hello world $ echo 'hello world' | php hello world If a new user could throw index.erb up on a server and have it execute in a Ruby context, would we be any further to supporting better development practices? Will the user take that experience and move into a framework like Rails later? If yes, what has stopped them from using the similar PHP frameworks that will already take them away from the comfort of the single page template? If you truly only need a single page template without any further abstraction, then why not use PHP? It seems all of the complaints about PHP stem from using it in big projects. It is hard to argue that it does a single page template very well for when that is all you need. Right tool for the job and all that.
- columbo 14y ago> Rather it's simply: hello world Wouldn't that also apply to jsp, cfm, gsp, jsf and asp?