Live data from Hacker News

PHP in 2022

stitcher.io

211–220 of 318 posts

Re: PHP in 2022

#211

Earlier quoted context omitted.

I have never written JS with semicolons after 2015 idk why you are saying Modern JS has semicolons? I simply didn't get it. Am I missing something.

I mean, it clearly has them; it's part of the syntax. You can skip them, and the parser will insert them for you; but the language has them.

yea but its optional so does it matter? In PHP its compulsory, right?

Re: PHP in 2022

#212
post #198

Earlier quoted context omitted.

I think unambiguously janky design choices like this[1] in PHP's early history is what's given it such a bad reputation, while it might be a decent language now such a reputation is hard to shake. I'll be honest the only time I'd reach for PHP over a comparable language with a less chequered history like Python is if I was dealing with a project that was already closely tied up in the PHP ecosystem. [1] https://www.i…

Unfortunately the bad design choices from the past are mostly here to stay - I mean, when you have the thing you want to find (the "needle") as the first parameter in about half of your "find something in something else"-type functions and the "haystack" as the first parameter in the other half, are you really going to break backward compatibility just to make things consistent? Of course not! So PHP will never be my…

Clarification: While Facebook sponsored a lot of work it was on their competing HHVM system, which spured other contributors that competed with HHVM (Zend mostly) to invest more in PHP and develop the performance improvements in PHP 7 and 8.

The performance improvements where not directly sponsored by Facebook.

Re: PHP in 2022

#213
post #74

I learned to use php when I was like 14. I’m 27 now and still derive such joy when making my own little projects that will never see the light of day. I try to be humble as far as just being a php trash coder, but I don’t feel too ashamed honestly, as it is the most mainstream thing really. I will always be grateful to php for being accessible and yeah, I guess easy. I don’t know why php is the only one I really stuc…

PHP was my first love. It still is. Professionally I have moved on to other languages. But whenever I have an urge to create something for personal use, PHP is always the most productive way to get it done. With Laravel, I can even make it look polished and put it on the web.

PHP is such a joy that I am really thinking about switching back to it for my day job.

Re: PHP in 2022

#214
post #63
post #17

Earlier quoted context omitted.

Slow change is good for small projects that you want to build once and use for decades without much maintenance.

A language that uses archaic syntax with dollar vars, semicolons, is pretty verbose itself may die before it evolves into something sensible. Not that I believe PHP will die any time soon, but just replying to your "slow is good".

I do like dollar vars, because I know immediately when it's a variable and don't have to rely on syntax highlighting.

Re: PHP in 2022

#216

Earlier quoted context omitted.

You have any good simple examples of your backend? Sounds like what I've been attempting to explain to others. How many concurrent requests and what size of data can you run with a setup as described?

Storing stuff in a json file sounds horrible to me. Why would you want that?

Because your data is teeny tiny, not performance critical, and `json.load` and `json.dump` is easy and usually less brittle then you're language's marshalling library.

Re: PHP in 2022

#217

PHP is my go to language for building simple backends that store data as json in a file and synchronize access using flock(...). There are a ton of cheap hosting providers that support PHP and all you have do to is copy your files over and everything works. I love to focus my energy on building a great frontend with React or Vue.

I've wondered why there's no JSON-based equivalent of SQLite, like "MongoDB but it's just a file and a library."

I think because SQLite ate that market with the JSON extension. I've also seen LMDB used in the wild.

Re: PHP in 2022

#218

Earlier quoted context omitted.

> Why would I choose PHP when starting a greenfield project? For me, the answer is Laravel.

For someone who has never used PHP: what is so good about it?

Laravel provides structure to PHP apps. It includes a terrific router (Symphony) and a slew of functions missing or clumsy in PHP.

Re: PHP in 2022

#219

PHP is my go to language for building simple backends that store data as json in a file and synchronize access using flock(...). There are a ton of cheap hosting providers that support PHP and all you have do to is copy your files over and everything works. I love to focus my energy on building a great frontend with React or Vue.

I've wondered why there's no JSON-based equivalent of SQLite, like "MongoDB but it's just a file and a library."

But ... SQLite is "just a file and a library".

Re: PHP in 2022

#220
post #188

Earlier quoted context omitted.

I'm one of those web devs that tries everything under the sun, and I also happen to have worked for a lot of companies (more than a dozen already, I'm on my 40s). Laravel is such a *joy*. I've never had this feeling of using something so easy and productive. I've been recently building a side project with LiveWire and oh-my-god. I really wish I had discovered it before. From the templating system (you get components…

Laravel and Livewire is the best-kept secret ever because everybody is too busy being biased against PHP.

Or we're too busy using Phoenix LiveView ;P
Post reply on HN