TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Taking PHP Seriously

819 pointsby josephscottover 8 years ago

79 comments

swalshover 8 years ago
I work on PHP at my day job (in a public company), before this, I came from Ruby, and .NET before that.<p>I&#x27;m convinced the reason so many successful projects use PHP, is not because of any inherent nature of the language. I think it&#x27;s the people who use it. They just don&#x27;t care. A successful project needs to be started by someone that cares just enough, but not too much.<p>If you&#x27;re programming in PHP, you&#x27;re not running around talking about &quot;convention over configuration&quot; giving talks, or trying to make your code beautiful. It&#x27;s a garbage language, and you know it. But it allows you to get something up and running, so dang quick. You&#x27;re failing while the other guy is still updating his gem file. You&#x27;re advertising while the other guy is trying out some fancy new deploy script. You&#x27;re incorporating feedback while the other guy is just starting to get to work. When he finally fails, he&#x27;s used up half his runway, whereas you, the guy who didn&#x27;t give a fuck about your code has gotten past that first failure, and are finally getting some traction.<p>Hopefully, the next guy to join the company will clean up your shit. The other guys code may not look like shit, but it doesn&#x27;t solve any useful problems... so they never got the chance to hire that next guy.
评论 #12704415 未加载
评论 #12704507 未加载
评论 #12705745 未加载
评论 #12708239 未加载
评论 #12707325 未加载
评论 #12705945 未加载
评论 #12705070 未加载
评论 #12704366 未加载
评论 #12704410 未加载
评论 #12704541 未加载
评论 #12704721 未加载
评论 #12711484 未加载
评论 #12704155 未加载
评论 #12704136 未加载
评论 #12705787 未加载
评论 #12705462 未加载
评论 #12704398 未加载
评论 #12704140 未加载
评论 #12704145 未加载
评论 #12706205 未加载
评论 #12707709 未加载
评论 #12715176 未加载
评论 #12709182 未加载
评论 #12711043 未加载
评论 #12708582 未加载
评论 #12704286 未加载
评论 #12704816 未加载
评论 #12704598 未加载
评论 #12707799 未加载
评论 #12704379 未加载
评论 #12709536 未加载
评论 #12704447 未加载
评论 #12710302 未加载
评论 #12708249 未加载
评论 #12708829 未加载
评论 #12707637 未加载
评论 #12704591 未加载
评论 #12708754 未加载
评论 #12706451 未加载
评论 #12711290 未加载
评论 #12704685 未加载
评论 #12704356 未加载
Klathmonover 8 years ago
The article points out that arguably the best part of PHP is the &quot;shared nothing lifecycle&quot;. That each request starts new, and the process dies at the end of the request. It&#x27;s by far my favorite part, and I completely agree that it makes &quot;reasoning about&quot; (boy do I hate that phrase...) your program much easier.<p>Why are there no other &quot;competitors&quot; in this space? Why do most other languages go with the alternative route of using an event loop or daemonizing your &quot;server&quot; to serve up requests? I can understand why Node.js does it (otherwise the async nature would just be an annoyance for no gain), but why haven&#x27;t there been any other server-side languages that not only work well like this, but actively target it?<p>It seems like it would be easier for everyone involved. You wouldn&#x27;t need much of a GC when the process is killed every time, you don&#x27;t need to worry about async IO or multi-threading or catching errors or any of the other annoyances that come with most of the traditional &quot;event loop&quot; way of doing things.<p>So what&#x27;s the catch?
评论 #12704108 未加载
评论 #12704314 未加载
评论 #12704601 未加载
评论 #12704119 未加载
评论 #12706424 未加载
评论 #12705058 未加载
评论 #12704368 未加载
评论 #12704101 未加载
评论 #12704122 未加载
评论 #12704137 未加载
评论 #12704135 未加载
评论 #12704118 未加载
评论 #12704682 未加载
评论 #12704489 未加载
评论 #12704277 未加载
评论 #12704126 未加载
评论 #12704099 未加载
评论 #12713508 未加载
评论 #12704104 未加载
评论 #12708155 未加载
评论 #12704128 未加载
评论 #12706720 未加载
评论 #12704386 未加载
评论 #12705150 未加载
评论 #12707456 未加载
评论 #12705329 未加载
评论 #12704132 未加载
skippytaover 8 years ago
I worked in PHP at Box for about 3 years. This article does a great job of reflecting my sentiments on the language. In particular, I&#x27;m glad to see that the author recognizes that there are some glaring issues with PHP that aren&#x27;t tradeoffs in favor of something else - they&#x27;re just warts.<p>That said, PHP is really good at what it does - providing a framework and environment for serving web requests efficiently and easily. I find developing in it very fluid once you know how to avoid the warts. A lot of the flak that PHP receives as a language revolves around the fact that it doesn&#x27;t actively discourage developers from doing bad things, and sometimes the language itself does some crazy stuff (as shown in the article with the divide-by-zero behavior). I think this is a huge shortcoming of the language, especially as code bases and teams grow and your organization needs to depend on the language more and more for safety. That said, I still don&#x27;t <i>hate</i> working with it. Sometimes I rather enjoy how quickly I can develop in PHP, and how reliable it can be if you know how to operate it.<p>I think in all, it was a bit of a slog to get to the point where I am with PHP today - to the point where I understand its strengths and flaws, but ultimately I think it does have a place in modern webapp development. I think Hack and HHVM are excellent spiritual successors to what PHP tried to (is trying to?) accomplish, and that they do a great job of hiding or eliminating some of the warts of their parent language.<p>Kudos to the Slack team for being pragmatic about their approach to the technology, and hey again to all of my former colleagues working there!
rpedenover 8 years ago
I&#x27;ve had to do some PHP work recently, on a fairly old school PHP codebase for a high traffic website, after spending most oy my career working in Java and C# (and I still do most of my work in those languages).<p>I&#x27;ve read a lot of PHP hate over the years, but I&#x27;ve found working with it in practice to be decidedly...not bad. Perhaps the codebase I inherited is better than most. But I&#x27;ve had to make some fairly major updates, and they&#x27;ve proven to be far less painful than I had expected based on the amount of PHP attacks I&#x27;d read online.<p>Maybe the snobbery toward PHP is a good thing? There are some really big PHP-based communities out there, Wordpress being probably the largest. And in these communities, there appears to be a large demand for paid consulting and plugins. Sure, there&#x27;s a ton of competition on the low end, but it&#x27;s an area where a really great developer could stand out from the crowd and do very well financially, <i>especially</i> for more complex consulting and dev work since so many good developers turn their noses up at PHP.
评论 #12703983 未加载
评论 #12703964 未加载
agentgtover 8 years ago
It is not entirely clear if the author aka Slack chose PHP with these reasons in mind apriori or did they choose PHP first and are now justifying why their choice of PHP is not bad.<p>I&#x27;m going to guess they picked PHP because they knew PHP and not because of the nice reasons mentioned in the article. That is the article should be &quot;why slack is sticking with PHP&quot;.<p>Almost all the major languages are actually (despite lots of HN debate and arguments) fairly good choice for developing not because the major languages are expressive&#x2F;powerful but because they have very very mature tools (e.g. Java sucks but the JVM and its tools are very mature) and lots of people who know it.<p>Basically you could write a plethora of articles with <i>&quot;Taking MAJOR_BORING_LANGUAGE Seriously&quot;</i>.<p>For example I&#x27;m responsible for choosing Java for my companies startup. Java historically is not a very productive language to pump something out but in recent years it has vastly improved... regardless I chose Java because thats what I knew at the time and I would pick it (or some other JVM language) again. And I could rattle off whole bunch of reasons why the JVM still kicks butt but the reality is I am biased because of my familiarity.
评论 #12707393 未加载
calsyover 8 years ago
Come on, PHP is the &#x27;Justin Bieber&#x27; of languages, everyone knows it. Its the most successful and widely used web server language in use and with anything so popular it has a large group of haters.<p>If anyone wants to come off like a &#x27;serious&#x27; programmer, all they need to do is denounce PHP as a horrible aberration, a frankenstein of a language. Most don&#x27;t even know about the changes in the language over the last decade, they just hate it to stay inline with their peers.<p>However, those opinions dont line up with the facts. PHP goes beyond semantics of language, it&#x27;s a complete service for delivering dynamic HTML from the server. Why is it so successful? It is one of the most robust, well supported, battle tested languages to appear in the last 15 years. Its support is guaranteed on any hosting platform or cloud solution available. It has a large array of libraries capable of integrating with most any service whether that be databases, web apis etc. It has the ability to scale for high demand, as demonstrated by the many large corps that use it.<p>If you want to rip on PHP because it&#x27;s cool, I think you&#x27;re simply shooting yourself in the foot and ignoring a tool capable of performing almost any task you would require of it on the server side.
throw2016over 8 years ago
I think there is a needless air of elitism especially here that can only come when people take themselves too seriously, seek validation for their choices, and are always on &#x27;display&#x27;. This is also now fuelling a full scale culture of complexity as nobody wants to do things simply lest they be judged as &#x27;unsophisticated&#x27; and lose career and other opportunities.<p>This cannot lead to real conversations or good software. There are far too many naysayers always eager to jump in with their 2 bits of negativity with the same cliched talk points and links most of whom I am sure would never be seen near php and may not even have used it.<p>The criticism goes silent when HN favourites like Slack show up on discussion. Ignoring the sheer number of high traffic websites and successful startups using PHP is just another way to deny it its due.<p>Most PHP apps are a breeze to install and use compared to just about any Ruby or Node app. Try installing Discourse to understand just how user hostile it has become. The respect for users and simplicity comes through in PHP. NPM and Ruby with their dependency hell expect a full dev environment even on user machines and nobody thinks this is ridiculous. There is no denying PHP warts but Node, Ruby and Python I think have their fair share of issues.<p>I really do like Python but for a web project that needs to scale and not get mired in other issues I would choose PHP every single time. For a library or SAAS app maybe, but for an installable app I would never expose users to the Ruby or Node ecosystem.
callesggover 8 years ago
That example of &quot;Surprise type conversions&quot; is crazy. Did not know that.<p>While i do not think PHP is a perfect programing language. There is one think i LOVE about PHP, it is that the PHP &quot;community&#x27;s&quot; default way of documenting code behavior is to make a small example.<p>When i read most other languages documentation i read it. Then i need to make a small test to verify that i understood it.<p>All those tests takes a long time to make and i have to make them over and over again, every time i forget the way a function behaves.
评论 #12707771 未加载
评论 #12704443 未加载
andreygrehovover 8 years ago
Hack is awesome, but we decided to go with PHP 7 and this choice was primarily made because of lack of tooling on the Hack side. Things like New Relic are not available and these type of things do matter a lot when it comes down to choosing the programming language.<p>I must say that PHP 7 is a great language nowadays. Most of the modern concepts are baked into a language or are about to be developed.<p>At some point, I wish Hack and PHP merge into a single language in the future, somewhat similar to what happened to Node and iojs. I&#x27;m not sure if Hack is going to be around in 5 years, but I&#x27;m pretty confident about PHP.<p>I&#x27;d definitely love to see more articles about Hack and people&#x27;s experience with using it in production.
评论 #12704216 未加载
评论 #12704500 未加载
Tehnixover 8 years ago
I find the virtues quite uncompelling, take for example<p>&gt;First, state. Every web request starts from a completely blank slate.<p>Except for, you know, when you don&#x27;t want to reinitialize everything everytime someone makes a new request. There are tons of things that you only need to run once.<p>&gt;I claim that PHP’s simpler “think; edit; reload the page” cycle makes developers more productive. Over the course of a long and complex software project’s life cycle, these productivity gains compound.<p>I cannot disagree enough with the conclusion he draws from the quick feedback loop in PHP. I do PHP in my day job, because that&#x27;s what our codebase is in, but recently I finally got the opportunity to use Haskell for a side project. The feedback-loop might be slower (honestly not by much, automatic reloading is a thing in almost any framework), but I&#x27;m a zillion times more confident in my code, because you are able to encode so much logic in the type system, meaning the compiler will catch whatever. Contrast this with PHP, where I&#x27;d almost have to visit every branch of code when I alter something because of it&#x27;s many weird behaviours. <i>Particularly</i> when refactoring code, which you often end up doing while hasing something out.<p>Also, PHP works at a quite coarse granularity of concurrency. A thread per web request only? As soon as you want to do something more advanced, you are forced out into the many patchwork solutions (wanna do async? queue that shit).<p>Sure, a lot of people have done a lot of quite cool projects in PHP, but I would much more benefit that to the lower barrier to entry - heck PHP was my first language and I made a CMS from scratch without even knowing much of what I was doing.<p>That said, it has come a long way, and something like HHVM&#x2F;Hack definitely helps a bunch! I just think the pros in this blog post are quite weird and IMHO incorrect.<p>&lt;&#x2F;rant&gt;
评论 #12704436 未加载
评论 #12706513 未加载
评论 #12705504 未加载
combatentropyover 8 years ago
PHP is wonderful as a thin layer of glue between your database and the web browser. It&#x27;s when you write a thick middle layer that PHP gets unwieldy.<p>Business logic: Don&#x27;t write it in PHP. Write it in PostgreSQL.<p>Authentication: Don&#x27;t write it in PHP. Use Apache 2.4&#x27;s mod_auth_form. Replace hundreds of lines of PHP code with a few lines of Apache config. When it gets to your PHP script, all that&#x27;s left to do is read $_SERVER[&#x27;REMOTE_USER&#x27;].<p>Authorization: Don&#x27;t write it in PHP. Use one of Apache&#x27;s modules (LDAP, DB, or even file) or if possible make your users all very restricted database users and use database permissions more.<p>Don&#x27;t need a database? Then why not handle it all on client-side JavaScript?<p>I&#x27;ll admit that my advice fits well with CRUD web apps. If you&#x27;re doing something else, PHP may be gross.<p>But really, my goal in programming (don&#x27;t always reach it) is for PHP to just make a simple database call and wrap the result in HTML. If you&#x27;re doing 123 == &#x27;123foo&#x27;, can you move that up into the database or down into the browser? If you&#x27;re writing elaborate class hierarchies in PHP, I think you&#x27;re doing too much in PHP. I write a few functions, if needed, but mostly move all data processing to the database or browser.
评论 #12706137 未加载
staticelfover 8 years ago
I was kind of surprised to read this and started to think this was just a copy of a previous speech I&#x27;ve heard before.<p>I was right it was: <a href="https:&#x2F;&#x2F;www.infoq.com&#x2F;presentations&#x2F;php-history" rel="nofollow">https:&#x2F;&#x2F;www.infoq.com&#x2F;presentations&#x2F;php-history</a> but the author is the same person.<p>It is a good speech and I&#x27;ve been developing in php for years, written a blog post (<a href="http:&#x2F;&#x2F;sucky.ninja&#x2F;leaving-php-is-too-expensive&#x2F;" rel="nofollow">http:&#x2F;&#x2F;sucky.ninja&#x2F;leaving-php-is-too-expensive&#x2F;</a>) about it but I do no longer use php for my backends.<p>I&#x27;ve whole-heartedly switched to ASP.NET since my productivity is increased with it and I can actually use the language (C#) for other things. I would&#x27;ve agreed with the author a couple of years ago but with Azure, AWS and other cloud services it is simply no longer true that php gives developers a quicker feedback loop. I can setup a node server with gulp and start working in 10 minutes or I can start a new ASP.NET project and deploy to production right after the project creation has completed. With php I still have to setup a virtual machine etc etc.<p>I would not go back, even if it is cheaper.
评论 #12708466 未加载
jv22222over 8 years ago
Love the memes:<p>&quot;PHP is garbage language!&quot;, &quot;PHP is a shitty language!&quot;<p>That is the antiquated view of course. The old days.<p>Now with Laravel and PHP7 it is a pleasure to use.<p>I&#x27;d go further.<p>Working in Laravel is BETTER than ROR IMHO.
评论 #12706113 未加载
paulddraperover 8 years ago
&gt; Virtues of PHP<p>&gt; First, state. Every web request starts from a completely blank slate.<p>&gt; Second, concurrency. An individual web request runs in a single PHP thread.<p>&gt; Finally, the fact that PHP programs operate at a request level<p>Isn&#x27;t this just &quot;virtues of Apache modules&quot;?<p>There&#x27;s mod_python, mod_perl, and mod_ruby. Are state, concurrency, and global requests virtues of these languages too?<p>---<p>Even if you <i>do</i> somehow convince me that these virtues are specific to PHP, you can&#x27;t convince me it does it well. Hence, MaxRequestsPerChild.<p>To quote Radmus Lerdorf,<p>&gt; The real programmers will say &quot;Yeah it works but you&#x27;re leaking memory everywhere. Perhaps we should fix that.&quot; I’ll just restart Apache every 10 requests.<p>Clean slate, my eye.
评论 #12704464 未加载
评论 #12705538 未加载
评论 #12704921 未加载
rahul286over 8 years ago
We are mostly (95%) a PHP company but going by trends; we did some projects in Python, NodeJS and Rails a few years ago.<p>Now I look back; I see the projects which have technical debt were flawed in design and did not get maintenance they needed. Most of them did not get traction to the point where scalability issue came into the picture.<p>So this year, we started moving that 5 % non-PHP projects to PHP counterparts. Again, we are miles away from any real-world scalability issue, but at least we are now able to maintain projects as we have a large PHP team.<p>At a small to mid-size organization level, it is more important to use one language for all projects.<p>I believe technical debt is not related to the choice of language but anticipating direction a project might take and picking up right design patterns to support that.<p>Which programming language is better is a highly overrated question!<p>I wish I had learned this few year ago.
20yearsover 8 years ago
There have been huge improvements made with PHP over the past few years. PHP 7 is great and I would choose it over Hack. Modern PHP using autoloading (Packagist &amp; Composer) and an MVC structure allows for rapid development. With frameworks such as Laravel, you can get something up quickly or just pull in Packagist libraries you need if you don&#x27;t want the bloat of a framework.<p>I recently finished up a fairly complex web app that uses PHP 7 for the back-end. Took me under 2 weeks to develop partly because I was able to leverage a lot of stable and well supported libraries through Packagist. It brought in over $4k its first month. Not bad for 2 weeks worth of work. It would have been hard to accomplish the same thing that quickly leveraging Node or Python (I use both) at lease for this app.
评论 #12706471 未加载
评论 #12714377 未加载
tonyarklesover 8 years ago
I&#x27;ve been doing consulting for several years now, as well as a MSc thesis that involved me looking at a number of open source codebases. I am generally in the &quot;PHP is garbage&quot; camp, but I keep hearing people say that nice codebases in PHP are possible. I&#x27;ve never seen one, but I am perpetually open to the idea that they exist.<p>Does anyone have a good example of an open-source PHP project that will enlighten me?
评论 #12704855 未加载
评论 #12705261 未加载
orideconover 8 years ago
Sorry to sound so dramatic but I don&#x27;t know how to put this in better words:<p>After reading this thread, is there even a proper way to measure how good a language is (trade-offs, benefits down the road)? Having done web stuff in PHP and Python I think both are terrible. So, how would a programmer trying to avoid his own biases and anecdotes find what tools are right for each job? Maybe I didn&#x27;t &quot;liked&quot; PHP and Python because I&#x27;m a terrible programmer. Or maybe I only worked with awful teams.<p>Is there any science involved or should I make my decisions based in what blog post I read that week? How can I actually trust the opinion of companies&#x2F;engineers if they are so invested in that tech? Who would admit that after investing millions on it they didn&#x27;t actually think it was worth it? There&#x27;s no way that I&#x27;ll be able to have deep knowledge about all the languages that are out there.<p>The sad thing is that I end it up choosing whatever is popular and half sane because not finding (updated&#x2F;well-maintained) libs or tools you need is worse than picking a niche language that might do the job better.
评论 #12705196 未加载
评论 #12706023 未加载
menelaus35over 8 years ago
Write an API for my client app which returns user&#x27;s data as JSON (or render HTML page for profile);<p>You:<p>&lt;!-- api.php --&gt;<p>{<p>&lt;?php<p>mysql_connect(&quot;host&quot;, &quot;pass&quot;); mysql_select_db(&quot;users&quot;);<p>$uid = $_GET[ &quot;uid&quot; ];<p>$res = mysql_query( &quot;select * from users where uid = $uid&quot; );<p>$ar = mysql_fetch_assoc( $res );<p>echo &quot;name: &quot; . $ar[&quot;name&quot;] . &quot;,&quot;; echo &quot;location: &quot; . $ar[&quot;location&quot;];<p>?&gt;<p>}<p>&lt;!-- end of api.php --&gt;<p>Just call it <a href="http:&#x2F;&#x2F;domain.com&#x2F;api.php?uid=USER_ID" rel="nofollow">http:&#x2F;&#x2F;domain.com&#x2F;api.php?uid=USER_ID</a><p>( Yeah I know you want to scream and say all the things about this code, but this is kind of code you would encounter with PHP, most of the time it&#x27;s more horrifying than this one. )<p>People use it PHP for this reason, If you want to make same functionality in another language you need to setup an app and all the necessary things that protect you from garbage, some obvious security issues and bugs, not a single file like this. It&#x27;s so easy and so wrong, it should be illegal to do this. Create a file and put it into directory and call it from your browser. You don&#x27;t have to know anything about web or web servers and stuff. You just make shit by copying and pasting from internet, that&#x27;s why Facebook made by PHP and now there are whole teams who are trying to protect company from PHP horrors. (They made a PHP VM, bunch of software to analyze PHP and optimize it etc. )<p>Just don&#x27;t try to justify PHP, do not defend it. It&#x27;s shit and you know it, accept it and move on.<p>(Note: do you remember Facebook&#x27;s profile.php pages, they are still exists you can call it just like old times profile.php?id=YOUR_ID, yeah it&#x27;s a shit once you get infected you&#x27;re not gonna get out of it completely. Even if you can, it leaves traces on you just like profile.php URL&#x27;s
评论 #12706705 未加载
评论 #12706689 未加载
评论 #12706474 未加载
bradleyjamesover 8 years ago
My assumption is they already knew PHP before setting out on this (if not I&#x27;d be interested in hearing about that). What you know is a huge part of these decisions. I doubt many of the sites noted truly picked PHP after sitting down and doing a comparison of all the popular languages across the board. Their systems grew out of what they knew and there was no time to rewrite or maybe there wasn&#x27;t a need either. If you like PHP and can support it good for you.<p>Regardless of their findings I wouldn&#x27;t recommend anyone learn PHP if starting out.
评论 #12708143 未加载
eloisantover 8 years ago
Wordpress succeeded because they were using PHP, because during the 2000&#x27;s it was very easy to find a cheap shared hosting solution in PHP+MySQL. There was no cheap way to host Rails applications.<p>And their target was people who would install Wordpress themselves on a cheap shared host.<p>Facebook and Wikipedia probably used PHP because many developers knew it, and the reason was... That there was many cheap shared hosting solution for their pet projects.<p>Not only this is no longer true (it&#x27;s just as easy and cheap to host Rails, Java, Scala, or anything with cloud hosting), but the availability of cheap shared hosting is not relevant for most problems.<p>tl;dr:<p>* Wordpress couldn&#x27;t have succeeded without PHP, because of a context that is no longer true today * Facebook succeeded despite using PHP, because they had the manpower to fork the language and write their own VM
评论 #12716216 未加载
pcwaltonover 8 years ago
&gt; Almost all languages these days let programmers compare, e.g., integers and floats with the &gt;= operator; heck, even C allows this.<p>The implication that C is an especially strict language for type conversions is strange. C is actually one of the loosest languages for type conversions. It&#x27;s even legal to do things like compare pointers to integers (though most compilers warn you)!
Klunyover 8 years ago
I&#x27;m a PHP programmer and it&#x27;s great to see this because a lot of times I feel like PHP is limiting my ability to move forward in my career. I&#x27;ve been looking for jobs and it seems like having pretty much only PHP, jQuery and mySql on my resume isn&#x27;t enough to get hired. I&#x27;ve been trying to figure out what I have to do to get noticed - is it worth cranking out a bunch of projects in PHP that won&#x27;t impress anyone because it&#x27;s just PHP, or or is it better to learn a language like Ruby and make a bunch of (shittier, because I&#x27;m not experienced with it) projects?
merbover 8 years ago
&gt; a typical Python application server, e.g., the debugging &gt; cycle will look something like “think; edit; restart the &gt; server; send some test requests.”<p>the &quot;most typical&quot; Python stack (wouldn&#x27;t call it a application server) is probably built with Django where you don&#x27;t reason about the Server restart, it&#x27;s as fast as changing something in PHP.<p>P.S.: I don&#x27;t use Python that much anymore. Other people would say that the thing I&#x27;m using now takes endlessly long to compile and has some wierd operators.
评论 #12704560 未加载
wojcikstefanover 8 years ago
Thank you for writing this - very eye-opening. One sentence doesn&#x27;t seem right to me though:<p>&gt; Hack provides an option that no other popular member of the MPDPL family has: the ability to introduce a type system after initial development, and only in the parts of the system where the value exceeds the cost.<p>Python 3 allows you to do that, too: <a href="https:&#x2F;&#x2F;docs.python.org&#x2F;3&#x2F;library&#x2F;typing.html" rel="nofollow">https:&#x2F;&#x2F;docs.python.org&#x2F;3&#x2F;library&#x2F;typing.html</a>
评论 #12708772 未加载
wnevetsover 8 years ago
&gt;I claim that PHP’s simpler “think; edit; reload the page” cycle makes developers more productive. Over the course of a long and complex software project’s life cycle, these productivity gains compound<p>this is certainly what got me started with PHP and what makes its so easy for beginners
labradorover 8 years ago
&gt; Inconsistency around reference, value semantics.<p>I ran into this problem today with some code by a programmer who should have known better. The problem is not with PHP, it&#x27;s with programmers who learn one version and then don&#x27;t keep up and change as the language evolves and improves (ain&#x27;t nobody got time for that.) One guy I work with is still programming PHP like it&#x27;s year 2000. It&#x27;s maddening. PHP7 is a very nice language. People decided JavaScript was cool after &quot;The Good Parts&quot; came out. The same is true for PHP. If you learned PHP3 in high school and are still banging out code like you did then, you&#x27;re the problem, not the language.
qaqover 8 years ago
For greenfield project main question would be why? It&#x27;s not horrible but what do you exactly gain? With so many options around it&#x27;s actually hard to make a case for PHP (and I have being using it since 2000).
评论 #12704152 未加载
评论 #12704092 未加载
JED3over 8 years ago
TLDR; Because Cal Henderson made the initial commit.<p>He&#x27;s obviously a big fan of the language, and surely had a big hand in influencing what technology would be chosen very early on.<p>PHP can be like playing with dynamite. If you have an explosives expert on site (or Cal Henderson), you can get a helluva lot done with PHP in a very short amount of time.
nnqover 8 years ago
I find it odd that nobody sees the elephant in the room: <i>productivity is determined by the &quot;fit&quot; between a developer&#x27;s or team&#x27;s mindset and the language!</i><p>None of them matter in isolation. If you have a team of people who likes to think <i>dynamic, functionally and meta-linguistically</i>, just pick the best Lisp-family language for your needs. For another team who prefers to think <i>dynamic, functionally, with actors and pattern-matching</i>, pick Erlang or Elixir. Someone who likes to think <i>pragmatically, likes obviousness and simple static typing</i> should probably pick Go if he&#x27;s also &quot;minimalistic&quot; or Java otherwise. For a <i>&quot;move fast and break things + fuck this functional programming bullshit&quot;</i> thinking team, pick the best version of PHP (Hack &amp; HHVM) etc. Want &quot;move fast and break things + ok with event-driven + some sprinkle of functional programming goodness&quot;, then use Nodejs.<p>For example, for &quot;move fast and break shit&quot; prototype development I pick Nodejs over PHP because my mind &quot;works functionally&quot; and every attempt at writing functional code in PHP is <i>pure pain</i>.<p>There is a reason why there are so many languages: <i>people think very very very differently from one another, but at the same time they think similarly enough that they can gather in &quot;tribes&quot; around certain technologies and idea!</i>
tamalsaha001over 8 years ago
It is interesting that author does not mention the performance improvements of PHP 7. I have read with PHP 7, HHVM does not have the performances any more. I wonder author cared to test that in their codebase.
评论 #12704229 未加载
iamleppertover 8 years ago
The shared nothing request model leads to laziness. And once you get to any kind of scale you&#x27;ll want to run PHP in something like php-fpm with lighttpd or nginx, which actually does aggressive caching. It&#x27;s painfully slow to re-evaluate for every single request. This introduces subtle problems because your code was probably shit to start with.<p>Of course, this is not a post about how good or bad PHP is&#x2F;was. It&#x27;s just a matter of personal preference at the end of the day. Your favorite language is the one you feel you&#x27;re the most productive in and says a lot more about you and your experience&#x2F;background than the language itself.
mtrnover 8 years ago
If people would focus more on usability, comprehensibility, clear algorithms and project structure and precise requirements we could probably skip debating over languages altogether, because programs would look beautiful in any language.
评论 #12704692 未加载
jacobsenscottover 8 years ago
My experience is that programming is fun no matter what language you use. I&#x27;ve used C, C++, Python, VB6, C#, Java, Ruby, elisp, PHP and a little clojure and some others. I don&#x27;t get all the language hate.
thomover 8 years ago
A while back I found myself doing a Laravel project and found it totally adequate and not at all painful, so I don&#x27;t have the same old flinch reflex whenever someone asks about PHP these days.<p>That said, nobody will ever convince my that the style of structureless, start-at-the-top, run-to-the-bottom monolithic PHP pages has any merit at all for real apps. I have seen many projects fail, or slowly mire themselves, by creating these monstrosities, with the opening &lt;html&gt; tag 1200 lines down the file. But I assume these days that&#x27;s not common.
mastaziover 8 years ago
Of the four disadvantages of PHP mentioned in the article, in my opinion, the worst by far is the first, i.e. confusing comparison rules. The article however fails to explain that clearly: the worst thing is not that comparison rules are just confusing (heck, many things are confusing at first, but eventually you work them out); the worst thing is that those rules are intransitive (!!!), as explained very well here: <a href="http:&#x2F;&#x2F;phpsadness.com&#x2F;sad&#x2F;52" rel="nofollow">http:&#x2F;&#x2F;phpsadness.com&#x2F;sad&#x2F;52</a><p>The second disadvantage, passing by reference vs. by value, honestly can or cannot be confusing, depending on which other languages you are accustomed to. So I would say it is a debatable point.<p>The third point, the language being failure-adverse, is a choice made by design, this is also a debatable point, but it&#x27;s in line with the fact that PHP was created as a utilitarian language as Lerdorf explained numerous times, e.g. here <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=anr7DQnMMs0" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=anr7DQnMMs0</a><p>The last point, inconsistencies in the standard library, is obviously true but I would say it is very common in languages that have been around long enough to have subsequent approaches layered in the standard library. Some languages resolve this by making breaking changes and keeping consistency (think Python 2 vs Python 3), some others just show their age by having libraries that were developed at different point in time (Perl, R and Java come to mind), this is also explained by Lerdorf in the video linked above.
leovonlover 8 years ago
The biggest issues I see with the language didn&#x27;t made into this list: for instance, I can think about more serious issues like accessing the wrong variable name does not returning an error, assignment and initialization being the same (thus also suffering the same issues related to wrong names), various surprising type conversions, defaults, and so on. I guess it all boils down to the mindset of the language itself, as the article says.<p>However, I disagree that &quot;other languages do not work like that thus are not as easy to test&quot;. You can implement this in any way you like in any other language. You can implement your webserver by forking a new process at every call. You can even use a worker that communicates to a different hot-swappable process. It can efficient as you want - copying the whole data around, sending file descriptors, etc. The alternatives are endless.<p>PHP may be &quot;interpreted and hot-swappable&quot; by default, but that&#x27;s an accident from it&#x27;s design and it <i>only</i> works like that - if you try to use it as a long-running process, you&#x27;ll run into a lot of issues. It&#x27;s also terribly inefficient - have you ever developed a web interface for an embedded platform? A really embedded one, like 32MB of memory, shared with the application itself?<p>I guess in the end it boils down to the duct tape analogy: it&#x27;s terribly fast to prototype something with duct tape and scraps and you can join a multitude of materials in a very simple way - just put everything in place and cover with enough tape to hold it together.<p>Surely, it works.. but that&#x27;s about it.
dendoryover 8 years ago
I don&#x27;t consider myself a programmer, just someone working in IT that writes a lot of code, and to this day when I want to write any type of web page or web based &quot;app&quot; PHP is my goto tool. I can write my HTML and add PHP logic directly inline whenever I need it, and get the job done in no time. Sure I could spin up a node.js framework, use routing, create classes and objects, etc.. But to 99% of my needs it&#x27;s just not worth the extra time.
bpicoloover 8 years ago
Really, the worst part of PHP in my experience has been the debugging facilities. Print-line debugging just doesn&#x27;t cut it anymore, and things like xdebug and phpdbg just aren&#x27;t elegant, are hard to configure properly, and don&#x27;t work for all the relevant scenarios (trying to debug PHP running in a docker container is not a fun task).<p>The quality of open-source libraries in the ecosystem is also pretty below what I&#x27;ve come to expect from other languages, and then half of them are c-lang PHP hybrids that are more difficult to manage, update, and install.<p>I think the author failed to mention the downsides of no long-running processes either. Shelling out to e.g. memcached for configuration setup (especially when memcached might not live locally) isn&#x27;t particularly fun. Not to mention this has made it difficult to integrate into some useful things, like GRPC[<a href="http:&#x2F;&#x2F;www.grpc.io&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.grpc.io&#x2F;</a>] which can&#x27;t use PHP as a server as of yet.<p>Then there are all sorts of random deployment gotchas, like proper opcache configuration.<p>PHP is a pretty wart-filled language. It&#x27;s usable, but I wouldn&#x27;t make it my first choice in any situation, given a choice.
评论 #12704650 未加载
boulosover 8 years ago
I also liked Keith&#x27;s previous version of this, given at Strangeloop a few years ago [0] and discussed here [1]<p>[0] <a href="https:&#x2F;&#x2F;www.infoq.com&#x2F;presentations&#x2F;php-history" rel="nofollow">https:&#x2F;&#x2F;www.infoq.com&#x2F;presentations&#x2F;php-history</a> [1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7054294" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7054294</a>
sigi45over 8 years ago
Wrote Java code for few years and was writing php code the last 2,8 years.<p>While it doesn&#x27;t matter that much at the end of the day, php is slow compared to java. A language which has so much hidden potential performance (from 5.6 to 7) can&#x27;t be that good.<p>Also a lot of stuff i was used to in java is now also how php developer write code but with a language which doesn&#x27;t support it properly. Annotations for example.<p>The worst thing was the type annotations in comments. Why do you write type annotations in your php comments? Because otherwise your ide can&#x27;t protect you from those errors. and it doesn&#x27;t provide you with proper code completion.<p>When you use tomcat and basic servlets or spring, you can write code quick and easy without any problems. Not sure why you wanna would use php.<p>Tooling is much better (IDE support, Profiler support) and Debugging is much better (simple to connect, can drop frames) and yes java has hot code replacement.<p>I can change the code while i&#x27;m debugging it and than drop the frame and test it again without reloading anything.<p>And at the end of the day you do know a language which you can use for android, server, games, desktop clients and it is cross platform out of the box.
otto_ortegaover 8 years ago
What I find interesting about all this debates about programming languages is that most of the time people fail to remember that they are just that &quot;languages&quot;... Each one has its strong points and flawns, at the end of the day what truly matters is how competent you are at expresing on them and carrying out your goals.<p>For decades people have been complaining about Php, and how afwul it is, yet still, for decades successful projects have raised (and still do) having Php as its core, just today there 2 posts on the front-page about big companies (Slack, Dailymotion) talking about their Php codebase...<p>The argument that due the huge volume of programmers using it, it is &quot;bound to&quot; return a few success cases here and there is BS... if that were true we would be flooded about news about how X and Y company succeed &quot;thanks to&quot; using Python, Java or whatever language you deem as &quot;superior&quot;, but that doesn&#x27;t happen... because companies don&#x27;t suceed &quot;in spite of&quot; Php, they suceed &quot;with&quot; Php, in the same way companies don&#x27;t suceed &quot;thanks to&quot; X or Y language but &quot;with&quot; them.<p>When people set to built a piece of sotware they don&#x27;t have in mind &quot;I wan&#x27;t to build the most technically perfect code base&quot; or &quot;I want to build the fastest piece of software&quot; because nobody writes software for the sake of it, everyone has a goal... they want to build &quot;a messaging app for teams&quot; or a &quot;video-sharing website&quot; and the best programming language for that, is whichever enables them to do so on the way they need it, with the resources they have, and within the timeframe they set.<p>And rant as much as you wish, but Php remains king about doing exactly that &quot;enabling people&quot;.
ww520over 8 years ago
I&#x27;ve looked at some of the new PHP feature and was quite impressed. There are trait, multi-value return, pattern matching, and destructure.
ohthehugemanateover 8 years ago
Most of the hate for PHP comes from the PHP4 days, when it really was a wild west, fast and dirty kind of language. And of course, wordpress has done a lot of reputational damage as the world&#x27;s most popular plate of spaghetti code.<p>But look at the way modern php developers work, in PHP7 with frameworks like Laravel, Symfony, and even Drupal 8. Modern PHP is a pleasure to work with.
LyalinDotComover 8 years ago
Many amazing products have been built with PHP, Python, .NET, Node.js, etc. etc.<p>The reality is these (above) and many other good languages&#x2F;frameworks exist out there for building web apps today. we live in the time with a ton of choice, and the rest is in our hands.<p>I for one love the new .NET Core, but I am a little biased being a long-time .NET developer and a Microsoft employee as of late.
Cymenover 8 years ago
A lot of projects do a rewrite from PHP to Ruby on Rails or some equivalent migration. What the project really needs is a rewrite&#x2F;refactor&#x2F;cleanup however it&#x27;s much easier to frame that in the context of going to a &quot;better&quot; choice than it is explaining it just needs a rewrite with better practices&#x2F;engineers (ie maybe more and easier tests or using the prior prior&#x2F;current architectural lessons to create a better architecture). The reality is one could just rewrite it in the original language&#x2F;stack but that is apparently harder to sell even though it&#x27;s less risky.<p>So if the first language&#x2F;stack is less respected, it makes it easier to sell that rewrite to non-technical&#x2F;management. Thus PHP is a great choice for the first stack.<p>The one huge trap here is if the second team isn&#x27;t experienced enough in the holy grail (next) stack. I&#x27;ve seen that and been relieved to walk away from those projects&#x2F;companies.
greggmanover 8 years ago
I didn&#x27;t understand some of the mentioned benefits of PHP.<p>Progressively adding types:<p>This isn&#x27;t PHP it&#x27;s hack. How is this different than typescript or flow?<p>Edit&#x2F;refresh vs edit&#x2F;restart server.<p>It seems like it&#x27;s been several years that there have been things like meteor or webpack that make iteration super fast on JavaScript. Is that iteration slower than PHP?
sparrishover 8 years ago
The author incorrectly states PHP stands for &quot;Personal Home Page&quot;. It changed in 1997 with the release of 3.0 when the project changed from being called &quot;PHP&#x2F;FI&quot; to just &quot;PHP&quot;, a recursive acronym - &quot;PHP: Hypertext Preprocessor&quot;.
jkapturover 8 years ago
&gt; Hack provides an option that no other popular member of the MPDPL family has: the ability to introduce a type system after initial development, and only in the parts of the system where the value exceeds the cost.<p>JavaScript and Python both have systems that allow you to do this: JavaScript has the Google Closure Compiler, and, more recently, TypeScript. Python has a number of projects that use a common syntax [1], including PyChecker.<p>I say this not to &quot;well, actually&quot; the post, but just to be a gradual typing cheerleader. It&#x27;s great! We should all be using it! All the time! Please!<p>[1] <a href="https:&#x2F;&#x2F;www.python.org&#x2F;dev&#x2F;peps&#x2F;pep-0484&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.python.org&#x2F;dev&#x2F;peps&#x2F;pep-0484&#x2F;</a>.
hawkiceover 8 years ago
The shared-nothing model works great... if either you&#x27;re just one developer or you&#x27;ve got a semi-competent Ops&#x2F;DevOps setup. My first job out of college used PHP with one of the Rails-a-likes PHP has. During our user onboarding process, we&#x27;d poll the server to see if a data import finished, but since the requests shared _nothing_ and the Ops guy didn&#x27;t understand PHP, it would load&#x2F;run millions of lines of framework code for every single tiny polling request. On launch our site crashed because two people used it at the same time. Bananas.<p>There&#x27;s a way to make Apache fork after some code has already been run, but boy howdy if you don&#x27;t do that and love those mega-frameworks.
评论 #12704298 未加载
philippzover 8 years ago
We are using PHP7 at stomt. We decided to use PHP for several reasons.<p>- First of, it is the language i have the most experience with. It would have been stupid to start with some new fancy stuff that would postpone our MVP or getting market&#x2F;idea&#x2F;product validation.<p>Apart from that...<p>- PHP allows you to write good code, it just does not force you to do it. Means if i need to prototype something really fast i can do so. At stomt we are really focused on writing SOLID code.<p>- PHP evolves great and became really fast in the last years.<p>- Economically it is cheaper to find PHP developers than developers in most other languages. And if you have a nice and clean software architecture in place, it is easy to also get more unexperienced developers to write good code.
icedchaiover 8 years ago
I do Java and python for my day job, but do quite a bit of PHP on the side (small consulting projects, etc.)<p>The main advantages of PHP are ease of deployment (no build required, just upload your files and go, use a shared web hosting or a cheap VPS) and a fast dev cycle (edit&#x2F;refresh the page.) It&#x27;s also simple to work with for web designers who don&#x27;t have a lot of back-end knowledge. They can edit your templates and see results instantly.<p>For anything with complex business logic, background processing, etc. it&#x27;s absolutely the wrong choice. However, for basic web apps, when combined with a good framework (such as Laravel), it is fast and productive.
OhHeyItsEover 8 years ago
Much of this is valid in spirit. But to me, is irrelevant with the advent of Node. Node does all the good things the author describes. It does some terrible things too, but generally does them much less terribly than PHP.
评论 #12704655 未加载
phreackover 8 years ago
Well this is seriously making me rethink my opinion on the PHP workflow, if Hack is as much of a game changer as the article claims? Could anyone here comment on their experiences with it, and its pitfalls?
评论 #12704247 未加载
评论 #12704107 未加载
评论 #12704347 未加载
lol768over 8 years ago
Does anyone know how the types in PHP7 compare to what&#x27;s offered by Hack?<p>It looks like generics aren&#x27;t yet in the core language (<a href="https:&#x2F;&#x2F;wiki.php.net&#x2F;rfc&#x2F;generics" rel="nofollow">https:&#x2F;&#x2F;wiki.php.net&#x2F;rfc&#x2F;generics</a>), but I believe return type hints work. I think we&#x27;re also still missing property&#x2F;field type hints (<a href="https:&#x2F;&#x2F;wiki.php.net&#x2F;rfc&#x2F;property_type_hints" rel="nofollow">https:&#x2F;&#x2F;wiki.php.net&#x2F;rfc&#x2F;property_type_hints</a>).
评论 #12705255 未加载
评论 #12704482 未加载
jwmozover 8 years ago
Having come from years of PHP development and then into Python the past year or two, there&#x27;s no way I&#x27;m going back to PHP. This is the same as every other ex PHP dev I know.
gravypodover 8 years ago
Every programming language is a tool. As such it isn&#x27;t good if used for the wrong job. PHP is amazing for simple services that don&#x27;t need much aside from database&#x2F;filesystem access. I love PDO and wish more languages had such a first-class database access implementation.<p>I wish more people gave PHP a chance and didn&#x27;t just keep bagging on it. There are problems with the standard libs, but nothing that isn&#x27;t bearable. Grab an IDE and it&#x27;s not an issue.
mi100haelover 8 years ago
&gt; Hack provides an option that no other popular member of the MPDPL family has: the ability to introduce a type system after initial development, and only in the parts of the system where the value exceeds the cost.<p>Python now has type hints that allow a similar migration for existing code.<p><a href="https:&#x2F;&#x2F;docs.python.org&#x2F;3&#x2F;library&#x2F;typing.html" rel="nofollow">https:&#x2F;&#x2F;docs.python.org&#x2F;3&#x2F;library&#x2F;typing.html</a>
Tehnixover 8 years ago
&gt;Asynchronously curl’ing to localhost (or even another web server) provides a shared-nothing, copy-in&#x2F;copy-out way of exploiting parallelism<p>Wait, wait, wait, wait. Is he saying that to do async work he&#x27;ll send a curl request to somewhere (spawning a thread for that request), not wait on the output and carry on? Last I used curl in php it was a synchronous action. Hell of a threading model there.
评论 #12707904 未加载
yahyaheeeover 8 years ago
This is nonsense. As someone who has had to work in PHP environments that were a mess, just write Python or Go they are worlds better
评论 #12713018 未加载
anindhaover 8 years ago
Doesn&#x27;t Slack use Java for its messaging system?<p>That&#x27;s not mentioned in the blog why they didn&#x27;t use PHP for this.
评论 #12704556 未加载
FranOntanayaover 8 years ago
One of the things to appreciate about PHP&#x27;s ecosystem is how much you can be exposed to warnings, criticisms and cautionary tales. There&#x27;s so much energy put into tearing it apart that if you aren&#x27;t getting an education about coding pitfalls it&#x27;s really your own fault.
3chelonover 8 years ago
Freaky coincidence. Today I just happened to <i></i>twice<i></i> edit some PHP, for two separate tasks... but it&#x27;s the first time I&#x27;ve touched PHP for about 10 years!<p>What goes around comes around. I&#x27;m editing my LinkedIn and dusting off the old O&#x27;Reillys...
shafiulover 8 years ago
Language matters too less, What matters is how it is being used. A Java project may be meanly architected, while PHP code may be architected with good quality. Its is the quality of architecture and code what makes projects sustainable(i.e technically).
marcosdumayover 8 years ago
Sorry, but I&#x27;d rather take opinions on web environments from somebody that at least knows that nearly all web frameworks, on any language that you choose have those properties of no shared state, independently parallel request based execution.
OOPManover 8 years ago
Ahhhhh, PHP.<p>Never again.<p>Life&#x27;s too short to waste on that junk.
scurvyover 8 years ago
Opcache still crashes and burns under high concurrency in 5.6 and 7. No thanks. It&#x27;s been an issue for 2 years now and still not fixed.<p>Running a 2 year old framework on the Internet because the new versions include a non functional opcode cache kinda sucks.
bluetwoover 8 years ago
I just want to use whatever tools we will be using in 5 years. While the underlying technologies of css, html, and javascript have gotten cleaner, powerful, and more cross-compatible, everything that sits on top seems to have gotten bloated.
teiloover 8 years ago
I would add one other big negative in the language design: The automatic import of the entire SPL.<p>Back when I was a green web programmer, I loved this feature. After working with Python for a good many years, I now abhor it.
bostonvaulter2over 8 years ago
I agree with the overall sentiments of the article but I don&#x27;t know if I agree with the conclusions. One thing I don&#x27;t see mentioned is the lack and overall lower quality of many php libraries.
ohstopituover 8 years ago
Taking from the article..<p>&gt; I claim that PHP’s simpler “think; edit; reload the page” cycle makes developers more productive.<p>Would you not use file watchers to reload the server? (especially in Node?)
jonthepirateover 8 years ago
PHP engineer of 10 years here - all things being equal, I cannot, in good faith, recommend a person use PHP for anything. General rule of thumb is, if you can, use Python. We still see folks actively choosing it though.. mostly because it&#x27;s a language we already know and better to create an MVP in something folks know rather than struggle with something &quot;better&quot; that will take a person 5x longer to write while they learn it.<p>I would bet a donut that Slack is off PHP within 2 years.
marcusbrownover 8 years ago
What I think most people are missing about PHP is the incredible ecosystem that emerged in the recent years (especially with Laravel) that helped to speed up the development of web apps by A LOT and removed all the annoying boilerplate.<p>I know that nowadays there are a lot of fancier languages to write your next project, but I challenge anyone to find anyone that has a similar ecosystem that can do all the following things with just a matter of editing config files basically.<p>- Create a fully working app with authentication, database migrations, security checks, middlewares, route management, and much more with just one command line (&quot;laravel new project_name&quot;) (Laravel)<p>- Logging in a user with an external service with one line of code. (Laravel Socialite)<p>- Sending real time notification with any type of channel. (email, socketio, sms, ios&#x2F;android, ...) (Laravel Echo)<p>- Create a complete Oauth2 server with all the backend and frontend parts with just one configuration file. (Laravel Passport)<p>- Make text search with Elasticsearch using external services as easy as making a normal query to the local DB. (Laravel Scout)<p>- Super easy tu use payment system integration that handles both one time payments and subscriptions with Stipe and Braintree. (Laravel Cashier)<p>- Optimized and lightweight version of the full framework to get blazing fast APIs. (Laravel Lumen)<p>- Local web server that automatically creates .dev domains for each project and that works with most PHP projects (not just Laravel) (Laravel Valet)<p>- Vagrant box with everything you need for a local development web server. (Laravel Homestead)<p>- Easy frontend assets management (compiling, versioning, ...) built on top of Gulp and Webpack. (Laravel Elixir)<p>- Provision a web server with all the things you need (security, git push-to-deploy, ssl certificates, queue workers, ...) properly set up with one simple click. (Laravel Forge^)<p>- Zero downtime deployment with history backup and much more. (Laravel Envoyer^)<p>- Fully working SaaS app that handles all the boring stuff (subscriptions, invoicing, team management, emails, ...) and let you concentrate on the actually product you want to built. (Laravel Spark^)<p>- Tons of video tutorials&#x2F;screencasts&#x2F;lessons on how to use every aspect of Laravel and much more (PHP, Vuejs, Text editors, ...) (Laracasts)<p>As you can see from the list, almost everything is related to the incredibly good framework Laravel, that I highly recommend to anyone that is working or will work with PHP.<p>I especially recommend to all those people that are about to create their next SaaS project to take a look at Laravel Spark. It really puts all the pieces of the puzzle together and it makes your MVP really around the corner instead of months away.<p>Coming from old-school PHP where I hacked everything together, after learning and switching to Laravel my life as a developer completely changed and now I can&#x27;t imagine that I&#x27;m still using the same language actually. They feel like two completely different things and in my opinion all those people that are talking bad about PHP, they are stuck with old memories of how PHP used to be. Yes, PHP as a language still has a lot of things that needs improving, but PHP as ecosystem of libraries and frameworks is definitely still the king of the web!<p>The King is dead, long live the King! :)<p>[^]: These are commercial products but their price is definitely accessible (99$ for Spark and 10$&#x2F;month for Forge and Envoyer)
评论 #12709454 未加载
mrmagooeyover 8 years ago
I&#x27;m surprised no one has posted this fairly thorough criticism of PHP from a few years ago <a href="https:&#x2F;&#x2F;eev.ee&#x2F;blog&#x2F;2012&#x2F;04&#x2F;09&#x2F;php-a-fractal-of-bad-design&#x2F;" rel="nofollow">https:&#x2F;&#x2F;eev.ee&#x2F;blog&#x2F;2012&#x2F;04&#x2F;09&#x2F;php-a-fractal-of-bad-design&#x2F;</a>
评论 #12705724 未加载
评论 #12705193 未加载
评论 #12705077 未加载
EGregover 8 years ago
PHP would have been better if it supported evented programming.
评论 #12706284 未加载
george_ciobanuover 8 years ago
Great projects exist in every language from COBOL to Lisp.
yegortimoshenkoover 8 years ago
Totally. PHP is a great technology and a bad language.
justinlardinoisover 8 years ago
PHP was the first programming language I ever used, so it holds a special place in my heart. And I use it daily at my current job.<p>I have to disagree with this article. PHP is a heavily flawed language. It&#x27;s very easy to get started with PHP, but there are too many pitfalls that are too easy to fall into.<p>Most of the &quot;Virtues of PHP&quot; are available in other web languages if you use the right framework. And if you use those languages you&#x27;ll benefit from the consistency and predictability that come from having a clear design philosophy from the start.<p>I don&#x27;t think PHP is a <i>bad</i> language. It&#x27;s possible to write good software in PHP, and it&#x27;s possible to work around the flaws if you really know what you&#x27;re doing. If your software is already written in PHP, it&#x27;s probably not worth it to throw it out and rebuild it in something else. But I don&#x27;t think it&#x27;s worth the trouble if you have a choice, and I think writing new software in PHP should be avoided.<p>I&#x27;ll admit I&#x27;m not familiar with HHVM and Hack. Maybe they alleviate PHP&#x27;s problems.<p>P.S. Most of the points under &quot;The Case Against PHP&quot; are also issues with Javascript. But the difference is that if you&#x27;re developing a web application, you have to use Javascript. <i>You don&#x27;t have to use PHP.</i>
评论 #12704029 未加载
knownover 8 years ago
Where does PHP stand in mobile platforms?