12
ozeta86
7y

Why it seems that every Dev on the web hates PHP? I found It easy and full of usefull tools

Comments
  • 7
    sigh... oh boi here we go again with this topic
  • 2
  • 4
    Firstly: https://eev.ee/blog/2012/...

    Also, we don't like it because it's useless. It does nothing better than its alternatives. PHP's only claim to existence went away when other platforms emerged like Python, Node.js, ruby, Asp.net and so on. That claim being that it's an easy language to write servers with.
    Apart from that, PHP's got nothing.

    It filled a void in its time but that time has passed and PHP should pass with it.
  • 1
    @Froot the article is really a good explanation! thanks!
  • 1
    I'm happy I don't know php.

    By the way, he said Facebook is built on php, I know it is but is it still on PHP?
    I mean didn't they transfer to nodejs and react? Or thata only in parts of their website.
    @Froot
  • 3
    The evee article is not really relevant anymore since PHP has evolved past many of the items that Eevee originally claimed in its article. If anything I was thankful for that articlr when it first started, it made people open their eyes and fix many of the issues with the language. I find it rich that someone with JS as their preferred platform would say that PHP is useless, the language, the tools and the environment are far from useless.
    The language is quirky, it really is, but so is practically any other language in existence. My reasons for liking php:
    Cheapest environment to use, if you are building something for a client that does not have that much of a budget you can rest easy knowing that php is cheap. Plus there are no heavy configurations required or the fear of having things deprecate on you and break your environment (cough cough node)
  • 3
    @AleCx04 and that itself would be a big reason to use it over many others.
    Moving on, the language does not impose a particular style over you (Java, Python, .net, Js and many others do) and you can pick the parts of the language that you want to use, or go full blown on custom solutions taking advantage of nothing but the standard api (Python requires many different external components such as a templating engine, same for Ruby, and many others) and the general language itself. Your code can be as procedural as you want it to be or as oop as you may want it, support for functional programming is not a strenght, but it is doable and quite decent. Such is the oop patterns that you can use, for example d.i is vastly used in php which is a good thing when building heavier applications.
  • 2
    @AleCx04 moving on: extensibility. If for some reason there is something that you want to change or improve or modify without source changing the entire language, and you know c or cpp then fine! Code it, add it to whatever server stack you are using and done. Look at the phalcon wev framework, its just a (on windows for example) .dll that you add to your config and that is pretty much it. Php has by far one of the most open communities when it comes to improving the language, php 7 being a testament of this. And most frameworks and libraries follow very good coding patterns.
  • 3
    @AleCx04 lemme know how technical you want me to go, I can get into it :) but as an overall perspective I would say that php is a great choice :) I use it at work, I also use enterprise Java and I love all environments and technologies. Saying thay something is not useful or whatever can severly limit or hinder your learning experience :) code and be happy my friend.
  • 4
    tbh just use it for small things like including headers/menus and stuff and you should be fine
  • 2
    @AleCx04 What's wrong with saying that PHP is useless if I like JS? JS has its place and it's unique strengths. First off, it's the only front end language, that alone is enough to differentiate it. But it also has other things going for it like asynchronicity, a vast package library and fast development (I mean the language itself is developing fast). Also, it's the only language in the world where there are multiple compiler/interpreter developers who have commercial incentive to be the best.
    The list goes on and on and on but the point is that JS has a very clear reason for existing, PHP does not, it's just another server side language that isn't particularly good at anything.

    Most of the things you mentioned are generic stuff that any language has. Even further, JS does most of these things better than PHP (functional programming?)

    Anyhow, I find it rich that a PHP developer is talking about progress while most PHP devs use it because they just can't/won't learn a better language
  • 1
    @gitpush Probablly most of it still is. That in itself doesn't mean much tho because there weren't as many alternatives back when Facebook was started and porting a huge codebase like that doesn't make economic sense usually.

    Instagram and Snapchat for example, much newer projects, run on Django.
  • 1
    @Froot I see, and you have a good point there it brings no economic advantage in rewriting it
  • 1
    @Froot the thing is, your views on the language are highly biased (for whatever reason) which makes me believe that your knowledge of php is rudimentary at best. Js certainly has its place...what with being forced upon us and whatnot, heck it is the only language that I know of that brings about a new transpiler or compiler every other week, and not because the language is so awesome, but because people seem to continue trying to sell the picture of fixing the language, how many php transpilers are there out there?
    And no, Js for example does not do oop better than php (because it has prototype based) neither does it have support for strict typing (unless you literally change languages) or feasible numeric support. People run businesses with Magenta and make puns of js's numeric powers, so saying that it does eeeeverything better is a fallacy. And I am mostly a Java engineer and know way more tech stacks (node included)so no, not the only one :)
  • 0
    @AleCx04 Ok firstly, what's the problem with JS's numbers? You mean the float inaccuracy stuff that comes up in most languages?

    Secondly, what's the problem with transpilers? At one point you hail how PHP has an awesome community that is pushing the language forward and next moment you're bringing the exact same thing out as a bad part of JS. Doesn't make sense.
    Also, no, they don't come out every other week. At this point it's basically Babel Vs Typescript. Two... Two transpilers. Could as well pull the same argument on c++ for having more than one compiler.
    And how are transpilers bad? I get that it makes it harder to understand for a PHP dev because it's not the same old simple scripting language. But is it bad? I don't think so, it's progress.

    Meanwhile in PHP over the past 10 years
    > Facebook created a new PHP engine that runs faster
    > Version 7 was released that made the language semi-usable
    > ..... *crickets chirping* ...
    Yeah... Progress
  • 0
    @Froot compiler != transpiler, just making sure we both agree on that one (in refference to the cpp example) and see lemme try and expand on this a lil bit more: I do not dislike Node or JS. I was there when it started cheering on the concept and getting really excited about it. But at the same time I know that the language is not the best option for everything, right tool for the right job (hard concept to grasp for the JS community I know) in which case JS sometimes is not and PHP sometimes is not. But to render a language useless because of your tech stack of choice (which really isn't way better as you claim) is seriously fanboyish. You see, my point is not trying to prove that JS is worse and PHP is better, they both have their strengths, and weaknesses, but you liking a tool more than the other does not render it useless.
  • 1
    @Froot Facebook creating the hip hop virtual machine is a testament of what happens when you try to use a dynamic language for heavy computations, I guess I could say the same thing of Ryan Dahl saying that Go is what he would use for servers, not node....but that is a dumb point which is why I did not brought it up....same can be done for Twitter switching over to Scala and the JVM , it does not mean that Rails is crap...it just means that right tool for the right job :) , on your second point "Version 7 was released that made the language semi-usable** In what exactly? According to your vast non-eevee ridden expert point of view, in what does it make it better or more usable? And do not throw "faster" around like if that was supposed to mean something when you have posted before that you have no experience with php. That is fine, if you wrote 200 lines of code and did not like it...I get it...but don't tell people that it is useless on your lack of experience....
  • 0
    @AleCx04 Obviously a transpilers isn't the same as a compiler. But it did make for a decent comparison because both transform the code you write.

    And I'm not saying JS is the be all and end all of programming, obviously not. What I'm saying is that JS has its niche while I have yet to find one for PHP.
    I have tried to get PHP into my projects just to play around with it more but its always a bad choice. There is no single thing that PHP is best at and that renders it useless. Sure it's decent at many things but best? Na.
    You'll probablly mention ease of programming, getting a project up fast and all that. Many languages can do that, Python, Node.js, Ruby and so on. And all of those also have other strengths you can take advantage of. Node has async Io, python is really good with mathematical stuff. Why should I ever choose PHP is all it can do is be easy to write? Especially when that quality is not that rare anymore.

    Also, using a library in your codebase is not a problem.
  • 0
    @AleCx04 Oh you went on a hunt through my past posts to find something to use against me. Clever.

    I'd say the main thing php7 brought are types. Types are great. Also, it did get faster as I've heard, but that's an invalid thing to mention as you said. Aight, fuck speed.

    Also, did I ever claim to be an expert on PHP?
    I've stated it many many times that I don't find it bad, I find it useless, it has no niche. Can you say what PHP shines at? Why it should be selected in a tech stack?
    And no, having a built in templating language and fast development won't cut it. First is covered by a zillion well written libraries, second is not unique to PHP at all.
  • 0
    @Froot no, I just have an very good memory. And trust me man, I get that TO YOU is useless, my issue with your statement is that saying that is useless to you makes you think it will be useless to everyone else which is not the case.
  • 0
    @Froot and think of it from a different point of view. Why should I use Node.js with a mean/sails/or meteor stack as my server base? It has meh support for relational data, not a centralized ORM standard or "plug in play" db support (pdo is one for example) it runs on a single thread so might not be able to build it up to something bigger...mhm i kn0W itZ uZeleZZ...see my point?
  • 0
    @AleCx04 Actually... No, I don't see your point. Node gives you async io, noone else can do that so if that's what you need, go with node. Also node being single threaded is a non issue if you know what you're doing. Node has its niche.

    As for your first post. Say you find a widget on the floor that you have no idea what to do with. It's useless to you, and thus from your perspective it is useless. You could go and say that hypothetically it could be useful for someone thus it's not useless but that would mean that nothing is ever useless. That's not right. See, your reasoning either takes us to a philosophical debate or flat out doesn't work.

    Now, still. Why would I choose PHP in my stack? What does it have that no-one else has or what does it do much better than anyone else?
    All you're doing is bashing JS to defend PHP but that's not how it works. Saying that JS is bad doesn't make PHP good...
  • 0
    @Froot i am not saying that Js is bad, and I have mentioned before why the php stack is a good option, you still wish to see it as useless because to you my points are not valid, we will not be able to progress further since you continue to deny its value (which again I have mentioned before but you refuse to see them as valid points) and that is fine, I am not trying to convince you to switch stacks, you are obviously a good Node/JS developer and if that is your weapon of choice then more power to you really, php to me excels in web development, it can easily scale to a particular need with no additional dependencies using no other than its standard core, it is far easier to extend using dlls, pdo works as a jpa or its own lil orm, it has template support built right in, and support forn many different styles of programming. Saying "other languages do that" can effectively be done with any other stack really, from Python to Ruby to Node to anything.
  • 0
    @Froot at the same time, saying that you fulfill your needs with Node, Ruby etc does not render the language useless....which is what I am trying for you to see....less we would all still be coding cgi scripts with C or Perl. I mean really, those languages would do all, so what would be the point? Php has literally the lowest barrier of entry for web devel, if good database support, extensive api, extensive paradigm suppport, extensive third party plugins and ease of use are not valid to you then I have no clue what would be really....
  • 0
    @AleCx04 I believe this is one of these cases where we just have to agree to disagree.

    I got to say tho that being able to extend the engine with custom dll-s and stuff does seem interesting, I'll be sure to look into that.
    Also another strength of PHP is wordpress. I know, everybody hates it, I hate it too. But it does allow a ton of people with little programming knowledge build decent sites and that, while not being my cup of tea at all, is still a plus.

    For me tho, with all the tools I have in my toolbox, I just can't find a niche for PHP so choosing it always feels like a forced choice just to get it in there. To each their own tho, if you're happy with it, so be it. 😄
  • 2
    Well,Now i'm more confused than before. lol
Add Comment