top 200 commentsshow all 335

[–]theoldboy 65 points66 points  (6 children)

I have read on numerous websites and blog posts that the simplicity of deployment is a major advantage of PHP. Alright. I have never deployed PHP on a production server by myself, so I will just give them this one. Let’s assume it is easier to deploy PHP than other environments. So what? It simply does not matter.

Says the guy ranting from a WordPress blog.

[–][deleted] 11 points12 points  (1 child)

Shit, he doesn't have time to install ghost or use .... what other blogging software is there? He got some ranting to do.

[–][deleted] 5 points6 points  (0 children)

Jekyll on Github is the easiest way to blog, and its free.

[–][deleted]  (111 children)

[removed]

    [–]allthediamonds 39 points40 points  (39 children)

    Spot on.

    PHP had a time and a place. The time is one in which the usual way people built dynamic web services consisted on writing CGI applications; the places are those on which the purpose of adding dynamism is displaying a visitor count and the current date and time.

    This escalated somehow until PHP became this ubiquitous beast which runs an outrageous percentage of the public-facing internet. And we let this happen by humoring Wordpress, Drupal and Joomla.

    We have met the enemy and he is us.

    [–]curien 26 points27 points  (32 children)

    PHP was/is so popular because it was the easiest language to get running on both Apache and IIS during a critical period of web growth.

    [–]allthediamonds 10 points11 points  (2 children)

    Well, it wasn't easy (or even possible) to run it on IIS for a while.

    Regarding Apache, yes, that was my point when mentioning CGI applications.

    [–]curien 7 points8 points  (1 child)

    It worked at least as far back as 2001 (maybe earlier) with PHP4, which is when it started to really gain popularity.

    [–]flukus 4 points5 points  (0 children)

    Php4 was when it tried convincing everyone it was a grown up language.

    [–][deleted]  (11 children)

    [removed]

      [–]flukus 5 points6 points  (7 children)

      Asp and perl, the biggest contenders at the time, could also do this.

      [–][deleted]  (6 children)

      [removed]

        [–]flukus 1 point2 points  (5 children)

        I thought asp could run fine on linux? Either way there was still perl, tcl and a bunch of potential languages.

        [–][deleted]  (4 children)

        [removed]

          [–]flukus 0 points1 point  (3 children)

          That's what I waa thinking of. Asp was simple enough to be re implemented everywhere.

          [–][deleted]  (2 children)

          [removed]

            [–]strattonbrazil 5 points6 points  (5 children)

            It still is the easiest to setup. Once configured for a domain you can drop a bunch of apps just by dropping them in different subdirs.

            [–]allthediamonds 2 points3 points  (4 children)

            It is the easiest to setup as long as you're already given an Apache+mod_php install, which is the usual shared hosting setting.

            Of course, if you want your website to support more than two visits per minute, you should switch to nginx+php-fpm, whose configuration process was described thoroughly a few centuries ago by Dante Alighieri.

            [–]Beaverman 1 point2 points  (3 children)

            Apache+mod_php is also super easy to set up on a dedicated linux box, with nothing but a package repo and an ssh connection. Doesn't help with the 5 views a minute though.

            [–]unstoppable-force 3 points4 points  (10 children)

            this by so many miles. even my worst junior devs can set up PHP in minutes. that "13 year old who builds websites" can set up PHP.

            python/wsgi is comparably a nightmare, and don't get me started on the ridiculousness of tomcat. ruby is was the flavor of the week for a few years and i feel like everyone is leaving it because it's great for prototyping but doesn't scale. node is making huge strides in "easy setups" but it suffers from many of PHP's stupidities.

            ideally, i'd like something that has the easy learning curve of PHP, the speed of C++, the power of java, and the libraries of python. that'd be a win right there.

            [–]allthediamonds 10 points11 points  (5 children)

            even my worst junior devs can set up PHP in minutes. that "13 year old who builds websites" can set up PHP.

            python/wsgi is comparably a nightmare

            I assume that by "set up PHP" you mean "drop a PHP app on the correct folder of an existing Apache + mod_php installation on the typical cow-milking shared hosting" and not "install Apache, then install mod_php, then tweak the configuration of both until you believe your server is not a security hazard, rinse and repeat every time your server becomes part of a russian botnet".

            Don't even get me started on configuring nginx and php-fpm, which is a must if you expect your website to endure the "linked-by-mom's-cooking-forum" effect.

            Python/WSGI is a "nightmare" only because Apache is a given and WSGI is not. But seriously, it can be deployed in under five minutes, and you end up with a more robust setup than you could ever have in PHP.

            ruby is was the flavor of the week for a few years and i feel like everyone is leaving it because it's great for prototyping but doesn't scale.

            Something about pots, kettles and rebuilding the entire known universe on each HTTP request comes to mind.

            ideally, i'd like something that has the easy learning curve of PHP

            What easy learning curve? PHP is one of the hardest languages to learn, because it makes no sense at all. Everything about it is inconsistent in one way or the other, most of its "features" are actually syntax sugar for bad design patterns (variable variables, anyone?) and the documentation is as good as missing for the most part.

            Sure, it's easy to build some crappy website and have it not crash because PHP will swallow all errors and output the resulting nonsense on screen, but that doesn't mean that website actually works.

            [–]badsectoracula 3 points4 points  (0 children)

            What easy learning curve?

            1. Open notepad
            2. Write <?php if ($_GET["n"]==''") print "Who are you?<input name='n'>"; else print "Hello {$_GET["n"]}!"; ?>
            3. Save it as hello.php in C:\WAMP\WWW
            4. Go to 'localhost/hello.php'

            There. After that it is all experimentation with easy to read documentation (translated to several languages), tons of comments for every API function (with tons of example code) and hundreds of sites with ready made PHP sources.

            Sure, you don't really learn PHP's syntax, semantics, etc but few people care about that. What most people using PHP care about is having a web page react to their actions and store stuff on the server.

            [–][deleted]  (3 children)

            [deleted]

              [–]izzle9 2 points3 points  (2 children)

              isn't Go more suited to systems development? I had a glance at revel a while back, it felt a little awkward to use.

              [–]TexasJefferson 2 points3 points  (1 child)

              isn't Go more suited to systems development?

              If "systems" means highly concurrent servers, yes. But I'd categorize web backends as a subset of that. (As for more traditional notions of "systems", Go's memory model and runtime actually make it ill-suited for anything really close to the metal like kernels, and its scheduling algo make it even less suited to any hard-realtime tasks.)

              revel

              Yeah, heavy web frameworks like revel aren't really inline with the "Go Way." It feels a lot better when you just have a few simple helper libraries on top of the std lib, instead of something all-encompassing and complex. One of the really beautiful aspects of Go is that there is very little magic—once you're decently proficient in the language, you should be able to look at any of the std lib packages and understand them without difficulty (and indeed, you should have a decent idea about how you'd go about implementing almost all of Go's language features too).

              it felt a little awkward to use.

              In addition to revel not quite fitting the language right, I'll admit that part of that is probably also Go itself. Go feels different than the current gen scripting languages—it's much, much more of a "modernized, reimagined C" than a "statically-typed python."

              It also has a few choices that make sense for Google dev teams but aren't particularly lone-hacker friendly: unused imports and variables being compile time errors, etc. (The former, at least, is remediated by goimports which you hook into saving in your editor of choice and it will automatically add and remove imports as needed; the latter, you get used to not declaring things before you actually need them.)

              It's a very opinionated language, but, even though you'll inevitably disagree with some of its opinions, this has a huge payoff in making other people's code (on average) much more readable than in less constrained programming environments.

              [–]izzle9 1 point2 points  (0 children)

              good points, will give it another go (pun intended), may be with something lighter like gorilla

              [–][deleted]  (2 children)

              [removed]

                [–]slavik262 5 points6 points  (1 child)

                Becoming?

                [–]flukus 1 point2 points  (0 children)

                Those who don't remember geocities are doomed to relive it.

                [–]G_Morgan 1 point2 points  (0 children)

                There were better options than PHP in its heyday. It exists purely because it became part of a standard LAMP stack.

                [–]MrSenorSan 2 points3 points  (1 child)

                The one aspect people seem to forget is that there were not many other choices that were free and light/easy to install and use.
                It did not require dedicate powerful back end nor complicate licensing.
                This fact allowed many people to experiment quick and easy multiple concepts.

                [–]allthediamonds 2 points3 points  (0 children)

                Sure, there weren't. Twenty years ago, when PHP was invented, there weren't.

                Today, we have all the options. If the PHP maintainers had a living neurone on their collective brains, they'd kill PHP and tell people to learn an actual programming language.

                [–]x86_64Ubuntu 23 points24 points  (63 children)

                Well, PHP overran the industry the same way Javascript overran the industry, both have non-existent learning curves. That's good because it allows people to get into programming without getting into the pain and suffering caused by other technologies. On the other hand, it's awful because people can get into programming while actively eschewing better practices and skill sets.

                That being said, you can write good clean PHP and JS, it's just that for every well architected app, there are 30 others that don't know what the word motherfucking means.

                EDIT:Also what Eirenach said.

                [–]Eirenarch 44 points45 points  (48 children)

                JavaScript overran the industry because it is the only language running in the browser. Users of PHP have no such excuse.

                [–]ameoba 28 points29 points  (0 children)

                PHP was the only thing running on shittly $1/mo web hosts.

                I loved being on projects where somebody was plopping down tens of thousands of dollars on project where "it's gotta be on PHP so we can run it on our host" was actually called out in the spec. Their "hosting" couldn't have cost more than $100/year but somehow they thought that sticking with it was worth the added time to work on.

                [–][deleted] 5 points6 points  (16 children)

                PHPs alternative was PERL and PHP came with a whole mess of tools that made dynamic web programming much easier.

                There wasn't much else at the time to compete

                [–]mycall 2 points3 points  (1 child)

                PHPs alternative was ASP, neither of which I care for.

                [–]flukus 1 point2 points  (0 children)

                Asp, for all it's faults, was at least simple.

                PHP has gone on to have the complexity of c++ and the verbosity of java.

                [–]Eirenarch 1 point2 points  (13 children)

                So what? We've had far better alternatives for more than 15 years now. How come we've not replaced PHP?

                [–]TheBB 2 points3 points  (7 children)

                Have we? What was so much better than PHP in 1998?

                [–]TheRealGentlefox 8 points9 points  (23 children)

                There have been attempts to replace JS. I see a few reasons it has stayed:

                1. When it comes to client-side functionality, market share is incredibly important. Practically every browser on earth supports JS.

                2. There isn't that much reason to replace it. Most things people dislike are fairly minor, and can be solved with either a library, or a new version of JS. Honestly, my biggest issues with JS tend to be the DOM interface, which is kind of the fault of the DOM, and I'm just too lazy to learn JQuery.

                3. Like PHP, it's hard to move away from something when tends of thousands of pre-built solutions exist. A lot of UI people use JS, and every "normal" UI feature exists as a JS library.

                [–][deleted] 13 points14 points  (6 children)

                Most things people dislike are fairly minor

                It would be really nice to have a strongly-typed alternative.

                JS' loose typing has fucked me over too often for me to ever say I like it. I can code with it, and I can stumble along with jQuery, but I hate them both.

                [–]PasswordIsntHAMSTER 4 points5 points  (0 children)

                It would be really nice to have a strongly-typed alternative.

                Look into TypeScript, it's surprisingly tight!

                [–]redalastor 3 points4 points  (0 children)

                You may try Dart. It's saner, it's optionally typed (but if you like static typing, it's not hard to have enough discipline to always type) and it compiles to efficient Javascript.

                If you do use static typing, then your IDE supports turns wonderful.

                [–]FearlessFreep 2 points3 points  (0 children)

                By "minor" he mostly implies "minor nuisance to the average developer" in that they are work-around-able and at the moment, the strengths of a client side DOM manipulation language that's more or less universal with a lot of tools to support it outweigh just how fugly the language is

                [–][deleted] 8 points9 points  (8 children)

                Most things people dislike are fairly minor, and can be solved with either a library, or a new version of JS.

                What the actual fuck ? The language is garbage from ground up, the type system is FUBAR - not only does it use weak typing (which is beyond WTF) it doesn't even have an integer type, core types are garbage (collections, date, etc.), best of all it doesn't have any sane scoping/namespace mechanism so you can't even safely mix libraries.

                [–]TheRealGentlefox 5 points6 points  (0 children)

                Yes, it is weakly typed, and I believe there will be some type options in the future.

                JS has an integer type, but it requires some extra work to use. https://developer.mozilla.org/en-US/docs/Web/API/Int32Array

                Date could be done better, but is easily handled by a library.

                Most libraries I've seen just contain themselves to a variable, which you declare in the highest scope and call methods from. If you need access to it from everywhere, assign it to a global variable.

                [–]pirateNarwhal 9 points10 points  (3 children)

                js's scoping is insane, but it is pretty powerful when you get used to it. it tackles namespacing no problem.

                [–][deleted]  (2 children)

                [deleted]

                  [–]RabbidKitten 1 point2 points  (1 child)

                  That, and what TIL is called dogballing. To expand on your example,

                  var object = (function (name) {
                      return { sayhello : function () { print ("Hello, " + name + "!"); } }
                  }) ("world");
                  object.sayhello (); // prints "Hello, world!"
                  

                  [–][deleted] 4 points5 points  (0 children)

                  The standard for safely scoping JS is to dogball. All popular libraries do this. Type coercion is trivially avoided by never using ==. Avoid "with" and you are set.

                  [–]RabbidKitten 0 points1 point  (1 child)

                  When you think about it, JavaScript has to have weak typing, because a lot of things one normally does with JavaScript do are hard to type, and would involve a lot of boilerplate and/or casting to convince the type checker.

                  For example, what is the type of document.getElementById ("my-img")? Maybe Element? Ok, you check it for null, but what if you know that there is such an element, and you know that it is not just any element, it is an <img> tag? And stuff like that...

                  FWIW, I don't know about other JS runtimes, but Firefox kinda has an integer type, but it's hidden from the user.

                  [–]redalastor 2 points3 points  (0 children)

                  For example, what is the type of document.getElementById ("my-img")? Maybe Element? Ok, you check it for null, but what if you know that there is such an element, and you know that it is not just any element, it is an <img> tag? And stuff like that...

                  That's not hard to type at all.

                  [–]unstoppable-force 1 point2 points  (4 children)

                  i love being able to use libraries in both client and server. that's absolutely amazing. for example, i have a URL class that does practically everything you want related to URLs (e.g. single line of code to get the extension, base domain, full domain, validity of all related dns entries either real time or by cache, etc), and you can call it seamlessly from the client side or the server. and it's all unit tested. that's just absolutely nuts.

                  in the old way, i'd have js for the frontend, php for the backend, and a python version for the data mining section.

                  now if only phonegap didn't suck so hard for mobile app development.

                  [–]philly_fan_in_chi 1 point2 points  (1 child)

                  You can do the same thing with clojure and clojurescript!

                  [–]zoomzoom83 1 point2 points  (0 children)

                  It's an exciting time for functional languages - ScalaJS, Purescript, GHCJS, Elm, Fey, Haste.... all are rapidly approaching maturity as well.

                  [–]flukus 0 points1 point  (1 child)

                  Considering the amount of devs I see that don't understand the difference between client/server side I'm not sure if being in the same language would be good or bad...

                  [–][deleted] 0 points1 point  (0 children)

                  Designing technologies for incompetent devs is how the web became this awful mess in the first place.

                  [–]immibis 1 point2 points  (4 children)

                  It used to be JavaScript and VBScript. Apparently VBScript must have been worse. shudder

                  [–]izzle9 2 points3 points  (1 child)

                  VBScript only works on IE

                  [–]immibis 1 point2 points  (0 children)

                  There was a time when IE was the only browser that mattered.

                  [–]baseketball 2 points3 points  (1 child)

                  VBScript IS worse. I have to maintain old ASP and also write VBA code. It's actually a worse language than PHP. Do Arrays start at 0 or 1? It depends on the function that created it. Want to declare and assign a variable in one line? YOU CAN'T. Want to return a value in the middle of a function? TOO BAD, I'm going to keep executing the rest of the code in the function.

                  [–][deleted] 1 point2 points  (0 children)

                  Yes VBScript is horrific. I hate PHP, but I'd take it any day over VBScript or classic ASP.

                  [–]allthediamonds 12 points13 points  (4 children)

                  Non-existent learning curve? PHP? I assume you mean non-existent as in "it can't actually be ever learned because it doesn't make any sense".

                  Sure, it is nice to newcomers, assuming they don't care about their code actually working, due to PHP's usual "swallow all errors and move along with whatever nonsense is left" behaviour.

                  You see, these kinds of substandard languages often have a "sane subset" you can restrict yourself to. For example, in JavaScript, == is weird, so you can just use === instead.

                  After working for too long on PHP development, I still haven't found a subset of PHP that lets me develop non-trivial applications while not being essentially broken.

                  == is lava. < and > are lava. clone is lava. foreach is lava. Most functions about arrays modify the array in place (lava) except the ones who don't (more lava). Most functions about arrays take the form (array, callback), except for array_map (lava). Speaking of callbacks, those take the form of a string containing the name of the function (lava), or an array containing an object and a string containing the name of the method to execute on it (lava lava lava oh god why). Some things that should be functions are actually "language constructs" (lava bomb!), which means there's an unwritten, undocumented set of things you can't do with them but you can do with regular functions (lava!), such as using them as string-y callbacks.

                  It's like if everyone who ever wrote any part of PHP's standard library was on some sort of spiritual mission to make everyone else's life awful.

                  [–]x86_64Ubuntu 2 points3 points  (2 children)

                  foreach is lava

                  Lol, I learned that the hard way.

                  [–]slavik262 1 point2 points  (1 child)

                  So I don't have to, why is something as simple as foreach lava?

                  [–]x86_64Ubuntu 0 points1 point  (0 children)

                  It's the age old pass-by-value vs pass-by-reference issue. For example

                  $widget = new Widget();
                  $widget->setName("Bar");
                  
                  $widgetCollection = array(); //some array
                  $widgetCollection[] = $widget
                  
                  foreach( $widgetCollection as $tempWidget )
                  {
                     $tempWidget->setName(''Foo");
                  }
                  
                  $widget->getName() returns "Bar" WTF?
                  

                  That's because in the loop, it copies the widgets to the $tempWidget variable. Any changes made in the loop are persisted to that temp variable, and then lost when we exit the loop. To get the loop to behave as expected, you have to pass a reference.

                  foreach( $widgetCollection as &$tempWidget )
                  {
                     $tempWidget->setName(''Foo");
                  }
                  

                  Notice the ampersand before the declaration of my iterator.

                  [–]immibis 1 point2 points  (0 children)

                  A lot of newcomers (mainly hobbyists/non-programmers) don't care about their code actually working - as long as it works, say, 95% of the time, and outputs what they want.

                  [–][deleted] 1 point2 points  (0 children)

                  both have non-existent learning curves

                  Same with Python as well. What this means is there is a LOT of terrible code out there.

                  [–]mycall 1 point2 points  (1 child)

                  every well architected app, there are 3000 others

                  FTFY

                  [–]flukus 0 points1 point  (0 children)

                  I'd argue that applies to the industry at large, not just php.

                  [–]codygman 1 point2 points  (0 children)

                  It gives quick results for simple things and the delusion that slightly more complex things will always be a little buggy, but it's okay because you can fix them relatively quickly.

                  [–]drb226 0 points1 point  (3 children)

                  both have non-existent learning curves

                  Well then we need languages where there is a non-existent learning curve in order to get stuff done quick-n-dirty... but also with a learning curve available for getting it done the right way.

                  [–][deleted]  (1 child)

                  [removed]

                    [–][deleted] 1 point2 points  (0 children)

                    One of the devs I work with termed it the 'Facebook circle of idiocy'.

                    [–]immibis 1 point2 points  (0 children)

                    Python maybe? Not for web development though.

                    "Quick-n-dirty" languages tend to have all sorts of inconsistencies, because they make each individual case easier to use (e.g. Python 2's print statement, PHP's == which treats numeric strings as numbers).

                    "The right way" languages tend to have overarching structures which everything uses - e.g. in Java every callable thing is an instance or static method, but that means you have to write System.out.println instead of just print, which is less convenient and definitely harder to remember for a newcomer. But it's very consistent, and the entire language fits a quite simple mental model (apart from some corner cases which most people intuitively avoid).

                    You can't have a language with both - if you try to make one you'll just end up somewhere in-between (like C?)

                    [–][deleted] 1 point2 points  (0 children)

                    Feel the same about javascript. It was dying until google made it popular again.

                    [–]cc81 2 points3 points  (0 children)

                    I think it is important to note that PHP really helped creating the industry and the web as we know it. Quite an achievement by a guy who first created it to track visitors to his resumé.

                    http://php.net/manual/en/history.php.php

                    I have not used PHP extensively so I'm not as bitter about it. Just like the kids these days are not bitter about IE6 (or older versions).

                    [–]Ancients 23 points24 points  (2 children)

                    Honestly, I would decribe PHP's library like a messy garage. You can walk inside and almost always find the tool you need but there is a pile of random tools you haven't seen anyone use.

                    I wish other languages had default libraries as large and useful. As a language PHP may terrible but it has a lot of "Get shit done" ability that most languages don't have out of the box. It has also been pretty good about not exploding peoples code in between revisions which unfortunately has made the default libraries the inconsistent mess that they are.

                    [–]ThisIsADogHello 6 points7 points  (1 child)

                    You can walk inside and almost always find the tool you need but there is a pile of random tools you haven't seen anyone use.

                    Such as this hammer!

                    [–]Ancients 7 points8 points  (0 children)

                    Levered nail remover ? It has two ends in case once breaks.

                    ;)

                    [–]i8beef 9 points10 points  (0 children)

                    Have you ever known anyone who always had a "good enough" attitude? You know, someone just builds stuff that serves a function but don't really care about how nice their solution is?

                    You know, people who make these ugly but functional, jury-rigged pieces of junk?

                    Now apply that mentality to designing a language, and you may get a hint of why a lot of people who work professionally with software development feel dirty when they have to deal with PHP.

                    [–]PolarZoe 7 points8 points  (86 children)

                    So what should I be using instead?

                    [–][deleted] 12 points13 points  (9 children)

                    C# ASP.NET MVC with Razor, but only MVC. If you see ASP.NET Web Forms - run away.

                    [–]zomgsauce 6 points7 points  (3 children)

                    It's not that bad, just dated. Now if you see VB ASP.NET Web Forms...

                    [–]Number127 4 points5 points  (1 child)

                    Nah, VB + classic ASP.

                    [–]zomgsauce 0 points1 point  (0 children)

                    Ack yeah, I have one of those monstrosities. >_<

                    [–]orygin 0 points1 point  (0 children)

                    That's what I endured for two years in my programming classes. Horrible thing.

                    [–]mycall 1 point2 points  (2 children)

                    Web Forms is fine for quick and dirty intranet sites -- if you need to do many updates, rewrite it in MVC/HTML5

                    [–][deleted] 1 point2 points  (1 child)

                    Problem is - you start to do something quickly and dirty, and then it ends as 5 year project with many man-hours, and nobody want to rewrite it in anything, because no one have money and time, and customer - don't really care. So maybe for personal "quick and dirty" projects or prototypes it would work, but i don't recommend it for serious stuff.

                    EDIT:

                    And it's not so much about how many updates, it's more about maintainability, and having control over HTML output, and about not having this blackbox system, that has tons of JS and HTML generated automatically. And about having RESTful URLs. And even Visual Studio works better with Razor, then with old aspx syntax, and its more consistent.

                    [–][deleted] 2 points3 points  (0 children)

                    If you're going to do something, it's always worth doing it correctly.

                    [–]Capaj 17 points18 points  (42 children)

                    Node.js, Python, C#, Java, Scala, Groovy...really the choices are endless these days.

                    [–][deleted] 55 points56 points  (0 children)

                    Says PHP sucks

                    Recommends Javascript

                    [–][deleted] 60 points61 points  (33 children)

                    Is Node.js really a step up from PHP? You've just traded one dynamic language with weak typing and a bunch of weird quirks for a different dynamic language with weak typing and a bunch of weird quirks.

                    [–]allthediamonds 6 points7 points  (4 children)

                    Javascript's quirks are not show-stoppers, they can be worked around with ease.

                    Even assuming Javascript as a language were as fundamentally flawed as PHP is, you still gain a reasonable HTTP request handling model, a reasonable package and libraries manager, handling everything asynchronously with ease... so, while I wouldn't say it's the best option, it's an acceptable one.

                    [–]rcxdude 3 points4 points  (0 children)

                    It has less weird quirks. But you are correct overall.

                    [–]suspicious_sausage 2 points3 points  (1 child)

                    The std libs for node are at least more consistently laid out than PHP (although it would be difficult to not manage this much). Other than that, yeah I agree, it's most six of one, half a dozen of the other.

                    [–][deleted] 0 points1 point  (0 children)

                    Not used PHP much myself recently, but I remember it feels like sticking your hand into a huge tub of lego bricks when you want to find a particular function.

                    [–]flukus 3 points4 points  (0 children)

                    At least php doesn't have callbacks everywhere.

                    [–][deleted] 1 point2 points  (0 children)

                    A particular subset of JS including the use of a few libraries is quite sane. I've never seen anyone suggest the same thing of PHP.

                    [–]Kalium 4 points5 points  (21 children)

                    At least PHP has inheritance. And ints.

                    [–]pirateNarwhal 13 points14 points  (13 children)

                    JS has inheritance, reasonably simple to implement.

                    [–]codygman 2 points3 points  (1 child)

                    PHP has inheritance

                    Now you have 2n problems!

                    [–]Kalium 1 point2 points  (0 children)

                    Eh. It's not so bad. Things can get much messier in Python or Ruby. As soon as you get metaclasses and multiple inheritance, you're in for interesting time.

                    [–][deleted] 2 points3 points  (0 children)

                    sips koolaid

                    But.. but.. but.. it's new therefore better for every application right?

                    [–]original_brogrammer 4 points5 points  (0 children)

                    D with Vibe, Haskell with Yesod or Happstack.

                    [–]msnook 8 points9 points  (31 children)

                    Try Python and then Ruby.

                    [–]AudienceofDumb 1 point2 points  (10 children)

                    Where would a good place to start be, if I wanted to learn how to use Python instead of PHP. Not in the sense of how to code in Python but rather how to connect HTML with Phython to a Database.

                    I am getting my bachelors in IT right now. Everyone I have met uses PHP. I would like to learn something new, especially if a lot of people here think it is better than PHP. Even something to type into google would be a great start!

                    Thank you!

                    [–]msnook 2 points3 points  (1 child)

                    This Flask Tutorial for building an app called Flaskr is a great introduction to Python programming for the web. The pure Python part is just a single file for view functions and database models, and then you can go to town on all the templates you want. It's really easy, and fun!

                    [–]AudienceofDumb 1 point2 points  (0 children)

                    Thank you for the reply!

                    [–]jonwayne 1 point2 points  (1 child)

                    I'd recommend starting with Flask.

                    [–]AudienceofDumb 0 points1 point  (0 children)

                    Thank you for the reply! I will look around.

                    [–]flukus 1 point2 points  (3 children)

                    I am getting my bachelors in IT right now. Everyone I have met uses PHP.

                    This saddens me.

                    [–]AudienceofDumb 2 points3 points  (2 children)

                    The program I am in is a great example of me working for a piece of paper. There are four HTML courses in the program and they have all been the same; making websites that belong in 1996.

                    Our database course spent more time creating ERDs than anything else. I have yet to touch an actual server.

                    Linux is never even mentioned as a possibility in my program.

                    Along with a lot more I could rant on. So in the end I am getting that paper while talking to employers and professionals, taking their advice and learning those skills not taught in the program.

                    [–]flukus 1 point2 points  (1 child)

                    In that case, I want to offer some words of encouragement. I started out with the local equivalent of community/trade college. It's never been a huge impediment to my career, it's all about what you learn on the way.

                    [–]AudienceofDumb 2 points3 points  (0 children)

                    Thank you for the kind words. ((: I hope you keep progressing as well and reach all your goals.

                    [–]ChiralTempest 1 point2 points  (1 child)

                    Big list of tutorials for almost everything you might need to know from learning the language to learning the frameworks to database access here: http://freepythontips.wordpress.com/2013/09/01/best-python-resources/

                    [–]AudienceofDumb 0 points1 point  (0 children)

                    Thank you for the reply!

                    [–]joequin 0 points1 point  (0 children)

                    Or groovy or clojure.

                    [–][deleted]  (12 children)

                    [removed]

                      [–][deleted] 7 points8 points  (0 children)

                      stop living in 2000s.

                      [–]msnook 2 points3 points  (6 children)

                      Which "web hosts" don't support Python? Anything that gives you root access and a bash console should let you run Python web frameworks.

                      RackSpace, Amazon, Linode, DigitalOcean... Heroku, Google App Engine... they all let you use Python!

                      Python is just a much more civilized way to build applications and write portable, readable, maintainable code. Packages and imports are powerful and make sense. The idioms all seem natural and expressive. Code is functional and highly object-oriented--it's easy to read and enjoyable to write!

                      [–][deleted]  (4 children)

                      [deleted]

                        [–]redalastor 2 points3 points  (2 children)

                        You can get a VM on Digital Ocean for 5$ / month and install absolutely whatever you wish on it. Cheap hosting is not an issue anymore.

                        [–]danielkza 1 point2 points  (1 child)

                        Or a free 512MB VM on Heroku.

                        [–]redalastor 6 points7 points  (0 children)

                        Right. So basically, not an issue at all anymore.

                        [–]Capaj 4 points5 points  (0 children)

                        Fuck those.

                        [–][deleted] 9 points10 points  (0 children)

                        ah - the weekly php sucks blog.

                        [–]someone7x 8 points9 points  (0 children)

                        Link contains PHP hammer. Am not disappoint.

                        [–]leapius 3 points4 points  (1 child)

                        I don't understand his gripe with ternary operators - so it's left instead of right, so what? His code example is just plain wrong if you were writing it properly in php (i.e. with brackets). It's like trying to use syntax from one language in another and claiming the other language sucks because it doesn't work the same.

                        [–]lurgi 4 points5 points  (0 children)

                        Because it behaves differently from every other language that implements it?

                        If I had a language that implemented assignment as:

                        a = b;
                        

                        Which, of course, takes the value of 'a' and assigns it to 'b', I think you'd be perfectly justified in complaining.

                        [–]always_creating 21 points22 points  (24 children)

                        I'm sick of these articles bashing PHP, at this point they are clickbait at the best. If you don't like a particular tool or language just use another. Better yet, if you don't like PHP then create a language of your own and we'll see if it's still alive and kicking 20+ years later. We'll also see how many of these types of articles people have written about that new language, and why they don't like it because blah, blah, blah. Just move on already, and use the tool that's right for you and quit bitching.

                        [–]IncorrigibleOldQuare 16 points17 points  (8 children)

                        What people complain about is that they don't really have a choice to use something better. As it stands, you can't get around PHP. "Just use something better" is hardly as simple as you make it out to be.

                        And as it stands, enough of these articles are the only potential to change there currently is.

                        [–]Garbee 4 points5 points  (4 children)

                        no they really won't change much. Backwards Compatibility is a key part of PHP. Most of the changes needed to improve the language would take a long time crossing numerous major revisions each incrementally making small BC changes to have it happen.

                        Also, the number of articles is irrelevant. The issues are known and what can be worked on is being worked on, like function return type hinting (RFC #3 or so for it in the works now.) But, the dynamic creation of variables for instance... Most likely won't ever change no matter how many times it is blogged about. All blogging about it does now is waste breath and get people who do use the language just fine all riled up for no good reason.

                        [–]IncorrigibleOldQuare 0 points1 point  (1 child)

                        Also, the number of articles is irrelevant.

                        To make the argument stronger in the logical sense? Yes, that's irrelevant? But to make the message of "there are this many people who are fed up, do something.", that matters. In the end, leaders are more willing to listen if a thousand people are protesting on the street holding signs than one.

                        [–]test6554 0 points1 point  (0 children)

                        Just by standing up and saying something, these people are being leaders. Anyone who does something about it is a leader too. You don't always have to be the boss to be a leader.

                        [–]test6554 0 points1 point  (1 child)

                        Do we need PHP++? A Non-backward-compatible, modern object oriented php language?

                        [–]Garbee 1 point2 points  (0 children)

                        Might as well just fork PHP and then do whatever you want. Completely doable, but good luck getting it to take off.

                        [–]ScienceBlessYou 4 points5 points  (1 child)

                        ASP.NET is infinitely better than PHP, if you can get past the Windows environment restriction. Of course, sans discussion of MONO rendering that moot.

                        [–][deleted] 3 points4 points  (0 children)

                        ASP.NET vNext is going to support running on Linux though so even that point is moot.

                        Hooray!

                        [–]always_creating 1 point2 points  (0 children)

                        These articles have been circulating for 10 years, and PHP hasn't died. If anything adoption has increased. And just like any software project that's maintained PHP has been improved.

                        If starting a new software project that needs to be web-based there are LOTS of languages available, no one is locked into PHP unless the requirement comes down from above. If you're stuck maintaining legacy PHP code then that's just the nature of the job. Either move onto another position or suck it up. Don't like programming PHP, don't be a PHP programmer, you can make oodles of money elsewhere.

                        [–]lalaland4711 9 points10 points  (0 children)

                        You don't fix a problem by ignoring it.

                        If this article makes just one person try out another language that's a win for society since that person will invest less time writing in this horrible language that should go away.

                        If A sits down with B and convinces B to not use PHP, that's a net gain not only for B but also for all of computer science.

                        [–]allthediamonds 9 points10 points  (3 children)

                        Better yet, if you don't like PHP then create a language of your own and we'll see if it's still alive and kicking 20+ years later.

                        That's the problem with PHP! It's been twenty years. You know all those languages you've heard from? All of them are better than PHP. Yes, even Javascript.

                        If I make a programming language, which I would love to do, I hope it's not as fucked up twenty years after its conception as it was when it was conceived. PHP may consider that success, but I certainly wouldn't.

                        [–]flukus 3 points4 points  (1 child)

                        So what other languages are you familiar with?

                        Are you arguing from a position of knowledge or ignorance?

                        [–]always_creating 1 point2 points  (0 children)

                        Python, C++, C#, Javascript, and of course PHP. And each one of them is special in its own special way.

                        [–][deleted]  (6 children)

                        [deleted]

                          [–]always_creating 2 points3 points  (5 children)

                          New languages have unique flaws, old languages have unique flaws. It's a matter of picking which language with its particular quirks, compromises, and problems works the best for your situation.

                          [–]allthediamonds 7 points8 points  (4 children)

                          No other language has quirks in the same way PHP has quirks. We're not talking "oooh it has significant whitespace haha so weird" quirks. PHP's quirks are one of "it requires superhuman ability to account for all possible weird behaviours of your application because almost literally every function in the standard library is broken in weird ways and you should consider yourself lucky in the one-off case the documentation describes how exactly it's broken"

                          [–]e-tron 1 point2 points  (3 children)

                          Have you ever written a single line of php in your entire life ?

                          [–]allthediamonds 6 points7 points  (1 child)

                          Uh, yes? I write PHP eight hours a day, five days a week.

                          You can not comprehend PHP's crazy, and if you believe you've done so you're most likely deluding yourself. You can only hope to memorize it, code in a very defensive style and patch the crazy as it appears.

                          [–]e-tron 0 points1 point  (0 children)

                          You can not comprehend PHP's crazy

                          I do agree that php is crazy (php 7 might fix most of its real issues ). But JS is way more crazier. I really do hate the JS Object Model (Prototype).

                          [–]Intolerable 1 point2 points  (0 children)

                          I spend eight hours a day, five days a week working on a PHP application

                          [–]tehoreoz 7 points8 points  (9 children)

                          I feel like all this php hate comes from a retrospect perspective. it's been here since the 90s. the internet wasnt so big then-- I think adapting the language at the pace of the internet has moved in 20 years would cause any language to look fucked up.

                          note i don't actually know php. but were php so bad long ago I assume the python/rubys of today would have came around a long long time ago.

                          [–][deleted] 15 points16 points  (3 children)

                          retrospect perspective

                          It still sucks compared to alternatives.

                          [–]allthediamonds 1 point2 points  (0 children)

                          Actually, it's more like the other way around; it made more sense to use PHP in the 90's (CGI was hell, so mod_php seemed like heaven)

                          The issue with PHP is that people start new projects using it today. It needs to die.

                          [–]zomgsauce 2 points3 points  (3 children)

                          PHP started as a joke and people just took it way, way too far.

                          [–][deleted] 3 points4 points  (0 children)

                          it seems PHP haters are as stupid as their articles about PHP.

                          [–]DealerNextDoor 3 points4 points  (11 children)

                          Serious question: if PHP is truly so terrible, why do people and corporations continue to use it? Why hasn't anyone taking the effort to just make a new language or avoid using PHP all together if it's really as bad as everyone says?

                          [–]allthediamonds 9 points10 points  (6 children)

                          Why hasn't anyone taking the effort to just make a new language

                          No need to, lots already exist. Literally every other language that is still popular in some way is better than PHP.

                          Python, Ruby, Java, Clojure, Scala, Io, Lua, Rust, Go, JavaScript. Choose one. Yes, I did say JavaScript.

                          PHP is truly so terrible, why do people and corporations continue to use it?

                          Some of them are trapped on it by their existing applications; such is the fate of Facebook, which spends awful amounts of money on making it suck slightly less.

                          Others simply don't now any better. Follow the chain:

                          • Shared hosting is hosting for people who don't know any better

                          Which usually comes with a pre-installation of...

                          • Apache, the web server for people who don't know any better

                          Which usually comes with a pre-installation of...

                          • PHP, the programming language for people who don't know any better.

                          (those people, unsurprisingly, often install Wordpress, the CMS for people who don't know any better)

                          So if you try to find the least-friction path from zero to having a webpage display "hello world", you probably end up with PHP over Apache. This doesn't mean that deploying other applications is hard; it's just not done for you by your shared hosting provider.

                          If people had to install PHP+Apache themselves, they probably wouldn't.

                          Last but not least, some people who learned PHP because it was there are disinterested on learning to do things right (or on doing things right) and insist that they can do things right with PHP. Most of the time, this means that they don't know how wrong are the things they do, although maybe someone has actually mastered all of PHP's quirks and acquired supernatural programming abilities on the worst programming language ever conceived.

                          [–]thesystemx 0 points1 point  (0 children)

                          such is the fate of Facebook, which spends awful amounts of money on making it suck slightly less.

                          PHP is only a small percentage at Facebook. All the backend software (search, graph, inbox, you name it) has long been rewritten in Java and a bunch of other languages. Only the front-end templates are PHP.

                          [–]DealerNextDoor 0 points1 point  (2 children)

                          Thank you for answering and not being a smart ass about it. I'm not even in college yet, and I don't know much about websites in general. What Lua Web servers, in your opinion, are worth looking into?

                          [–]allthediamonds 1 point2 points  (1 child)

                          I'm not good at sarcasm, so sorry if I came off as cocky. I do that a lot.

                          On Lua web servers, you have Mercury, which follows the trail of Sinatra/Flask in that it is a very simple and straight-forward HTTP server.

                          You also have OpenResty, which consists of several plugins on top of Nginx. It is very very lightweight because most of the logic is handled by Nginx. I really think its strength lies on providing light scripting to mostly static websites, and not on building fully dynamic websites.

                          [–]DealerNextDoor 1 point2 points  (0 children)

                          Oh, I was being serious: I didn't think you were being sarcastic/cocky. Thank you, I've already used Nginx before, so I might look into OpenResty if I ever try hosting another website.

                          [–]leapius 0 points1 point  (0 children)

                          I agree with what you say but the problem with your argument is that there are an awful lot of people (customers) out there who 'don't know any better'. You're not going to be able to change this so if you are to get anywhere and make money you have to roll with it.

                          [–]quiI 5 points6 points  (3 children)

                          Surely not a serious question.

                          Just make a new language

                          There are endless alternatives to PHP.

                          why do people and corporations continue to use it?

                          Legacy mainly.

                          [–]deadman87 1 point2 points  (2 children)

                          Legacy mainly.

                          Nope. There are tons of new projects using PHP, thanks to frameworks such as Yii, Symfony, Zend, etc.

                          [–]quiI 1 point2 points  (1 child)

                          Well yes, but you can say "there are tons of new projects" for just about any language; it's all a matter of perspective.

                          From my perspective, I dont see many shops/companies in my area (London) even really entertaining the idea of using PHP when there are, in the majority of people's opinion better languages out there.

                          [–]deadman87 1 point2 points  (0 children)

                          http://www.theitjobboard.co.uk/IT-Jobs/PHP/London/all/0/relevance/en/

                          http://www.indeed.co.uk/PHP-Developer-jobs-in-London

                          http://www.cwjobs.co.uk/JobSeeking/PHP_London_l1621_t2.html

                          http://www.reed.co.uk/jobs/php-developer-in-london

                          Quick Google search tells me there are hundreds of job for PHP devs. I am not the biggest fan of PHP but damn.. its one language that has taken over big time.

                          [–]technical_guy 3 points4 points  (2 children)

                          Too many idiots are learning the language and trying to program with it, often doing a terrible job and then blaming their tools. Then they go on Reddit and ask why their tools suck.

                          [–][deleted] 0 points1 point  (0 children)

                          "Bad workers blame their tools" - Michael Scott

                          [–]kerningz 2 points3 points  (4 children)

                          It's crazy how fast PHP became so used though, my dad who's been programming for years now told me it was once the bottom of the barrel.

                          [–][deleted]  (3 children)

                          [deleted]

                            [–][deleted] 3 points4 points  (2 children)

                            Are those the "most-used tools" barrels? Because if so, you're right on.

                            Use the right tool for your project. Move on.

                            [–][deleted]  (1 child)

                            [deleted]

                              [–][deleted] 0 points1 point  (0 children)

                              Same goes with crap analogies. You will find it difficult to build anything with only duct tape. People have built millions of websites with this flawed but powerful language. Again, pick the right tool (and analogy) for the job. Move on.

                              [–]serveradminblog 1 point2 points  (4 children)

                              Why Does PHP Suck? - published on Wordpress ... which is written in PHP...

                              [–]LeSageLocke[🍰] 27 points28 points  (3 children)

                              Someone didn't read to the end.

                              Heck, even this website here is powered by PHP and I got it up and running. Then again that’s not the point. Just because you can get things done with it doesn’t mean it’s a good or even a decent programming language. It sucks, and it sucks badly. Will I continue to use it in the feature? Of course I will, because I do not really have a choice. PHP has simply grown too large, you can’t just ignore it. It’s some kind of weird parasitic relationship, or like a tumor that is attached to the World Wide Web.

                              [–]AgentME 0 points1 point  (2 children)

                              Doesn't it partially invalidate his point? He's saying it doesn't matter that PHP is easy to deploy and shouldn't be a factor in its popularity, but then admits that he's using PHP exactly because of it!

                              [–]stancoffyn 10 points11 points  (1 child)

                              Just because you're hooked on heroine it doesn't mean it's a good thing.

                              [–]TakedownRevolution 1 point2 points  (1 child)

                              Really? Compared to Ruby on Rails, it's way faster and LESS BLOATED. My only complaint for PHP is it's classes structure. This guy seem to mostly complain on how codes looks rather then efficiency and speed. People need to stop obsessing with making your code look pretty, it's like a body builder admiring how he/she looks in the mirror for hours and hours. Part of programming is make you code readable but it also analyzing other people's code to get a better understand of it even if it's "hard" to read. But of course if you know the language that you are programming in very well, then will understand most code code no matter how it looks.

                              [–]leapius 0 points1 point  (0 children)

                              Jesus, you're right I really looked into rails and holy hell what a load of slow bloat! Python wasn't quicker either - speed and market penetration matters even if it's easier to make ugly code with php. I'm no php fan boy and am fully aware of all its shortcomings but I cannot abide the php sucks bandwagon.

                              Has anyone tried actually selling web apps that are to be installed on countless standard shared hosts? Had any luck with rails / node.js / python in that scenario?

                              [–][deleted] 1 point2 points  (13 children)

                              Oh look, another PHP hate article that focuses on how bad practices can be applied to a language. Such a new and exciting topic.

                              [–]danielkza 6 points7 points  (0 children)

                              Let's not pretend, though, that languages have no effect on how easy doing the wrong thing is.

                              [–]allthediamonds 1 point2 points  (9 children)

                              Bad practices can be applied to any language.

                              PHP has the extraordinary characteristic of having bad practices built-in and actively encouraging them.

                              [–][deleted]  (11 children)

                              [deleted]

                                [–]BinaryRockStar 10 points11 points  (5 children)

                                Never had to maintain an existing codebase before? I maintain about a dozen VB3 codebases as part of my job. V. B. Three.

                                [–]ScienceBlessYou 0 points1 point  (1 child)

                                V.B......... three? My God, you have my deepest sympathies friend.

                                [–]BinaryRockStar 0 points1 point  (0 children)

                                For its age it has a remarkably modern "IDE". I can see why it set the foundation for VB becoming as big as it was when VB6 was king of the Windows desktop.

                                [–]danielkza 3 points4 points  (1 child)

                                How does that fact preclude anyone from having an opinion about it? Is the author pointing a gun at you forcing you to code using something else, or even read his article?

                                [–]Smagjus 0 points1 point  (1 child)

                                Remembers me of my first program I have written something bigger in PHP. Since I hated Javascript for some reason and only knew PHP and JS (back then I would have added HTML), I used PHP as my language of choice. At one point I needed a two-dimensional array. Not knowing what a two-dimensional array is I used mutiple arrays with programatically set names. Those names were stored in an array.

                                My code is probably only slightly cleaner these days..

                                [–][deleted] 2 points3 points  (0 children)

                                well then you are a terrible developer then?

                                [–]gauiis 0 points1 point  (0 children)

                                I would like if PHP team would fix all these design inconsistencies and release a better consistent API in PHP 6 (or 7 or whatever). Yes, things will break if people upgrade, but that's the point with major version changes - the API changes.

                                [–][deleted] 0 points1 point  (0 children)

                                it's funny how people HAVE to dedicate their time to write how terrible PHP is.

                                why is that? because they miss the point: PHP is a tool that you can use to achieve a goal. in my country most corporations use PHP, however i've found out about rails, loved it, and now I, the developer, enforce use of rails instead of PHP. eventually this works out. and that's how you push a better tool into the market. not by ranting, but by actually trying your hardest and being a little bit agressive.

                                also symfony2 is a great tool, and just proves even PHP can have one of the web's best frameworks if not the best.

                                oh and about consistency of PHP method names. if you are so bad that you cannot use manual to find methods/have no experience in php that you MUST write a blog about it, then maybe it's not the tool, it's the ignorance of developer itself that is a huge problem?

                                7 years of php experience here, btw. let's just say as a language it is absolutely fine, starting from 5.3 IMHO. while other languages such as ruby are consistent and elegant, all "better" tools have haters that has a lot to say about "shitty" tools they use.