Yep, PHP is turning 30 this year! Wondering if “PHP is still relevant?” Ever since we have been hearing that PHP is dead. It was “dead” 10 years ago, 5 years ago, and “is dead” today. But somehow - it isn’t. Anyway… happy birthday!
Yep, PHP is turning 30 this year! Wondering if “PHP is still relevant?” Ever since we have been hearing that PHP is dead. It was “dead” 10 years ago, 5 years ago, and “is dead” today. But somehow - it isn’t. Anyway… happy birthday!
Python is a natural evolution for web development, especially once you’re past the fundamentals. For someone with no scripting background, PHP is easier to approach. The syntax is more direct, and basic debugging doesn’t require any setup. An error happened on x line is the default behavior.
Python’s logging system can be tricky to configure properly if you’re unfamiliar with the factory and error level handling. Those green people don’t have any idea where to put the log or how to let the web server talk to it safely.
It’s the little bs like refusing for years to include switch, then when they finally give, they just refuse to allow fallthrough. It’s like they said, fine, but it’s got to work slightly differently and we don’t like the name… it feels childish.
All things considered, Python has a richer ecosystem and deeper long-term potential. But there’s something to be said for how quickly a basic PHP site can be spun up and debugged with minimal knowledge with minimal friction. And that’s why it’s still around so much today.
I agree that PHP was easy to pick up, but I already knew several programming languages and was quickly shooting myself in the foot with the extremely overbuilt, redundant, and buggy builtin functions. At the time, though, it was either that or ASP, so I chose the lesser of two evils.
To segue, switch statements aren’t inherently necessary for a mature programming language; I think that addition was partially to mollify the growing userbase (not a good reason), but on the other hand it’s really just structured pattern matching wearing a hat that says “switch” on it … though again, that’s something which could fairly trivially be achieved with a list comprehension. It’s not like you’re getting the machine-code-level optimizations that a C compiler could churn out for a proper switch statement.
I personally feel that giving the growing user base things they want is probably the most prudent reason. Constantly refusing to provide simple constructs that are available everywhere else It’s not a good look. In the open source world if you do that shit enough you end up getting forked.
The context and ease of switch in a functional programming layout is a rather clean implementation.
Otherwise you end up with the crap like they’re pulling with flask were you just make an unnamed, unindexed number of functions. Can you sort and organize your functions and make everything clean? Sure you can. Does it happen by default? Almost never.
You can walk up to someone else’s switch and see what the options are. The code flows through that simple construct and it’s very easy to understand someone else’s work.
I load up someone else’s flask endpoint, It’s just this multi-page stream of consciousness.
You don’t need switch, But there’s a reason why so damn many people ask for it. Before they agreed to include “match”, They said just to use getattr and write your own switch.
I think I agree with you, and I also think you probably know better than me, but - Python couldn’t become what Python became without doing this exact thing very deliberately, bordering on obnoxious at times. Fundamentals or “initial state” define the characteristic strengths and weaknesses for a language, but what to add and what not to, as well as “why” and “how”, over time determine the true shape and user experience (lacking a better word there) of a language.
Despite its reputation, in my view Python has always been far more opinionated about how to do things than most give it credit for.
Yeah, I don’t take exception with most of their choices, and to be perfectly honest PHP has historically made a number of really bad choices and refused to fix horrible bugs.
I just feel that providing the handful of tools that have been available since C and keeping them with the same name and the same argument position only makes sense.
If people aren’t cloning Python commands for their design sensibilities. When they ask for a creature comfort that doesn’t affect performance, It should be more strongly considered.
I guess I should be thankful that they were no longer demanding GOTOs.