Go with PHP
191–200 of 532 posts
Re: Go with PHP
#192Re: Go with PHP
#193> There is no need to compile anything. But I really like compilers, they catch a whole class of bugs, before I run things.
Unit testing
Re: Go with PHP
#194I was expecting something about Go.
Me too. Some kind of weird Frankenstein of Go mixed with PHP.
Re: Go with PHP
#195Also: lets not forget one very important and under-rated side-effect of PHP -- it lets you write server-side code that can leverage a 'public' address. You might think 'well, doesn't everything let me do that?' Not quite. On 'free' VPS servers they usually have 'ephemeral' IPs or IPs that change. So while you get free bandwidth and compute -- it's hard to actually do anything useful with it like run a service if you…
Re: Go with PHP
#196I see no argument at all for using Laravel over Django or Rails. PHP was always a mess. Why would I want to come back to it now on the off chance they don't screw things up again?
Exactly. array_filter and array_map, have different order of arguments. ($array, $callback) vs ($callback, $array) A small example of how inconsistent the language is from the ground up. Most people can explain their respective web servers, but I've never heard anyone even come close to what PHP/Laravel is actually "doing". Side Complaint: If you are working with Laravel Queue, it is such a hassle to reload your code…
Re: Go with PHP
#197The problem is this page advertises Laravel, not PHP. Ruby on Rails has many similar "demo worthy" snippets that make complex tasks seem readable and intuitive to the layman. Laravel and Ruby on Rails have something else in common: due to the focus on these "natural" interfaces, they compromise in every other way. Architecture, performance, testability and so on and so on. For those who know PHP, this code is full of…
Making "complex tasks seem readable and intuitive to the layman" is no bad thing - besides other engineers, future you could become a 'layman' easily. Readable, expressive code is something I've come to value highly after almost 20 years And from first-hand experience, while the specific code sample shown on this page shouldn't be treated as a practical example of how to architect a larger application, there's nothin…
Oh look, you even say so in your own comment: "the specific code sample shown on this page shouldn't be treated as a practical example".
So... you're saying the page makes it SEEM simpler than IT IS, hmm? Is this what you were asking me about "why is it bad"? You don't think parlor tricks in demo code is a bad thing?
So what are you even objecting to here? I said something bad about Laravel, and you use Laravel, so you have to go on the offensive out of loyalty? I don't know why people need to identify so religiously with their tools. If we start picking apart this demo code, you'll probably admit that every line contains an anti-pattern you'd avoid in a real project of more than a modest size.
So what is this demo demoing then? It's essentially misleading people about what it takes to write a good app. If we'll go by simple demos alone, PHP needs no framework at all for a good demo:
Boom, everyone understands this, now you can write your own Google!This is why RoR declined and it's why PHP with Laravel and WordPress as their poster boys is declining.
PHP itself is no longer as terrible as it used to be, although all the good people seem to have left the internals. But the frameworks people use on it are terrible, incompetent and aggressively misleading people into bad practices for the sole purpose of marketing to newcomers.
Re: Go with PHP
#198Earlier quoted context omitted.
You don't get XSS protection out the box from any language's standard library, nor CSRF.
You do get XSS protection out of the box in most templating languages, though, and PHP is also a templating language. Take this template: {{ title }} In most templating languages, for a title of " alert(); ", the result will end up being: <script>alert();</script> In PHP, which is a templating language, the equivalent seems to be: But this will print the title unescaped, which is a security vulnerability,…
Nobody writes PHP mixing HTML and PHP anymore, and if you do you should run. Shit code is not unique to PHP and I've seen more than my life's share in JS and Python codebases.
Re: Go with PHP
#199> It can handle more than 500,000 orders per month Hilarious because other languages are capable of that per minute not per month
What stack can handle 500,000 orders per minute - 22.3 billion a month - on a $6/month server?
I'd at least expect that to be possible in Node, and would be somewhat surprised if a Go or Rust framework didn't hit that mark.
Re: Go with PHP
#200As someone more familiar with js/react, is there an equivalently mature reactive frontend framework?
Generally speaking, if you use PHP to build an API, you can use react still as is.