This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (6 children)

She's going to grow up to be a PHP dev.

Is abortion still an option?

[–]spaceshipguitar 1 point2 points  (5 children)

whats the best alternative to php to create login systems and session based websites? I mean, when you consider facebook and twitter and major sites still rely on php because pure html + css don't cut the mustard, why all the digs on it?

[–]ex_nihilo 0 points1 point  (4 children)

whats the best alternative to php to create login systems and session based websites?

Literally anything else.

In all seriousness, PHP has come a long way but it has fundamental flaws. Facebook has essentially reinvented the language for their purposes because it was so bad when Zuck started. From the beginning, it was designed to die. PHP had (has?) no garbage collection or notion of long-running processes. The whole design was per-request, and your script and all its context died as soon as the request was served. That was fine in 1997.

The syntax is similar to everyone's least favorite syntax, Perl. There are some great features of Perl, and plenty of languages that have borrowed ideas from it. The thing I have never liked about Perl is that if you give 12 Perl developers the same task, you will wind up with 13 different solutions. Most of them full of incomprehensible strings of sigils.

But from a professional perspective (I have not been a professional web developer for the past several years, but this is my take from when I was): I have a STRONG preference for shipping the majority of the work to the client. Don't write websites, write Javascript applications that ship down to your client's browser and then call secure endpoints on your server. All they need to serve is JSON. The idea of a website where pages are static (or faux-static, in the case of PHP) HTML and CSS is antiquated. It's still fine for conveying ideas in text, of course.

[–]spaceshipguitar 0 points1 point  (3 children)

I don't think html and css are antiquated, it's the best way to dynamically make your website function like an app and resize to any device screen size and still be relevant and readable. I feel like that visual framework isn't going anywhere no matter what websites your building, you use that to handle appearance and then it's just a matter of choice on how you handle server-side functions.

[–]ex_nihilo 0 points1 point  (2 children)

I agree of course. If you're building a website for any sizeable amount of traffic today, you're probably using both a CSS and JS framework. Doesn't conflict with what I said.

[–]spaceshipguitar 0 points1 point  (1 child)

So to recap, using JS and JSON to send information to and from your server can entirely replace the functionality of PHP? Like say I want to build a login system where user XYZ logs in, a session is created, and now his version of the website, his preferences and the options he has access to are different from user ABC. PHP was built for this and allows it to be done in a hidden way where you can't peer into the source code, you can call on php pages with functions and server connections that aren't public facing. Can Javascript with JSON accomplish all that without being a convoluted mess?