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
-
Well, PHP still powers Wordpress (CMS with the highest market share), Joomla, Typo3, Drupal, Magento, OSCommerce, XTCommerce...
And hell, for small tasks (C2 anyone?) it still gets the job done. -
C0D4681466yThe problem is, that 0.6% of the dev community are bloody loud about it, while the other 99.4% dont need to excerpt our languages on others.
-
inaba46256ySer, tjener problem with that statement is that it doesn’t say how much of the used web that php powers.
There’s Wikipedia, Pornhub, and Facebook (whose backend is mostly c++ as well iirc)
Php is also mainly used through the different cms systems, which also complicates statistics given all the 1 click installers and web hotels -
henlo32876y@C0D4 I just felt they're bumping the numbers on php. Maybe this statistic isnt very accurate as @inaba says
-
C0D4681466y@yatanvesh I get that. I actually would like to know how they derive their stats at all, it’s not like they have access to every host.
-
Fexell6586yYeah. Please compare a language that has been out since 1995, while nodejs has been out since 2009. Of course php is going to win, in usage across the web. PHP had a 14 years head start, and has been out now for 23 years, while node has been out for 9 years. It's not even a fair match.
But, this should also tell you as to why a lot of previous php developers are switching to nodejs. At this point, PHP is a bit "bloated". There are also a lot of cool functionalities in node js that are pretty much impossible to replicate in pure php. -
PHP sucks for bigger projects. For CMS and everything small will go with PHP anytime.
-
C0D4681466yServersideJavaScript is nothing new late 90’s if memory serves me right.
it’s just trendy to use ram hungry, inefficient code that needs a folder of dependencies larger then a basic LAMP stack, and this is what gets me, just to write
Console.debug(“yay”); -
1. Prevalence does not equal demand. There are still more websites using Shockwave Flash than React/Angular/Vue combined, doesn't mean there is more developer demand for the former, because those are mostly abandoned/stale products.
2. However, there is still a lot of demand for PHP. "Still" isn't even the right word, because it's not that likely to change. PHP7 is not the prettiest language, but it's competitive and easy to learn. Usually people yell "x is dead" when it's getting mainstream — For example, both Ruby and Java have been climbing despite rumors of their demise. What people truly mean is: "The hype is dead" — the language has grown up.
3. Of course, we as developers should continue to bitch about the mainstreamed languages, and should continue to experiment with new technologies. The old hated languages are slowly improving only because of our death threats, merging obviously useful features from popular experimental projects — effectively eliminating those they borrow from. Without HHVM PHP7 might have been much more boring and complacent, and without coffeescript ES6 might have missed out on some great destructuring & arrow syntax. -
Comparing a runtime to a language as a whole is the same as comparing an apple to the taste of a train.
-
@OPM46
PHP was being carried by WordPress & Magento for small business, but Symfony & Laravel made it viable for somewhat more serious projects again.
Laravel has some scaling issues (I work on a platform with 1M+ daily users), but so does every other highly abstracted high level framework.
There are two convenience features I really miss in PHP: A succinct way to create compound/polymorphic types ("array of ints", "collection of users") so they can be typehinted, and prettier callback syntax (arrow functions).
All of the other ugly stuff like the datetime mess and parameter inconsistencies can be easily addressed with libraries such as Collection and Carbon. -
hell169536yAm I the only one who is gonna say anything about "static-files" in a rank about "Usage of server-side programming languages"?
-
C0D4681466y@hell it seems to be bad data, well sort of, as it’s websites without any server side, but just HTML or plain text.
“Static websites don't use any server-side programming language for generating web pages, but deliver fixed content which is created manually or with an offline tool.” -
SaberCZ76yWell, WordPress is often installed by non-programmers. They might even don’t know what PHP is.
Statistics of how many programmers use specific language might be more interresting for me. -
@hell no, I noticed the same. Fast and no hassle where they make sense. Bonus points for using a C ompiler as static website generator.
-
inaba46256y@C0D4 lmao you’re in a thread where the op does the very same thing you say you don’t need to
-
@SauceBoss
PHP is carrying a lot of baggage with it, so the transition to a better type system takes time, but the intention is there. From PHP 7.4 onward you can declare typed properties in classes:
https://wiki.php.net/rfc/...
(That jab at python lol)
In terms of Laravel query performance & caching, yeah it's a bitch. Active record queries are really bad for complex aggregate data, in some cases you really need complex joins. subselects, mergebindings, and joining on DB::raw statements can get you pretty far.
Our main DB is MySQL, but for some stuff I've written layers on top of other databases (InfluxDB, Elastic, Neo4j) in other languages (Haskell, Go, Python, Rust) and either let our main Laravel monolith grab the results of those services through Guzzle, or let those services warm up cached keys in Redis which can be read by Laravel. -
@SauceBoss Just to give you a stupid hypothetical example, do these things in Laravel:
1. Use selectSub to isolate parts of your query. You can throw anything in there, and link it up with the "parent scope" using whereColumn. This way, you can safely add joins you need to calculate the price of a product, and it won't conflict with other selects, eager loads & scopes.
2. For your own sanity: Extend the builtin expression class. Expressions are just strings (they have a __tostring magical method). This way you can replace ugly selectRaw('avg(column + column)') stuff with a more familiar fluent syntax. We even have it automatically resolve the right syntax per database grammar.
3. You can use Builder::macro to define new SQL design patterns unrelated to models. For example, if you want to perform a relational division (often to do with finding the optimal match between supply and demand), you can set the pattern using a macro. -
@bittersweet There's like a million errors in that screenshot but fuck it im drunk
-
@SauceBoss Yeah Laravel and IDEs.... or Laravel and static analysis... or Laravel and unit tests... all pretty frustrating at times.
Sometimes I love facades and all the container stuff, but it can be frustrating when you're trying to dig into the framework to figure out how stuff works.
I encourage all Laravel devs to spend a weekend exploring how Eloquent works behind the scenes, how __call(static) is used to fall back from model to querybuilder, how models get hydrated and cached. Not only does it explain a lot of the quirks, but it also allows you to write your own plugins.
For example, I always override the builtin getRelationValue on Models to perform some extra checks -- I don't want $user->name to return null if I forgot to select it in the query, I want it to throw a hard exception so I can catch it during development. -
The code word here is “legacy”. Nodejs is very new compared to php and is picking up speed. Even Netflix changed their backed from php to Nodejs 🧐.
Ohh... Wordpress and other vulnerability distribution systems are in php and all that... -
feroza9776y@Kristiyan Node.js was released almost 10 years ago, I'm not sure that qualifies as "very new" anymore. In the specific use case of Netflix, Node is more suitable, but in other cases PHP is a better choice.
Of course, we know all of the programming stereotypes - Ruby is slow, PHP is ugly, Python is for wannabe script kiddies, WordPress security sucks etc. In the end of the day, if you keep it up to date and don't use insecure third-party plugins you won't have any issues whatsoever.
Since WordPress powers as much as 20% of the internet, it is obviously a priority for hackers and exploiters, when compared to a Node.js CMS such as Ghost, which powers less than 0.1% of websites.
:) -
@SaberCZ I am using WordPress for my site, because I simply haven't got the time to do it myself.
However, am I the only one around here who notized that ASP.NET is on second place? 😵
Oh my god, PHP is so dead.. Node.js is totally kicking ass by powering 0.6% of the internet!
rant