Live data from Hacker News

“Hello, (real) world” in PHP in 2017

kukuruku.co

31–40 of 144 posts

Re: “Hello, (real) world” in PHP in 2017

#31

Call me old fashioned but I prefer my code naked, plain php and postgres, nothing else, not even JS. So for me, echo 'Hello world' is good enough.

Users overwhelmingly prefer some amount of client-side interaction, so how do you do that without JavaScript?

HTML

Links, text boxes, selects, radios, checkboxes, buttons, forms, and content.

Re: “Hello, (real) world” in PHP in 2017

#32

Call me old fashioned but I prefer my code naked, plain php and postgres, nothing else, not even JS. So for me, echo 'Hello world' is good enough.

Users overwhelmingly prefer some amount of client-side interaction, so how do you do that without JavaScript?

css :hover with hrefs to fast-loading pages can give the illusion of interactivity without any javascript (or even server processing, if the whole site is statically-generated).

Re: “Hello, (real) world” in PHP in 2017

#33
post #27

Nailed it. I love PHP and it's still my main language, but the reason so many projects never get completed is because of this. Really I should just accept that for an MVP, Laravel and a static front end with some old school jQuery where required is fine.

Sorry but if you love PHP and use as your main language, why you don't complete any sideproject ? I don't understand your statement.

Side projects are natural places for programmers to get lost in this kind of bike-shedding/yak-shaving/etc., since they're not under the same kind of "this needs to ship on Tuesday or I lose my job" pressure that work projects are.

Re: “Hello, (real) world” in PHP in 2017

#34
post #16

> But each dispute has an argument in favor of PHP — it’s easy for beginners. To my mind, this argument isn’t valid anymore, which is exactly what I was trying to say in this article. It's still is easier AND cheaper to deploy a Hello World in PHP than a Hello World in any other language. You can get a cheap Apache/PHP hosting for $2/month, use SFTP a get a working app in minutes. The default PHP distribution comes w…

a C1 or VC1S at scaleway is 3.6€ per month. This gives you total control to install anything (nodejs, ...)

Re: “Hello, (real) world” in PHP in 2017

#35
Coincidentally I recently began a new project involving a user-facing PHP app, and even though I have enough ES6 + webpack + react blablabla experience (and some angular, but I didn't particularly enjoy it), I decided to just go with good old synchronous requests. It makes things easier and, in this case, development time is key.

Re: “Hello, (real) world” in PHP in 2017

#36
So many people not getting the joke here. This article is a send-off of the idea that PHP is "just easy" anymore, but frankly, misses its shot.

Of course it's complex when you introduce complexity. So is anything by definition. If you don't want to do complex things, you're fine. But if you want to have a database, have a framework abstract away the truly dangerous and boring shit, use a modern, type-safe version of Javascript, write CSS in something approaching a maintainable fashion, and deliver a responsive, reactive site, you'll have to do something like this, regardless of language.

Also, the author neglected to set up database migrations, to say nothing of a Dockerfile.

Re: “Hello, (real) world” in PHP in 2017

#37
post #20

Sometimes I miss the old good days with PHP mixed in HTML. Maybe wasn't the best solution but it worked...and was fast too.

I don't miss having to manually add includes and update dependencies with FTP. I don't miss htmlspecialchars or mysql_real_escape_string, I don't miss running everything in the webroot, I don't miss having to switch contexts between PHP, HTML, Javascript and CSS all mixed in one file.

The good old days kind of weren't that good. The simplicity of bare PHP was great for cowboying up sites in a hurry, but it's not a system that handles complexity well.

Re: “Hello, (real) world” in PHP in 2017

#38
post #20

Sometimes I miss the old good days with PHP mixed in HTML. Maybe wasn't the best solution but it worked...and was fast too.

Having had to find and fix a bug in a very long page like that recently I can definitively say I don't. Horrible.

Granted the person who wrote it obviously didn't care but that setup was awful for anything of any size.

Re: “Hello, (real) world” in PHP in 2017

#40

Call me old fashioned but I prefer my code naked, plain php and postgres, nothing else, not even JS. So for me, echo 'Hello world' is good enough.

Users overwhelmingly prefer some amount of client-side interaction, so how do you do that without JavaScript?

Depends what you are building. I have certainly had more frustration using single page or collections of single page apps. It is very rare that they get the back/forward button handling and refresh handling exactly right.
Post reply on HN