Earlier quoted context omitted.
Php's inconsistencies in regards to needle vs haystack make me weep. Javascript doesn't have anything remotely like that.
JavaScript absolutely has things like that. Very famously so. https://www.youtube.com/watch?v=et8xNAc2ic8
PHP in 2023
191–200 of 285 posts
Re: PHP in 2023
#192Earlier quoted context omitted.
Php's inconsistencies in regards to needle vs haystack make me weep. Javascript doesn't have anything remotely like that.
I hope you realize that "fixing" these types of early mistakes is almost impossible for PHP, a language which tries hard not to break things, especially something that's going to be used everywhere. But if this is such a deal-breaker and your IDE is dumb as a stump and can't remind you nothing prevents you from wrapping the stdlib or using something like psl to do it for you.
I do, yes; which means early mistakes stay in the language forever; same as in javascript. More's the pity.
Re: PHP in 2023
#193Earlier quoted context omitted.
JavaScript absolutely has things like that. Very famously so. https://www.youtube.com/watch?v=et8xNAc2ic8
Notice that lots of (probably most of; maybe even all) examples in the linked talk are due to unreasonable inputs. `true + true` doesn't make sense; `{}.toString().call(new Date())` or `+[] === +![]` don't make much sense either. This is just not what developers do. Meanwhile, iterating over arrays is absolutely what developers do, on an hourly basis. Which is why I said that javascript doesn't have things like that…
Re: PHP in 2023
#194If you are thinking about building a web application, take a look at Laravel. I not a huge PHP user, but Laravel is always on the top of my list for building web applications. It's the greatest web framework to ever exists, even better than Rails IMHO. The ecosystem around Laravel is really incredible and unlike any other framework. They have libraries for every stage of a web application from taking payments all the…
Take a look at Symfony before Laravel. It will be very similar to Java developers who are familiar with Spring.
Re: PHP in 2023
#195I started my career with PHP. Created my own apps, created client websites etc. Full of footguns, but I didn't know any better. Once I learned more languages, I never used PHP again. I actually started to feel like I'd been fooled into using PHP. Now the small PHP community keeps trying to justify their language choice with articles like these and comments like the ones on this submission. They claim it's a no braine…
> PHP devs hate dissent it seems.
Perhaps, but do they hate dissent as much as non-PHP devs hate PHP?Language wars are silly.
Re: PHP in 2023
#196Re: PHP in 2023
#197I started my career with PHP. Created my own apps, created client websites etc. Full of footguns, but I didn't know any better. Once I learned more languages, I never used PHP again. I actually started to feel like I'd been fooled into using PHP. Now the small PHP community keeps trying to justify their language choice with articles like these and comments like the ones on this submission. They claim it's a no braine…
Re: PHP in 2023
#198Earlier quoted context omitted.
PHP is far from my primary language, but in no universe is the language that powers so so much of the internet "small".
Website traffic to servers running the language is not necessarily correlated with the size of the community
how twisted does your dislike of a language have to be for you to not even acknowledge that a lot of people use it
Re: PHP in 2023
#199used php in 2015, decided that it's not that nice. last couple of months, I've been banging my head with php7. granted, it's a legacy project, but it is still the same php 7-8 years ago.
PHP 7 is actually pretty good and was the version I stopped at. Upgrading to 8 shouldn't be all that bad and mostly you can just install the new version side by side with the old one. As with any interpreted language, you have to hit every page and what not in order to see if there are any issues that will arise. I don't know if at this point if PHP has a compiler as that would save a HUGE amount of time upgrading to…
Re: PHP in 2023
#200Earlier quoted context omitted.
Uhm, how about PHP attributes, getting rid of comments / annotations? Named arguments? Constructor property promotion? Readonly properties (8.1) / classes (8.2)? Arrow functions or typed properties (both 7.4)? I'd say those are really cool things. Especially as a web developer, there's just so much boilerplate I can get rid of since using 8.0+.
I’m in agreement with you that it came a very long way. Now, most of those have been present in many other languages [0], often with less limitations. And as usual the old ways haven’t all been deprecated either, so it stays weird. For instance typed properties were a chance to reset the clock on type handling, but no, declaring a type will force cast parameters to that type instead of throwing an error (i.e. passing…
Constructor property promotion is fine, I think. I think it ties in well with the readonly property.
public function __construct(
public readonly Company $company,
)
{
}
There's just so much info & functionality + type safety crammed into there that wouldn't have been possible previously; it's really nice.