Live data from Hacker News

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

kukuruku.co

11–20 of 144 posts

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

#11

Ahahaha I legitimately cannot tell if this is a sarcastic blog post. To me it just sounds like such a joke. It's quite confusing. I hope it's a joke...

I think this is a realistic reflection on the state of this area in our industry. It is both sarcastic/a joke and not a joke at all.

Poe's law in full action. If for some reason this is not a joke, it's a pretty lousy tutorial, as for every single arbitrary framework/tool decision here, there's not a single rationale here but "because it's 2017". I'd absolutely prefer 1995's Hello World if it's just about saying "Hello World".

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

#12

Ahahaha I legitimately cannot tell if this is a sarcastic blog post. To me it just sounds like such a joke. It's quite confusing. I hope it's a joke...

its really funny :) my favorite line is:

"That’s it, we can run it now. “Hello, world!” is displayed on the screen. It looks almost like the result of "

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

#15
Just write "Hello, world!" in a file without the quotation marks, and nothing else. Save, then run. Will print what you asked it to.

Default in PHP is to output the bare text. Unless you wrap it in special markup '<?php'. That's an unique feature in the top languages.

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

#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 with a lot of extensions.

The problem is that PHP doesn't help a beginner graduate from a basic webpage to a secure and robust application without having to download a complex framework and meddle with configuration files. IMHO by the time you are tempted to use Symfony you might switch to Java or ASP.net directly.

If PHP was really beginner oriented, it would actually do everything it could to use the most secure defaults for every feature, like templating, or sessions.

Microsoft attempted to do that with WebPages, which is kinda what PHP should have been if it was really intended for beginners. WebPages mostly use secure defaults. While it doesn't prevent spaghetti code it makes having to rely on a complex framework unnecessary.

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

#17
A bit like the other submission on learning JS in 2016. I find that I am getting dragged down by complexity. Even simple tic tac toe game that I was planning to write in vanilla js took me via jQuery, npm, Firebase etc. Sure its production ready but I just wanted to write something for fun. Wasn't really fun.

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

#18
post #4
post #2

This seems like a decent primer for someone who already has their heads wrapped around application development, but absolutely horrid for someone who wants to pick up a web language for the first time and create that first simple output. That first simple output IMO is critical for retention and engaging the language knowing exactly what you're going to get by looking at dirt simple code like echo hello world; at lea…

You do realise this article wasn't written as a beginner's tutorial but as a sarcastic view of modern web dev?

And where is the VM, the docker images, the swarm in the cloud to make HA and the right https configuration ?

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

#19

Earlier quoted context omitted.

I think this is a realistic reflection on the state of this area in our industry. It is both sarcastic/a joke and not a joke at all.

Poe's law in full action. If for some reason this is not a joke, it's a pretty lousy tutorial, as for every single arbitrary framework/tool decision here, there's not a single rationale here but "because it's 2017". I'd absolutely prefer 1995's Hello World if it's just about saying "Hello World".

Generally I would agree with you, but I think it should be taken with a grain of salt. "Hello World" is somewhat metaphorical concept, the ultimate goal isn't to show the label itself, but to show what is the amount of work required to produce some generic output without any business-logic involved. This means that it totally makes sense to use OpenGL or ncurses to show "Hello world" on the screen, even though they are obviously not necessary to do just that. It's just that they will be necessary for many other typical tasks we are considering.

So, although I wouldn't really chose tools author choses here, so the "not-really-a-joke joke" is still largely opinionated, I have to admit that assuming AJAX and some kind of MVC-ish framework (even if it's a one of your own) on both back-end and front-end is pretty much a must for a typical PHP web-application.

Post reply on HN