Hacker News new | ask | show | jobs
by anony999 1422 days ago
Have you tried a more "modern" language recently? By trying I mean using it for more than 6-10 months. I've been one of the PHP "supporters" until I've found Go and Rust. PHP was really nice to get into programming and make a spaghetti website but the language itself and the ecosystem always felt like a hacking project.

The killer feature of PHP has always been the hosting ecosystem. A simple FTP upload would do the job without knowing much about the hosting infrastructure. Recently we've got that kind of "serveless" experience for other languages as well but the deploying is proprietary and the providers are very few. I'm aware only of Google Cloud Run.

As for JavaScript even its inventor said it's time to move on. It's time for a new language and a new DOM interface. Maybe we can fix the "language" issue with WASM but we are still left with the DOM.

2 comments

> PHP was really nice to get into programming and make a spaghetti website

Facebook manages quite well with PHP. Maybe it's your fault you didn't learn how to use modern PHP practices which have been well-documented for over a decade now.

>> Facebook manages quite well with PHP.

I didn't say you can't make it work. You can build great stuff using just bash scripts. I'm pretty sure you can have success with any programming language. That doesn't mean it's the "best" way to do it.

>> Maybe it's your fault you didn't learn how to use modern PHP practices which have been well-documented for over a decade now

I doubt it's my fault. I'm not "special". I think PHP is prone to bugs and bad practices both due language design and bad documentation.

> I doubt it's my fault. I'm not "special". I think PHP is prone to bugs and bad practices both due language design and bad documentation.

Not in 2022. I avoided PHP for a long time. I got back to it and found that the Internet and books are full of best practices and I have not had an issue with documentation either. Would you please give me an example of how PHP is more prone to bugs vs. other languages in this area? I have found it to be really difficult to write buggy and insecure code. For example if you have not heard of PDO and you do not prepare, bindValue/bindParam, and then execute, that is your fault (make use of filter_input() as well!). It is advised literally everywhere today. Regardless, my return to PHP was pleasantly surprising. I finished my project pretty quickly and I have not used any frameworks. Security vulnerabilities? Perhaps, but so far so good. We will see. I tried my best and I have done my research. Every time I mention that it is written in PHP, people frown because they are stuck at PHP 5 or so. That said, subpar defaults in php.ini is still a thing though.

Do you have any book recommendations for someone who knows web development but is new to (modern) PHP?
>>well-documented

Sources?

> JavaScript even its inventor said it's time to move on.

I hadn't seen that quote, do you have a link?

Probably meant JSON instead of JavaScript

https://evrone.com/douglas-crockford-interview

I stand corrected.It was Crockford not Eich.