Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
C0D45681562dSorry, 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.
Hel8y36662dI 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 :)
rutee071097562dAnd this software engineer guest, where is he now?
IntrusionCM176262dI 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. :)
jdebs40562dAny "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
@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.
koalaplushie2362dPHP 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.
Hel8y36662d@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.
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)
@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.
Hel8y36661d@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.
Hel8y36661d@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.
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).
rutee0712I'm a master of nothing. I have no specialty. I cannot focus on one thing and I always move on to something el...
Python5Biggest dev insecurity? Probably http:// It’s not secure at all, never feeling very confident when browsing...
bittersweet13Insecure... My laptop disk is encrypted, but I'm using a fairly weak password. 🤔 Oh, you mean psychologica...