Live data from Hacker News

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

kukuruku.co

121–130 of 144 posts

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

#121

Once you've spent all this time setting up a NodeJS stack.... why use PHP at all? Ie. just use Node for the API/Server, you're already setup, and the stack would be 100% one language.

Except e.g. React and Express are so different and work on such vastly different domains that them being in technically a similar VM is more or less inconsequential. They're two entirely different disciplines and have different build pipelines, deploy pipelines, etc. I don't see much benefit in having them in the same language. One thing does DOM state while the other does ~play in traffic with libuv. Like hey it's nice that this OS kernel is implemented in C, good thing I am also writing my GUI in C.

Idk, maybe it's a boon for some, but I've tried it and don't really see the big appeal...except for Meteor, because if I'm writing both my UI and API in the same * language, why in the would I need to write my models in both places and maintain them separately. But meteor has problems too, I just always thought it was neat way of doing something that would only be possible ("easily") when using the same lang on both sides.

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

#122

Maybe I am old fashioned and outdated. I don't know about anyone else, but it makes me pretty sad that the "modern" way as presented in this article is no longer simple and straightforward and has some severe dependency hell. Not that I'm saying the structure of modern web applications isn't needed and that we haven't advanced. Just that the overhead and knowledge required to set up a modern web application is crazy.…

To quote DevOps Borat: "Cloud is not ready for enterprise if is not integrate with single server running Active Directory." And with service accounts, API tokens, client certs, partner management of users, etc with OAuth and micro services, I really wish we just used LDAP for everything.

I try to evaluate many new "hot" frameworks using the LDAP test as well. For non-enterprise usage, I use the file upload test.

Specifically, is there a simple example showing LDAP integration (or file upload/catcher). If not even that is documented and there is no example, the framework is likely not ready for usage. Seriously, why go thru all the hassle of starting a framework and not even cover basic use cases?

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

#123
post #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, ...)

...and now you're a sysadmin, with a whole new world of exciting career opportunities. And if you can also write bash scripts and spell Jenkins, welcome to devops!

The point is that if you're 13 years old, somewhat crafty, and just want to make a website that puts text on dank memes using ImageMagick to impress your friends, PHP and $3/month hosting with a friendly alligator that you can show to your mom to get her to put her CC in without thinking you'll get hauled off by a black helicopter...will get you to done quickly without having to read a foot of O'Reilly books, 20 DigitalOcean tutorials, 57 Wikipedia pages, and 118 StackOverflow answers.

Spaghetti PHP on shared hosting written by copy/pasting comments from the PHP docs and SO is a fantastic gateway drug for teens who end up being great developers. I love it.

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

#124

I get that this article is satire, but I think the deepest (perhaps) unintentional insight presented by the author's veiled criticism is that the justification for using these tools is presented as "it's 2017" and not as a solution to any particular problem. The issue isn't the 2017 ecosystem, the issue is the 2017 programmer's deference to vanity instead of engineering. All these individual tools exist for a reason,…

I think all these tools give you structure, though. Every project is setup in an identical or similar way, which makes it easy for other developers to jump in and understand what's going on.

But that loses its usefulness if there's new tools every 6 months. Yes webpack gives me structure today, but there could be a new structure tomorrow. Look at Grunt and Gulp, NPM and yarn....

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

#125
post #45

Maybe I am old fashioned and outdated. I don't know about anyone else, but it makes me pretty sad that the "modern" way as presented in this article is no longer simple and straightforward and has some severe dependency hell. Not that I'm saying the structure of modern web applications isn't needed and that we haven't advanced. Just that the overhead and knowledge required to set up a modern web application is crazy.…

https://github.com/turbolinks/turbolinks

"When you follow a link, Turbolinks automatically fetches the page, swaps in its , and merges its , all without incurring the cost of a full page load."

Is the cost really that high to warrant this?

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

#126
post #50
post #38

Earlier quoted context omitted.

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.

You can write bad code(not modular) with every language... If you use some include() in php, you can avoid long php/html pages... What I really miss is that was very fast "GET SHIT DONE" with PHP.

>If you use some include() in php, you can avoid long php/html pages...

In my experience, you just get long PHP pages including other long PHP pages, globals defined in one and used in others, included files that contain nothing but HTML, and other madness.

You can certainly GET SHIT DONE in PHP with a bit more coherence. Composer, with its autoloader and a router (probably nikic/fastroute) won't get in your way, your code will be more organized, modular, and lightweight, dependencies can be managed, etc.

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

#127
post #99

Earlier quoted context omitted.

Except it is simple: Hello World Hello World It's responsive, works on every HTML-compatible platform and is even backwards compatible to a degree that none of the other aforementioned solutions even comes close. We make it more complicated for ourselves because we choose to make it more complicated. I'm not against modern frameworks but quite often I see people justifying them rather than using them when they become…

+1 on developers not knowing how HTTP works. I'd add to that with server-side devs (the ones writing the APIs that the single-page apps talk to) not knowing how CGI works. You can literally learn both in an afternoon if you have reasonable networking and OS-level knowledge that I'd expect anyone with a CS major to have down cold. Sadly, well, you know. In my experience, devs knowing how it really works are the small…

CGI isn't really something I'd expect many people to be using these days though. These days language web frameworks fire off their own web server and the few exception usually bypass CGI (eg PHP has a mod_php C++ API that hooks directly into Apache bypassing CGI).

Sure you can still run Perl, Python or even Go via CGI on Apache, or PHP using FastCGI on nginx, but the difference in performance between even FastCGI and a language-native web server isn't negligible. So there isn't really much reason to recommend people using CGI barring niche use cases where, hopefully, the sysadmin / devops as purposely chosen CGI acknowledging it's pitfalls (not just in terms of performance but also security) and thus understanding how it works.

This is one of the few areas where I think the additional complexity in modern frameworks is a real benefit.

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

#129

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?

Are you sure about that, I don't think many of the users I know could tell the difference.

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

#130
post #93

Earlier quoted context omitted.

Makefiles are limiting? They have their own macros, and support M4 as well (macros with recursion), not to mention the DSL is Turing complete. Make runs on Windows, OS X, Linux and Android. How is a Makefile quite limited?

C already does what PHP does. Why do you need PHP? COBOL already did what C does, why do you need C? Assembler is Turing complete. How is assembler quite limited compared to PHP (or C or COBOL)?

All languages have their place, some in history, some in very narrow fields, some in general use.

That was not my argument.

My argument, was calling make "quite limited".

How would you call make limited? The syntax is expressive, and so is the macro access.

I never said I wanted to replace or not replace make.

Post reply on HN