Live data from Hacker News

PHP – The Right Way

phptherightway.com

81–90 of 349 posts

Re: PHP – The Right Way

#81
post #14
post #6

Earlier quoted context omitted.

In the mid-00s the main selling point of PHP were shared hostings with mod_php which was a cheap way to host your own web site and database. Now with the cloud that advantage is utterly gone.

For my tiny website there is nothing that cloud brings other than being more costly. I have the same access to my shared hosting, and the amount of money per year is peanuts.

It very much depends on how code is written. A typical LAMP (style) stack wouldn't be any better on the cloud than it would on shared hosting. But if you can make use of serverless (eg lambda, S3 and/or DynamoDB on AWS) then that's where you'll start seeing some advantages.

https://murex.rocks is a static site that costs me pennies each month and has zero scaling issues. The site is fully automated too, built from CI/CD (Markdown converted to HTML) upon commits to a master git branch. But it was purposely designed to run on the cloud.

This isn't to say that shared hosting isn't a worthwhile option, just that cloud can be cheap albeit you do need to architect your project for using the cloud rather than lifting and shifting your existing LAMP stack and expecting that to behave the same.

Re: PHP – The Right Way

#82
post #16

Earlier quoted context omitted.

It comes from Laravel ( https://laravel.com/); "The PHP Framework for Web Artisans". The command line entry point is also called "./artisan".

Which by the way is heavily mocked by PHP developers actually using OOP, dependency inversion, hexagonal architecture etc. Which is not the "artisanal" way of development it seems :)

Mocked as in made fun of? Personally (in 7 years as a PHP dev) I've not found this. There was one company I interviewed at where the lead engineer thought facades were dumb, but then couldn't explain why he needed to rebuild the entire backend in Node. Perspective.

Re: PHP – The Right Way

#83
post #59
post #48

Earlier 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? I'd say Rails is a very nice DSL for building web applications that's written as an extension of Ruby. We have two dimensions here, one for how easily a language allows you to build a website, and how expressive, consistent and error-proof a language is. It's easy to build a simple website with…

Nobody in their right mind has put actual logic inside templates when doing PHP for a while now.

PHP has supported strict typing for a while now, making it also fairly consistend and error-proof.

There is nothing at all wrong with PHP and it's rapidly moving in the right direction.

Re: PHP – The Right Way

#84
post #59
post #48

Earlier 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? I'd say Rails is a very nice DSL for building web applications that's written as an extension of Ruby. We have two dimensions here, one for how easily a language allows you to build a website, and how expressive, consistent and error-proof a language is. It's easy to build a simple website with…

Razor lets you write C# inside templates.

Re: PHP – The Right Way

#85

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.

Re: PHP – The Right Way

#86

Earlier 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…

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?

Re: PHP – The Right Way

#87

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.)

To answer the immediate question, I had a look and nooope, no , not even anywhere, that I could find. However I just (begrudgingly) realized this is somewhere text fragments can shine: https://leanpub.com/phptherightway#:~:text=Getting%20Started

To answer the bigger-picture question, the first thing I see (the above-the-fold part) upon loading the page (on both desktop and mobile) is a stylized ToC.

Re: PHP – The Right Way

#88
post #77

Actually, that make me remember statements of Linus Torvalds on Git at Google Tech Talk Conference: But I did end up using CVS for seven years at a commercial company and I hated it with a passion. When I say I hate CVS with a passion, I have to also say that if there are any SVN users in Subversion, users in the audience, you might want to leave because my hatred of CVS has meant that I see Subversion as being the m…

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

#89
post #74
post #61

Earlier quoted context omitted.

But you suffer the indirections caused by the fat stack that is needed to deal with the missing import system. In Python, "import" actually imports the code. In PHP, the "use" statement you see everywhere does not. It only works because the code has already "magically" been imported. Usually by composer. Thats why there are tens of thousands of hits for "clear composer cache" on Google. To just point out one issue wi…

The fact that composer comes with an autoloader doesn't means that you have to autoload everything. You can manual include, define your own extra auto loader and use interfaces to quick swap for custom implementations. Like I said, +15 years. Composer is 9 years old. How do you think we handle this in our own Jurassic times?

    You can manual include
I don't think that will work with any code that came out in recent years. Because it all expects that its dependencies are automagically included via composer.

In practice, every PHP based web application starts with Laravel or Symfony these days. So you are thrown into the composer workflow right away. And it would be a nightmare to fight it.

Re: PHP – The Right Way

#90
post #34

I totally expected it to be a troll site. It's actually sensible advice. But, really, I suggest using other tools. We have nicer tools now.

> 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.

Post reply on HN