Earlier quoted context omitted.
PHP is so much nicer to use on a webserver vs Python or JS. It’s almost like PHP was built for the web and fits it like a tailored suit! Would I use PHP to make games? No! I wouldn’t use JS or Python for that either. I try to use the best language for the job without letting any cargo cult biases get in the way. Front end stuff? JS! Backend stuff? PHP! AI stuff? Python! Games and microcontrollers? C/C++!
Is it really that good for backend? 1. You will still need to learn JS, and now it may even be embedded in PHP depending on the type of app you are working with! 2. It still has horrible conventions, arrays being sorted maps has to be one of the worst design decisions, IMO its worse than having null and undefined as types. Mutlibyte strings are still an afterthought in the core of PHP. Inconsistent function naming. I…
Learn PHP the Right Way
41–50 of 73 posts
Re: Learn PHP the Right Way
#42Re: Learn PHP the Right Way
#43Earlier quoted context omitted.
PHP is so much nicer to use on a webserver vs Python or JS. It’s almost like PHP was built for the web and fits it like a tailored suit! Would I use PHP to make games? No! I wouldn’t use JS or Python for that either. I try to use the best language for the job without letting any cargo cult biases get in the way. Front end stuff? JS! Backend stuff? PHP! AI stuff? Python! Games and microcontrollers? C/C++!
Is it really that good for backend? 1. You will still need to learn JS, and now it may even be embedded in PHP depending on the type of app you are working with! 2. It still has horrible conventions, arrays being sorted maps has to be one of the worst design decisions, IMO its worse than having null and undefined as types. Mutlibyte strings are still an afterthought in the core of PHP. Inconsistent function naming. I…
Yes, you will. But to me this is an irrelevance: JS has IMO very little business near the back end. I have absolutely no patience for the JS-everywhere thing.
(It is never necessary to directly embed JS in PHP; there are always choices. Sure, you might sometimes need to briefly template your JS, but that's true of all web environments; it's fundamental to the problem)
> 2. It still has horrible conventions
It does. But for example JavaScript is still riddled with bad conventions. Look at the mess that inconsistent array/object duality, inconsistent property enumeration, has wrought across the language for a whole generation of programmers
> 3. It was built for the web as it stood 20 years ago, HTML embedded in code, single server sessions, cgi servers, and minimal latency server to server communication.
So was JavaScript.
Laravel is, I think, the most sensibly-designed web framework that has ever existed. Every single other framework I have used has disappeared too far into the developers' own biases towards tier after tier of NIH decisions. Laravel doesn't have pretensions.
(I used to love Ruby on Rails but even I remember when the people who were the talk of the developer world with their brand new easy to use developer framework did not know that GETs should be idempotent)
Re: Learn PHP the Right Way
#44Earlier quoted context omitted.
PHP is so much nicer to use on a webserver vs Python or JS. It’s almost like PHP was built for the web and fits it like a tailored suit! Would I use PHP to make games? No! I wouldn’t use JS or Python for that either. I try to use the best language for the job without letting any cargo cult biases get in the way. Front end stuff? JS! Backend stuff? PHP! AI stuff? Python! Games and microcontrollers? C/C++!
Is it really that good for backend? 1. You will still need to learn JS, and now it may even be embedded in PHP depending on the type of app you are working with! 2. It still has horrible conventions, arrays being sorted maps has to be one of the worst design decisions, IMO its worse than having null and undefined as types. Mutlibyte strings are still an afterthought in the core of PHP. Inconsistent function naming. I…
Re: Learn PHP the Right Way
#45Earlier quoted context omitted.
Is it really that good for backend? 1. You will still need to learn JS, and now it may even be embedded in PHP depending on the type of app you are working with! 2. It still has horrible conventions, arrays being sorted maps has to be one of the worst design decisions, IMO its worse than having null and undefined as types. Mutlibyte strings are still an afterthought in the core of PHP. Inconsistent function naming. I…
PHP may have been built for the web (backend) as it was 20 years ago, but JS wasn't built for backend at all , so, if I had only the choice between PHP and Node (or one of the many Node alternatives), I would still pick PHP. Pretending that "you only need to learn JS, and hey, with Node you can also be a backend developer" has led to too many flaky backends already.
Re: Learn PHP the Right Way
#46Earlier quoted context omitted.
Is it really that good for backend? 1. You will still need to learn JS, and now it may even be embedded in PHP depending on the type of app you are working with! 2. It still has horrible conventions, arrays being sorted maps has to be one of the worst design decisions, IMO its worse than having null and undefined as types. Mutlibyte strings are still an afterthought in the core of PHP. Inconsistent function naming. I…
> arrays being sorted maps has to be one of the worst design decisions. I'm curious, why is that so bad? It tends to be a useful property of PHP arrays. Also for webdevelopment, I/O is often the bottleneck. This code creates an array with 1 million items, each being 'a' and then loops over each value, changing them to 'b': $array = array_fill(0, 1000000, 'a'); foreach ($array as $key => $value) { $array[$key] = 'b';…
It does hint that perhaps bearjaws is (lucky for them!) too young to remember the mess that incomplete implementation of array/object duality got the JS world into.
Re: Learn PHP the Right Way
#47The only reason to learn PHP in 2024 is if you are specifically targeting PHP jobs. Learning PHP is like learning Perl: suboptimal. Edit: Jesu X. Chris, I didn’t mean to start a language war. Learn PHP if you want, I won’t stop you lol
Lot of that going around; especially in venues like this, which has a lot of "Ooh! Shiny!" going on. I tend to be a bit more conservative than many; but not to any kind of extreme degree. I like new stuff, but I also like shipping, which doesn't come from the bleeding edge.
Personally, I use PHP on my backend work, mostly because it's a known quantity, and is an industrial-strength, massively-supported system, that is not going anywhere but up.
And I don't feel like learning a whole new language and API, just for some relatively minor-scale server work (I spend most of my time, writing native Swift frontends).
If it's good enough for PornHub, it's good enough for me.
That said, if PHP were, as is often falsely claimed, going away, I'd probably learn something new. I doubt it would be the tip of The Shiny Spear, but it would be a more modern system; maybe Python. I've never actually liked working with PHP, but the same could be said for most languages I've used. I like Swift.
As it is, I would still want to learn Laravel, before moving away from PHP. From what I understand, it's a fantastic framework, that makes PHP a much more effective server system.
Re: Learn PHP the Right Way
#48Passively watching YouTube is probably not the right way to learn any progamming language.
Anecdotal at best, but that is essentially the way I learned English, and definitely the reason I think I don't have a distracting accent when talking in English.
Re: Learn PHP the Right Way
#49Earlier quoted context omitted.
Is it really that good for backend? 1. You will still need to learn JS, and now it may even be embedded in PHP depending on the type of app you are working with! 2. It still has horrible conventions, arrays being sorted maps has to be one of the worst design decisions, IMO its worse than having null and undefined as types. Mutlibyte strings are still an afterthought in the core of PHP. Inconsistent function naming. I…
If it wasn't that good for a backend it wouldn't have maintained complete domination of that market for decades, which it has. Incidentally the number of web development projects that have any objective use of async programming or fussy types is a rounding error. Perhaps your interests are pointing in another direction?
I can see applications for async work within the wider backend all over the place.
But the objective justification for the async stuff being involved in the rendering of page content is thin.
And since the other applications are for sort of "high level systems" programming -- that boundary between the app and the OS -- I personally prefer Go for all of that.
Node is a significant devOps/package management pain that belongs in as few places as possible.
Re: Learn PHP the Right Way
#50Earlier quoted context omitted.
Please give me some examples!
Learn a functional language like Elixir. That’ll prove both useful and mind expanding!
I agree it's mind-expanding.
But I don't think most web development work is mind-expanding or a realistic application for it.
I also don't think using it to criticise PHP is really the right target. If you want to use a functional programming language/environment as a critique of modern web development... maybe start by targeting server-side JS.