Earlier quoted context omitted.
What isn't fake is that Laravel uses magic methods everywhere, especially in the ORM layer. There are way too many magic things happening under the hood for my taste.
Magic methods in PHP are very commonly used to help reduce code verbosity - having come from working mostly in C++ I appreciate being able to express things succinctly.
PHP in 2019
451–460 of 489 posts
Re: PHP in 2019
#452Earlier quoted context omitted.
I do. I was using it back in 2003... pear/DB. I still have some code from that era that uses it.
Would you use a pear dependency in a new project if you weren't pulling bits in from an older one? Personally, I wouldn't... I worked with pear and pecl and composer is just far more pleasant to interact with.
Re: PHP in 2019
#453Earlier quoted context omitted.
Old PHP projects can be upgraded in the present because backwards compatibility exists, as i metnioend in other comment I done such a small upgrade and I hat to change only 1 deprecated function with a different one. If this would not have been possible the project would have still be running on an old version without security fixes and slower(eating more electricity so bad for environment)
If you say so. ~5 years ago I had to work a full week, 8h a day, to fully upgrade a medium-sized website from PHP 5.2 to 5.4, and eventually gave up. Most of the time was spent trying to cope with different datetime parsing idiosyncrasies.
I had some problems with mysql updates though, new versions had different)better default behavior). we were using an ORM for the project but the initial setup and migrations were made in plain SQL and those needed to be updated. As an example in older mysql you could have a timestamp column NULL with no default value set and now we needed to fix to set a curenttime as default.
Re: PHP in 2019
#454 public function getSomething(int $someParameter): SomeType {
return $this->someParameter;
}
If this, along with the fanfold block comments you see in modern PHP, is considered "clean code" I'll take procedural PHP4 any day of the week. Why PHP5 had to be reborn as the scripting version of Java I'll never understand.Re: PHP in 2019
#455Earlier quoted context omitted.
Yep. Laravel is basically PHP on Rails. They do a great job with it too.
I dunno... Their home page looks like something out of the Panera Bread playbook looking at the homepage. 'Web artisans'? Why is it 'clean' because it has an absurd amount of whitespace and comments of platitudes for the code example?
Re: PHP in 2019
#456I just took a random sample from Spatie's PHP libraries - https://github.com/spatie/crawler/blob/master/src/Crawler.ph... . Most of the code consists of: public function getSomething(int $someParameter): SomeType { return $this->someParameter; } If this, along with the fanfold block comments you see in modern PHP, is considered "clean code" I'll take procedural PHP4 any day of the week. Why PHP5 had to be reborn as t…
Re: PHP in 2019
#457Earlier quoted context omitted.
I've been coding in PHP for almost 20 years now. I think I can count on one hand the number of times where I have had an issue regarding inconsistent function signatures. It becomes second nature, and if I forget, the documentation is available online or in worst case built into my IDE. I can understand why people make this into such a pain point, but quite frankly it isn't for anyone who works day in day out with PH…
23 years here (php/fi in jan '96) and I probably hit the 'parameter order' issue more than you. I still need to look param order stuff multiple times per year. Normally I can get it in the IDE, but doing remote vim stuff, for example, I need to look it up. Yes, it's technically a non-zero problem. I get it. Having spent several years in the Java/Spring world, the classic ASP world, and the Perl world... they all have…
That said, I don't have is a lot of experience with other frameworks in other languages to compare it to, so I don't exactly know how it compares.
Re: PHP in 2019
#458As far as I'm concerned the bridges have burned a long time ago and I definitely can't see myself giving PHP a second chance. That being said, if I'm wrong and PHP has really managed to become a decent language (or at least something that's not completely insane) its defenders should focus on actually showing what modern PHP code looks like. Is performance that much of a big deal for most people? In a world where Rub…
> Is performance that much of a big deal for most people? For most people outside VC-funded startups, yes it is. It is also an environmental concern, imagine if 80% of the web was running on ruby.
Re: PHP in 2019
#459Earlier quoted context omitted.
Tokens are issued from within the Spark customer dashboard and the token is required in order to pull the repo during install. It’s basically the honor system.
Thanks. I noticed they have a public repo with a tool that manages a way to download the spark code base. I'm guessing without a token you can't access whatever code that public tool pulls down, meaning you need an active token to get future updates of the code base? Pretty cool system if that's the case (there's motivation to keep your purchase to receive updates). I'm not asking to try and rip him off. I was just c…
Re: PHP in 2019
#460Earlier quoted context omitted.
My issue with modern PHP is that it's essentially becoming Java. And with the JVM and the Java ecosystem, what is the compelling reason to not just pick Java at this point? With Java you are basically writing exactly what you would be writing with PHP, except with more language features and the ability to opt into other languages on the JVM like Kotlin and Scala. The modern additions are fantastic for projects and te…
Except PHP is not Java, and it never can be. What is PHP's multithreading model again? Hotspot VM? NIO? I'm sure someone will chime in and cite something similar in PHP, but the comparison will be laughable in reality.
Since it's inception, the PHP implementation hasn't been threadsafe and since, the way of doing paralellism has been process forking. Later iterations where released with support for long-lived processes and threads but it's still not officially "stable" since again, historically the model of process forking made the ecosystem take for granted non-memory safety.
On the other hand, at least since the last time I was doing Java, paralellism is done via multithreading. Sure, there must be someone doing some else out there, but relevant frameworks like Spring work by making 1 thread by http request.
IMHO the right way of dealing with concurrency is the Node way. But comparing the PHP vs Java y think the PHP way is better. In small-medium scale the Java way is obviously more performant. The problem is when you scale to more instances. The PHP way of immutable processes really makes vertical scalling easier.