Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
It's popular because it was first one in that niche, it was used widely, so, it's difficult to move on. There are much better alternatives, but if you want to stick with PHP, it's fine.
-
C0D4669444yNo, fuck you!
NodeJS is our new lord and saviour, there is nothing I cant do in JS your slow and piss weak typed PHP language can do!
Why should we all stick to some dinosaur language when we have these new toys that can't fucking run without 64GB of Ram and a 5.2GHZ 12 core CPU!! Stop being a poor bastard and buy the hardware my shitty memory hogging app needs to destroy your computer instead of me being a poor bastard and having to pay a hosting company to run my shit code for you! This is the new world!!!!
If you made it this far... I love php too 🥰 -
Could you imagine that there’s someone out there who wants someone else to have their internal systems eaten away by covid as they die with a breathing tube shoved in their throats bc their programming methodology or language is “wrong”?
-
@theabbie when it comes to web, not really. As a server-side embeddable languge PHP is perfect for web dev, and while it is true that much of its popularity can be attributed to it being one of the first relatively usable (and approachable first and foremost) languages for web, with the direction and speed of the lang’s subsequent development it’s no mere legacy relic of the past, but even today a contender able to compete with the alternatives.
Also, much of the bad rep PHP gets is due to versions prior to 5.4, and at least versions prior to 7. Personally I was about to give up on PHP in favor of Rust/F# with WASM, but now that I’ve worked with PHP8, I see absolutely no reason why PHP shouldn’t stay the de facto king of web. I mean at least it’s better than JS or any of its frameworks - or any other relatively widely used web fw in any lang out there. I love my fav ”god-tier langs” (Rust and F#) to death, and enjoy many and more others, but for its intended use case, PHP sits on the throne, and rightfully so. -
@100110111 It's a no-brainer that if PHP, in it's current form, was released today, people won't have bothered to touch it.
-
hjk10156964y@theabbie I'm a bigger fan of Go but I also love working with PHP. I've done some amazing stuff with it and for a static type lover the type hints are just enough to do some good design by contract while also do some quick stuff that would otherwise need generics. Like any tool it's not suited for everything but it's grown out from a nice to a lovely general purpose language.
-
@theabbie tbh, that would depend on who released it and how it was marketed. Why do you think many of the langs/fws we use or at least talk about are developed by the likes of Google, FB or M$? Not necessarily because they are any better than some of the others out there, but because they are backed by big buck. I’m not diminishing their value here, but just saying there are many great langs out there that don’t get the recognition they deserve, bc they... just are, exist, and are being developed, and no noise made.
Whether PHP would find a place as is if it was released now, it’s hard to say. It is far from a no-brainer tho. Would people use C++ if it was released today? -
@100110111 Problem with old languages is that tonnes of stuff has been already made with it, you can't just get rid of it. Server-side is a place where there are many alternatives. PHP still surviving does prove that it has something. Still, if something has to be made today, alternatives should be considered than just using PHP despite it's limitations.
-
PHP still isn't a good language. It doesn't suck donkey ass anymore but that's not a high bar to overcome. I mean come on it's still objectively worse than Java and nobody likes Java. Okay great they fixed some of the worst things -- but that's stuff that should never have existed in any language ever in the first place! It's like smashing your shitty table and then getting 10 people to fix it up again slightly better than it was before. Except know you think your new table is the shit because you only knew your even shittier table for the last 10 years
Meanwhile your neighbor has a sturdy but light polymer table with a built in coffee machine that can also jerk him off and make phone calls -
PHP definitely gets more hate than it deserves.
It's not perfect but it's very respectable none-the-less.
As I've said before (other ranters may have come about them), the only thing I really miss from PHP would be async/await.
Though, I would like them to go more OOP.
So instead of:
```
ucfirst(ltrim(' lamestring '));
```
Something like this:
```
' lamestring '->ltrim()->ucfirst();
```
I like the syntax, I like the relative simplicity of PHP and the performance is just fine (especially now with PHP8's JIT), especially when using Zephir to complement it. -
@C0D4 PHP isn't going to die soon, so, it's safe to use it, if you want to be called a Boomer.
-
-
PHP is hot literal garbage and there's nothing to save about it.
The programmers working on some frameworks (Doctrine, Symphony, Zend) were so absurdely skilled that even on such a badly designed language they were able to create some absolutely solid pieces of software.
But that's a bandaid on a programming language that is rotten at the core. -
@theabbie I doubt that... Atleast, I certainly don't.
I use PHP because it does everything I want without overcomplicating stuff too much.
When I need to process analytics, I use Python or Julia.
When I need to make desktop apps, I use Electron (sue me).
When I need to make mobile apps, I use NativeScript (again, sue me).
I doubt the other lad's won't do the same. -
@IHateForALiving I beg to disagree. I see the frameworks as hot garbage, but using vanilla PHP is the way to great things - if you know how to wield it!
-
@theabbie where have you gotten the idea that people use it like a magic wand? That’s a JS and Python thing, trying to use that utter garbage to do things they are definitely no good fit for.
-
@100110111 PHP is just good enough, Not Strongly typed, so, can't justify that it's any better. It won't compete long enough, OP is right, People who use PHP will die along with PHP.
-
@theabbie if that’s the case, I’ll live a loooong life.
While I’m a proponent of strong typing, I can say the type hints as is are for many use cases good enough. (Almost) no language is prefect, but the good thing about them is that development happens, and PHP is one of the langs that is going ffw to the right direction and I’m confident it’ll stay ahead to remain relevant even in the future. -
@100110111 Good for you, PHP doesn't bother me, so, I don't have problem with it dominating the web. It's continuous improvement explains why it's popular, Not soon, but end is approaching.
-
@theabbie A language continuously augmented, developed and standardized by a massive community, with some of the most popular web adaptability on the easiest and most common server stack has its end approaching? ok
-
Y'all keep fighting about the new and shiny. I like to get home early, drink my beer, watch weeb shit, spend time with my fam and go night night.
I don't have time to neckbeard about the languages that I use. Nor do I care if some rando on the internet has a strange weird vendetta against a tool he/she can very well ignore for something else.
I just like money, and tiddies -
hjk10156964y@johnmelodyme nope it is on my list of languages to learn though. Was going for Haskell first but due to a recommendation I'm going for Elixir
-
hjk10156964y@IHateForALiving wow you really know how to have a strong opinion. Where is the evidence though?
-
@AleCx04 PHP is everything the modern web is NOT about, it was useful years ago, web has changed. Very few people are picking up PHP, since these people will dominate in future, PHP will remain in the corner, old and rusty, waiting to die.
-
@hjk101 in the response times and in the tricks I have to pull out not to run any datatable with a PHP server into a sluggish rage-inducing machine. Want metrics? I have none. Take it or leave it I'm not here to start a cock measuring contest with people keen on persuading me about how cool PHP is when during my experience I've seen the whole the absurd performance problems you get when you use such a tool.
TLDR: yes, source is "just trust me bro". -
@theabbie at its very core the web is presenting data, giving a user the chance to do something with said data, and processing those requests. How is then php not about modern web? how is the way php works with that different from other languages? it was literally created to do that.
Sure, the underlying technology that does this differs from stack to stack, Go for example compiles into an entire executable server in the context of web, Rust does too and others. But what they do on the web, how is this not the same? -
@AleCx04 Modern Web is about single page apps, though single page routing is possible in PHP, it's not primarily designed for it. PHP is a language, so, technically, it can do anything other languages can do, But, that's not the only criteria.
-
Since you seem to like php i have 3 questions (not as offensive reaction, just as a "shit i can't deal with this, i feel like I am doing something wrong, let's ask someone who can help")
1) exceptions: how do you deal with exceptions and the call stack? Last time I worked with it I found the exception logs to be extremely... Poorly detailed.
2) modules: while php has some good package manager (tho i really wish composer's icon didn't look like the artist had a stroke while drawing it), if you install stuff like mysqli->pdo and it's not enabled by default... Good luck trying to enable that, your package manager won't do it for you!
Maybe (surely) I am missing something obvious there?
3) is there anything like typescript is for javascript? I find strong typing useful for automation AND I would love to have a piece of software optimize my code for me, cause compilers tend to be smarter than humans! -
@theabbie you do understand that the single page model works primarily through the client and not the backend right? Go doesn't deal with this directly, it provides the data for it and the client as a SP application handles it, so does net core, so does different java frameworks, so does php,so does rust etc etc.
This literally has nothing to do with the backend implementation since all of them can do it..... -
@AleCx04 Client-Side Routing is one type of SPA, Server-Sided SPAs exist too, I am not saying PHP can't do that, other languages are literally designed to do that job perfectly. Only reason anyone would choose PHP for such a project is if they are already proficient in it. PHP isn't the go-to language to learn if someone wants to get into web development. Good thing is that PHP keeps evolving, so, it will last long enough.
-
rox798354yyou do not need to explain to haters. when it comes to cost and maintenance nothing can beat php .. hehe
-
@piratefox
1. Not an issue for me, I always get the information out of them that I need and else, someone else I know does.
2. Are you still stuck in the pre-container era? Nowadays, it barely costs me more effort than a simple command.
3. There doesn't really need to be, the PHP compiler is already pretty clever and becomes smarter every not and then (eg. the difference between PHP7.0 and PHP7.2 is quite big).
Also, Zephir to a certain degree I suppose? -
@theabbie Then what is the "modern web" about?
Or do you mean those hot turd site that slap JS every fucking where and let the client lift all the load?
Or do you mean that fetish people seem to have for "serverless" (stupid term anyways)? -
@FinlayDaG33k
1) Eh, maybe it's just me not being used to it
2) In some companies they are... too many companies not to learn how to do it!
3) I'll look into zephyr! -
@piratefox
1. I guess so, because I rarely have the issue.
The only times the exceptions give me something I don't understand is because I started using code snippets I don't understand, but that's a me issue, not a PHP issue.
2. Yea, that's a company issue, not a PHP issue tbf... Can happen with any language (for example, my old company, I couldn't use nuget because they blocked appdata...).
3. It's quite nice when you build a library :)
I still need to have a deeper look at it though. -
@100110111 Atleast in this case, there are many people who believe the same. No need to argue anyways, people know when to use PHP (Never).
-
@FinlayDaG33k I don't understand why people don't like more processing on the client-side? Web Browsers aren't fragile, they are capable of complex computations, under utilising this magnificent piece of software is a waste of resources.
-
@theabbie I think you are looking at this from the wrong perspective man. I do not know from where you get that it is not the "go to" language, it might be a language that a bunch of elitists or edgy teens dislike, but that does not bring the numbers down, nor does it account for the gargantuan number of services successfully used both in commercit, internal, or starting applications.
Nor do I get from where you say that people are not learning it anymore. If anything i see a spike of usage -
@AleCx04 Let's forget statistics, I don't have any problem with PHP, I may have to use it somewhere in my life despite of not being a huge fan of it. PHP is one if the languages where you will find a good number of supporters as well as opposers. To be fair, The opposers never tried PHP because of how unappealing it is. We can say PHP is C++ of web development, Really Good but a Nightmare for some people. A true Benchmark test will prove where PHP stands, so, no need to argue about it.
-
@theabbie
Don't get me wrong, (most) people don't have anything against doing some parts of computing on the device - this is the purpose JavaScript was invented for.
Unfortunately, many times we get a mess of megabytes of Javascript we need to download before even seing a single thing! Possibly on a device with limited battery on metered and slow 2G connection with a browser where all tabs have to fully reload when switching between them.
We can get this large page sizes even without SPAs, but SPAs seem (= no non anecdotal evidence at hand) to suffer from this problem more often and worse. -
@sbiewald JS that blocks rendering for 10 seconds is a sign of bad Developer. No Rendering takes 10 seconds. That's not a JS thing. Not Using JS is also under utilisation of browsers capabilities. It doesn't take much power to render a page. Client-Side rendering also allows a bunch of other features, like caching, offline compatibility and stuff. Client-Side routing allows reusing the page template and changing only what's necessary. We are not living in ancient world where JS was barely supported. We should use as much JS, to reduce load on Server and improve UX.
-
@theabbie Yes, and I never claimed this is not the case (although caching works w/o JavaScript).
About your last statement (reducing server load): I think this approach is wrong - it more or less means "let's let everyone pay to reduce my costs". -
@sbiewald When we say modern web, we mean modern web browsers. What's the point of having modern web browser if you don't utilise it's capabilities. Some things are better done in front-end, Rendering is one of them. Backend has just one job, take data and process it. It should not be bothered about how front-end works.
-
@theabbie Because shifting the load to the client has a few issues:
- It can cost a decent amount of processing power, which can cause faster degradation of batteries in mobile devices.
- You now need to take more devices and more browsers into mind (since some browsers add non-standard features or behaviours)
- A single issue in the code can lock-up the entire browser (I've had this plenty of times, don't tell me "it doesn't happen on fast machines, since my machine is pretty fast), whereas a server-side rendered app generally will just load and load and them time out after a little while without locking the browser.
- Caching often becomes significantly more inefficient when something changes relatively often (especially when bundling shit together, which is often the case).
Don't get me wrong, I use client-side rendering at times as well, but I keep it to a minimum.
Most of my website is SSR with some minor CSR for stuff like the Twitch status. -
hjk10156964y@theabbie first of all the routing thing is just a weird comment. No language is made for routing. It's something api gateways, (application) load balancers and webserver like Apache and Nginx where designed for. Even Go that has a webserver in the stdlib is used often with gorilla mux for routing or other libraries that support JSON:API or GraphQL. If you actually checked out the benchmark link in OP you see that PHP is dominating the top 5 performance wise in request handling. Making it actually one of the most suitable languages performance wise for that case.
@FinlayDaG33k @sbiewald @AleCx04 @100110111 are completely right. Thank God not everything is forced into SPA yet. The trend is already eating up memory like crazy. My 8GB laptop seems lacking because of this shit, and yeah it's still fragile. One tiny mistake/browser difference and your whole website is down/crippled. There is a rant here about an API that has to return JSON of 600MB. There is a lot of data leaking in SPA apps. If I have to scrape something there is nothing that helps me more than a SPA based search engine to get their entire database in a jiffy. Sometimes i only have to do one request.
The most important thing for you SPA lovers to realize is it's stupid for content that is inherently page oriented.
I'm a big fan of static content generators with a touch of form/api handling by backend. It's as fast as it's going to get. Even a full CDN cache flush has almost no impact. Both client and server side resource usage is tiny. -
@hjk101 You are using PHP and are happy with it, why Rant about it? You're insecure that better languages will take over. If you have to use other languages at work, just do it, nobody is required to use ancient languages just because you like it. If none of the above is the case, there's still nothing to rant about. You grew up in era of PHP, people are now growing up in a different era. If PHP is working for you, just go with it.
-
@theabbie your lack of reading comprehension abilities never cease to amaze and amuse me.
-
hjk10156964y@theabbie Dude it looks like you read with tunnel vision. Even my profile states that Go is my favourite language. It's that not modern enough for you? Is ECMA script all the sudden more modern? You asked for a benchmark I gave you one off the bat (wonder what will happen when they test php 8 by the way)
I know 11 programming languages (could be more, not counting html/css and data formats) I use at least 5 of them regularly professionally. PHP is one of them and as a language it's way nicer to work with than people give it credit for. I rant about the about the crap I get for liking/using it. It's literally the first line in my post. -
@hjk101 People Randomly Tell you that PHP sucks? It's not one-way, if it's that way, stop talking to those people.
-
@hjk101 ”I use at least <X> of them (languages) professionally. PHP is one of them and as a language it’s way nicer to work with than people give it credit for”
THIS. -
@hjk101 I looked into building my site as an SPA but noticed how inefficient would become to do so...
Currently, loading my site and all core assets like CSS and JS (images are lazy-loaded) costs you around and about 300KB according to Firefox's network monitor...
Most of that is my "vendor-js" bundle (which just contains JS libraries that are not mine and unlikely to change anytime soon), though I can still decrease that (by getting rid of prism.js, which is on the roadmap). -
@theabbie modern !== good though...
And "better" language is abstract and depends on a variety of metrics.
For me, PHP is the best language because it's easy to read + understand and allows me to get stuff done quickly.
Performance-wise, PHP is adequate enough for me as well.
I could have written my site using "modern" stuff like NodeJS but that would take me more time to build, become more like spaghetti than code and as a result, become less maintainable over time.
If PHP was really that bad as you make it out to be, people would be declining in use while, according to statistics, it's usage is actually growing. -
@FinlayDaG33k you like PHP, you use PHP, you can maintain PHP code
Someone else likes nodeJS, they use nodeJS, they write good nodeJS code, they can maintain their code.
It's that simple, these language wars are stupid. -
@theabbie there’s no language war going on here, just you spouting out ignorant nonsense
-
@100110111 There is no need to keep boasting about your love for a language, if you do, you will also have listen why you're wrong. PHP is just good enough, if you want to use it, go for it. If you're getting bothered by other people saying that it's bad, that's nothing to rant about.
-
@theabbie you really don’t get it, do you? Learn to read without tunnel vision and you might actually understand something, at least.
Gosh, why do I even bother with you? -
@100110111 you should ask that to yourself, OP is clearly ranting about people telling him PHP sucks, and people are right, OP is too ignorant to understand.
-
@theabbie pot calling kettle black. Well, guess I get some weird kick reading your nonsense. Makes me feel like I’m not that stupid after all.
-
@100110111 Tracing back to my first comment, PHP is only popular because of being one of the earliest, which is the ultimate truth, nothing to argue about, but you can't resist, unfortunately.
-
@theabbie that is an oversimplification, yet partially true, I’ll give you that much.
-
@100110111 I should get more apparently stupid people to join DevRant so that you don't get bored.
-
hjk10156964y@FinlayDaG33k Nice job! You looked into it and chose the best option. Wish more of us would do that.
-
@hjk101 Indeed, a lot of people tend to not do this and often just go what's popular.
even within a specific language there is still a lot of the same stuff... in PHP, that'd be the Laravel vs. Symfony vs. Phalcon vs. CakePHP vs. CodeIgniter...
I just stick with CakePHP because it's easy and just makes sense to me (mostly)...
I don't have all the time of the world nor do I have hundreds of colleagues that help me out...
My website and most projects I maintain are just me (though it's all OSS, so people can join in), so I need to take the stuff I can use to write maintainable code with adequate performance quickly...
And for me, that's PHP with CakePHP.
Pick the tools for the job, not the job for the tools. -
hjk10156964y@FinlayDaG33k you are completely right. I always say use the best suited tool for the job unless the cost outweigh the benefits. Perhaps a different technology is better suited for the problem but if it will set you back several months or the organisation can't support it; it's still the wrong tool.
-
@YADU PHP is good, it has good performance, but, web servers rarely need performance, it should be easy to use, and, the stuff I make is naturally suited to other languages, thus, PHP isn't the best fit for me. If it is good fit for someone, they should use it.
Related Rants
Fuck you haters, I'm not dying of corona so PHP dies with it.
PHP is an amazing language. It has evolved nicely has almost all high performing functionally you need build in. Has a good package manager eco system. It's insanely fast (since 7.0, older versions where just fast with opcache).
Most of the called out inconsistencies are actually because it is consistently following C/POSIX equivalent or people that don't understand dynamic typing (it doesn't mean any shit will stick).
https://awesomeopensource.com/proje...
Fuck off with your JS backend solution because it's faster...
This is a big thanks to all the amazing members of the PHP community that worked hard to make PHP the great language it is today!!!
rant
php
backlash