PHP. It’s a great language I use professionally at work everyday, but I sometimes feel that as php dev I am not taken seriously (mostly by myself), especially when conversations go about more serious CS/SE topics. And I kind of understand the reason I feel this way, php is a dynamic high level language, which is not even suitable for more serious, cpu & memory heavy tasks, so why would someone rely on some stupid php scripter’s opinion, when his main language of choice can’t even do serious shit. Oh and students/beginners are the worst, they just ignorantly look you down, because php developers are loosers, because they read it somewhere.

There was also a moment in my life, when I was younger, which hit me pretty hard, and made my blood boil back then. I kind of always felt that I have to proof something to my parents, as I was always looked down as someone who can’t do shit and just spend his days on computer doing nothing. Anyway at some point when I started earning money I got acknowledged as a future-be programmer by them, then they even knew what programming language I use, which was php of course. Anyway, one day they went to some birthday part of some relative, where they met this “software engineer” guest, who told all kinds of bullshit to my parents as “php is not even a real programming language, and there are no future in it”, as I heard from my parents after. Anyway, I overcame this as I obviously having a great “future” programming php now.

  • 7
    Sorry, PHP isn't a serious language I have to agree here πŸ˜”,

    it's a bloody beautiful language if you grab it by the balls and use it to handle any use case that is thrown at you, it's misrepresented by its dark archaic days where shit was bonkers at best, I know, I was there, and I survived... I think.

    Stay strong, ignore the bullshit of others, only you know what you can and can't do.
  • 14
    I know how you feel. I started with PHP 4 in high school. When I started a CS study at a university I heard a lot of the same opinions about PHP.

    For my final bachelor project I had to do research and develop a project based on it. I decided to use PHP because a large part of the project required a web interface to present the data (well, and it still was my own preferred language). I did know the CS professors hated PHP, though.

    At some point I shared the git repo with the CS professor and showed him a beta release. At our next meeting he told me: "I was really anxious when I saw you used PHP. During my classes I usually forbid it, because the the code is usually really, really bad. But you showed me PHP can be used to write quality code as well. I'm considering to lift the ban on PHP in my classes."

    I was just so happy! Not only because he gave me huge compliment, but because I made a CS professor in networking and distributed systems think differently about the language I love :)
  • 6
    And this software engineer guest, where is he now?
  • 6
    I think PHP is... underestimated.

    Since 5.4, PHP became better with each release.

    Yes, you'll have sometimes to think outside the box (eg gearman / ReactPHP...), but that's true for any language.

    I think PHP has a lot of valid use cases... It's flexibility and simplicity is it's strength - and weakness, cause too many idiots borked up it's rep.

    All in all, I think PHP will always play an important role. :)
  • 7
    Any "engineer" who says something as asinine as "X isn't a real programming language" about any Turing complete language deserves to have their developer license revoked
  • 3
    @jdebs Oh thank you.. Recently been in a debate how scripting languages are not real programming language and it doesn't matter if they are turing complete or not. I still suspect I talked to some 15 year old who just learned how to write his first hello world.

    The internet is a bad place where morons manage to sound intelligent. Look at me. Quod erat demonstrandum!

    Though... real talk... Sql is turing complete.
  • 3
    PHP is a fully fledged OOP language. Do not let anyone tell you it's just a scripting language. If PHP is a scripting language then so are Java and Python.

    99% of Python and Java developers do not use language features and paradigms that do not exist in PHP.

    PHP is also fast now. PHP 7+ benchmarks at 3x times faster than Python 3.8+.

    I mostly write in Golang now, but my background is in PHP. Writing good Go is no more challenging than writing good PHP and vice versa.
  • 1
    @koalaplushie Which language features from Java/Python do you mean?

    I can still think of a few which PHP is missing. For example, generics in Java is something I would love to see implemented in PHP.

    Multiple inheritance is something from (I believe) Python is something I would love to see in PHP. Traits in PHP might partly solve the same problem as multiple inheritance, but it still feels more like a construct to prevent copy/paste then a real attempt at multple inheritance.
  • 2
    My problem with php is not a lack of features, its inconsistencies, a messy standard library and the timewarp to the 70s whenever you need to manipulate text. (Seriously, why does a "high level" language treat strings as byte arrays ? Even c++ have proper strings)
  • 0
    @rutee07 don’t know and don’t care

    @koalaplushie honestly, I find oop quite challenging, sometimes for simple things you have to add bunch of classes and interfaces just to follow specific design patterns, on the other hand, in go you have implicit interfaces and that’s it, no need to overthink about design, you just follow simple composition. I guess, that’s one of the reasons I love go, it’s less stressful.

    @Hel8y what kind of generics you mean? Operator overloading? I don’t think that’s a good idea in dynamic language. Same about multiple inheritance, it causes more problems (diamond problem), than it solves.
  • 2
    @SevenDeadlyBugs Operator overloading is actually proposed for PHP 8: https://wiki.php.net/rfc/...

    And traits already have some of the same problems as multiple inheritance would have :)

    But what I meant is actually called generics. It allows you to write a Queue<T> class. The T placeholder can be used in method signatures and return types. During initialization you would use $queue = new Queue<Job>() to create a queue object with the methods push(Job $item) and pop(): Job.

    Generics are another form of abstraction which can be really useful in certain scenarios. Two or three years ago we created a package in PHP which we validated against SOLID in the design stage. We actually couldn't find a way to cross off the L from SOLID. A few hours of brainstorming later we realised generics would have solved the issue.
  • 1
    @Hel8y how it’s different from interfaces? Basically, in my experience I learnt that liskov substitution principle (soLid) is the hardest problem to deal in oop design, but also easiest to solve by composition (sometimes even the only correct way to do it)
  • 2
    @SevenDeadlyBugs Let me try to explain based on the problem we encountered 2 of 3 years ago. We tried to create an architecture to run jobs in the background. So we came up with the following classes (simplefied):

    JobInterface - Subclasses implement this interface for every different job. A job should contain serializable data.
    JobHandlerInterface - A handler for a specific job. Classes should implement one method: process(JobInterface $job): JobResult.
    JobQueueInterface - A queue based on some third party service like beanstalkd or RabbitMQ. It can only push/pop classes implementing JobInterface.

    We should be able to push every Job to a queue. However, not every Job can be handled by every JobHandler (which violates L). With generics we could have defined JobHandlerInterface<T implements JobInterface> so a specific JobHandler could only handle specific jobs (which validates L), while still being able to push every job to a queue.
  • 2
    PHP is only looked down upon from people who think that it is only used by 13 year old hobby hackers. PHP can do serious business and runs really fast with 7+.
    Writing clean code with PHP needs practice and a functional brain (which most WP developers don't have anyway).
Add Comment