Moving from Go to PHP Again
131–140 of 371 posts
Re: Moving from Go to PHP Again
#132Earlier quoted context omitted.
So.. what you're trying to highlight is that a language is supposed to make up for the incompetence of the person using it?
Of course. That's the only reason to invent languages: to take care of stuff people are not good taking care of, and move the work to the computer, allowing us to work on the level that we're good at taking care of. Else we'd all be using assembly. There's absolutely no pride or glory in doing things nicely and securely that the computer could have automated in the first place. Anything the language allows that it co…
It appears that we think about different terms when visualizing what "incompetent" means.
We create languages to tackle different sets of problems, and we want to minimize human error - that part, I believe, we can agree on.
However, if you perform "SELECT * FROM mytable" (table grows indefinitely) and then sort / limit in the language and not database - you're incompetent, you simply lack knowledge and you didn't even think abstractly what can happen by doing so. There's no language out there that can teach you "right tool for the job" or "keep it simple" or "should I do it, maybe there's another way, did someone else have this problem?", no matter what wizard creates it.
We will never weed out incompetent people by creating languages and a language shouldn't cater to a moron.
Re: Moving from Go to PHP Again
#133Earlier quoted context omitted.
I have not written a new PHP app in years but recently I had a look at the latest and greatest from the PHP community and its pretty good. The frameworks and tooling look about as good as you will get anywhere and PHP appears to be fast now.
As someone who was about to ditch the PHP ecosystem 6 years ago for something like Rails... frameworks like Laravel absolutely changed the PHP ecosystem. Also since the release of PHP 7.0, core development seems to have really picked up with good stuff in every release (7.3 was just released a few months ago).
The only thing Laravel had going for it was that you could take more shortcuts, and it was a pain to integrate into any IDE if you wanted decent autocompletion.
Re: Moving from Go to PHP Again
#134Earlier quoted context omitted.
"and embedding php in the html made for a rapid though sometimes trying experience." Funny, that is React/JSX's biggest sell
React can't execute arbitrary database queries.
{e = () => ajaxCallToMutateDatabase()}
Or something similar...
It's just people don't do it because it is a bad idea!
Re: Moving from Go to PHP Again
#135Earlier quoted context omitted.
> Go just isn't designed to make serverside-rendered database-backed websites especially pleasant to write. Citation needed. I’ve had a very nice time. It’s statically typed, has excellent templating support, and is generally very productive.
In go, Querying SQL is very much like doing the same thing with the base libraries for mysql in C. Doing the same in most any other language is much much easier and just as safe. Credentials: Worked mainly in go for 4 years... 18+ years coding in about 9 languages. Yes I realized this is opinion.
MySQLd in PHP is a mirror process, and in fact retains the C function names.
Re: Moving from Go to PHP Again
#136Re: Moving from Go to PHP Again
#137Earlier quoted context omitted.
These are things very specific to PHP. Yes, there are language-specific gotchas in many environments. But I'm criticising specific things that do exist and that I've seen causing issues in real deployments. Things that make PHP accessible make it also an excellent footgun.
So.. what you're trying to highlight is that a language is supposed to make up for the incompetence of the person using it?
There is a reason most web sites don’t use C.
Re: Moving from Go to PHP Again
#138Earlier quoted context omitted.
About annotations, a new proposal has been submitted a few days ago. It's not the first time so I don't want to be too optimistic, but it looks great. https://wiki.php.net/rfc/annotations_v2
Even if this will be integrated I still think it might be a bad idea for some things because it goes into the separation of concerns principle. A controller should not know about routes. A model should not know about database design.
Re: Moving from Go to PHP Again
#139I agree with the author. Symfony 4 is the best PHP framework at the moment. Trying both Laravel and Symfony I think there is no need for Laravel (anymore). Laravel just has too much magic that will bite you later on. The only thing you should skip in both frameworks are 'annotations'. But this is easy to do.
> Laravel just has too much magic that will bite you later on. Especially when that is not explained in the docs or just in a very vague way... I tried improving the docs by pointing out where magic (e.g. fix naming conventions) is needed and where not, but the mantainer just turned that into vague mush again (after he had even agreed to the changes). Also if you need any more details that are not in the docs, everyo…
I don’t know. It’s odd.
Re: Moving from Go to PHP Again
#140For the kinds of applications people tend to build in PHP, PHP is probably a better choice than Go. I'd still do Django or Rails before PHP, but Go just isn't designed to make serverside-rendered database-backed websites especially pleasant to write.
Rest API? Sure. Building webpages? I dont think it was made for that... Although Go templates can work, its still not as flexible as you might want it to be.
Granted, we're talking about largely server side generated web pages and, haha, who does THAT still in 2019 : hangs head in shame :