That sure is a big a web page for having no table of contents! There’s a ToC on https://leanpub.com/phptherightway but I can’t link directly to it as the in-page link uses JS. (I’m on mobile though, so I can’t read the source. Maybe there’s an anchor someone else could link to.)
I'm not sure what you're seeing, but for me the page starts with a massive ToC. On even smaller screens it turns into a button fixed at the bottom of the screen that opens a ToC in an overlay.
PHP – The Right Way
91–100 of 349 posts
Re: PHP – The Right Way
#92Earlier quoted context omitted.
What tools? What server language today except PHP (and its forks) is actually designed for the web and works as the web was intended?
What server language today except PHP (and its forks) is actually designed for the web and works as the web was intended? The implication of the question is that there's something designed into PHP that makes it better for working with web things. Why does the language need to be designed to work with the web? That part of any language can be filled out with a framework quite easily, and arguably that means it's much…
That has always been the goal of PHP, to be a web framework in itself (and now we have frameworks on top of that framework). It's trivial to read POST data as understanding POST requests are built-in into the language. With Rust or JavaScript you either will pull down a external library to handle that for you, or write a ton of code to make it easier for yourself. With PHP, it's literally one-line of code.
It is not as rigid as you might believe, as we have frameworks on top of the native PHP framework already. That's not to say PHP is without compromises, it's not suitable for a bunch of different projects (you wouldn't write mobile/desktop apps with it for example). But if you have a simple CRUD application that just needs to output some HTML data and persist stuff to a MariaDB/MySQL database without wanting to pull down a bunch of 3rd-party dependencies, PHP will make that effortless compared to basically any other language.
I think the popularity of PHP for web development speaks for itself, it basically conquered that segment of development when it first appeared, and is still more-or-less king, even with its warts.
As a last word, I like that languages specializes in different things, not every language has to be a general-use language, and I hope we see more of that in the future. Darklang specializes in building backend APIs for example, others specializes in being for UIs and so on. As every language more or less looks like C today, there is plenty of room for innovation in programming language design (and no, not talking about TypeScript which is basically just C# that compiles to JavaScript, but more different languages).
Re: PHP – The Right Way
#93But what's the point? The beauty of perl scripts, and later php templates, was in their BASIC-like simplicity. They were not secure or structured in any way, but very accessible. Once you add these frameworks, you realize you could have started with Python or Java in the first place and get more mature infrastructure and better language along the way.
Re: PHP – The Right Way
#94Earlier quoted context omitted.
Quoted post unavailable.
Why do you presume this is "hearsay PHP hatred"? I (not parent) have PHP hatred. It is fuelled by decades of PHP development and -exposure. My hatred is based on failing projects, missed deadlines, burnouts, money stolen, severe downtime, and companies going bankrupt. PHP had a role (not the primary, mind you!) in all of them.
Re: PHP – The Right Way
#95But what's the point? The beauty of perl scripts, and later php templates, was in their BASIC-like simplicity. They were not secure or structured in any way, but very accessible. Once you add these frameworks, you realize you could have started with Python or Java in the first place and get more mature infrastructure and better language along the way.
What does this mean?
Re: PHP – The Right Way
#96Earlier quoted context omitted.
> But, really, I suggest using other tools. We have nicer tools now. Citation needed. For folks not wishing to switch frameworks and tooling every year, you can get a lot done with PHP.
> Citation needed. I really like Django as an opinionated framework. I have also used Flask, Falcon, and FastAPI, all with good results in their own niche. I also like Play and Scala and Spring Boot with Java. > For folks not wishing to switch frameworks and tooling every year, you can get a lot done with PHP. You can also get a lot done with wood and nails, but that doesn't mean it's the best tool for all kind of jo…
Re: PHP – The Right Way
#97Earlier quoted context omitted.
Well... I wouldn't recommend JavaScript. TypeScript is much nicer and removes a lot of the JS pitfalls.
And pulling ~67 dev dependencies just to be able to transpile TS to JS? No thanks. https://www.npmjs.com/package/typescript
Re: PHP – The Right Way
#98And the good news given to me by a colleague is that they pulled the same stunt going from 7.3 to 7.4. It's like depending on stumbling alcoholics instead of language designers.
Not much has changed since core devs tried to mitigate an overflow by testing for "$variable < MAXINT".
Re: PHP – The Right Way
#99Earlier quoted context omitted.
> But, really, I suggest using other tools. We have nicer tools now. Debatable really. Within the web development space the options are rather limited in my opinion. Options: * Spring based apps - Downside JVM is a Resource hog * Python, Ruby, etc - The web frameworks are in my opinion not as full featured. Same with CMS systems. Also requires more resources. Also have limited OO features. * Go, Rust, etc - Really go…
Java, .net, C#, typescript (not my favorite) are all commonly and often used for Web Development. They are sane languages with large ecosystems and solid frameworks for web-dev.
I've spent a lot of time using PHP professionally and then coding all my personal stuff in Python/Go/Scala/Kotlin/etc. I know the downsides of PHP and I know the upsides and I often prefer coding in other languages but PHP really does have it's place.
Re: PHP – The Right Way
#100Earlier quoted context omitted.
We use Asp.NET and it is a giant surprise how good it is. We are unix ppl, Linux & MacOS so not a MS shop at all. We deploy to on-prem and AWS so no Azure.
It's been so long since I've done ASP that it just when .NET was coming out. I would be interested in checking it out nowadays. WHen I last used it all the cool features were heavily coupled to MS products, is that still the case?