Any idea why PHP has such a bad reputation compared to other interpreted and dynamically-typed languages such as Python?
Moving from Go to PHP Again
171–180 of 371 posts
Re: Moving from Go to PHP Again
#172He's comparing a language (w/ extensive standard library) with a web application framework.
Comparing Go ans PHP a few years ago would mean to compare Go and PHP/Apache or PHP/Nginx, because PHP could not run its own server.
It's like comparing Git and Subversion, where you have to explain concepts like staging.
Or IntelliJ and Eclipse, where you have to explain workspaces.
Re: Moving from Go to PHP Again
#173Earlier quoted context omitted.
>Amazon lambda may have more in common with PHP in terms of discreet deployable units of functionality. What's old is new again. This doesn’t seem to be a language choice problem, it seems to be a monolith problem, where PHP simply managed to avoid some of the traditional monolith issues by design. Your CD pipelines in any micro service architecture should solve these problems, whether it’s using FaaS or containers,…
>> PHP simply managed to avoid some of the traditional monolith issues by design No - it didn't. PHP up to this day is a spaghetti mess it had always been.
Re: Moving from Go to PHP Again
#174Why do so many companies keep moving to go? I tried to like it, but it was just so painful to write.
I'm curious, what is painful about it? I came to Go from mainly C++, Java, and Python background, and I feel like it's the best of all 3 (to me). It's compiled and really fast (like C++), it has a great set of libraries and community interaction/support (like Java), and it has simple syntax that is clear and quick to understand (like Python). It's not a perfect language (nothing can ever be), but it's become my favor…
Writing code-generators for everything wasn't fun.
Re: Moving from Go to PHP Again
#175Each PHP file is an endpoint. As opposed to having routers in code or client side SPA routing. PHP files can be deployed independently, swapped out or updated live. No building/compiling of the php files needed. A single layer as opposed to 'modern architecture' where there's client side back/front end layers, api layer, logic, validator, data access, and ORM layers. Can extend itself as it runs. For example Wordpres…
> Each PHP file is an endpoint. As opposed to having routers in code or client side SPA routing. Except in reality once you want to use non /whatever/file.php as urls - you're back to implementing a router > PHP files can be deployed independently, swapped out or updated live. Intuitive, simple, powerful. Can be as easy as editing a php file in notepad and dropping it on a ftp server. Deployed. Except in reality, you…
Re: Moving from Go to PHP Again
#176I love Go, for many situations, but definitely not for a typical user facing website. The community seems bent on the whole "all you need is net/http", but that just isn't practical in modern web development. People like ORMs, easy to handle html forms, security as a default, easy session/cookie handling etc. In the end, web developers want ease of life. Go is a great language for many things, but if it's going to ta…
People always use this modern term as if it implies something significantly different or more "advanced". The web hasn't changed much. It's still data over tcp sockets to a contained runtime -- a web browser.
> People like ORMs
People in my experience are starting to dislike ORMs. If you have done this for long enough, you realize they are great for getting off the ground, but they inevitably get in your way, and start generating some really bad queries which you have to start one by one replacing with raw SQL statements, at which point you might have well started with raw SQL.
Having come from Rails, and PHP frameworks like Symphony and Laravel at my company, using Go I feel almost like I am more intimate with my code. I understand it better, the dependency chain only ever goes one or at most two levels deep. I will admit the the templating and routing is more "batteries included" in these frameworks, but the other parts that I have control of that I consider much more important (such as how my data actually gets stored and other network calls I have to make), I would much rather do those in Go than in PHP
Re: Moving from Go to PHP Again
#177Earlier quoted context omitted.
Hmm, I'm sorry... I'm having trouble understanding your point, and specifically how it relates to my comment.
I parsed it wrong. I thought you essentially said "the things I build are definitely worse then relying on a collection of random internet dudes code through npm." But yes, GNU make, emacs, yacc, lex, bison, ar, nm, there's lots of great tools. It's 4am, I should sleep.
Re: Moving from Go to PHP Again
#178Earlier quoted context omitted.
You can absolutely do this in Java if you want to. I mean, it's insane and you shouldn't, but it's eminently possible.
I'm not saying it's not possible I'm saying it really isn't convenient .
Re: Moving from Go to PHP Again
#179Re: Moving from Go to PHP Again
#180Earlier quoted context omitted.
> Each PHP file is an endpoint. As opposed to having routers in code or client side SPA routing. Which becomes a security issue due to accidental endpoints or uploads becoming endpoints. Or becomes a mess of imports. Either way, PHP frameworks often end up with a central router anyway. > PHP files can be deployed independently, swapped out or updated live. Which means some people try to do that the naive way and end…
You can create a mess of code, open security holes, and/or be hit with ‘gotchas’ in any web framework. PHP is much less complex than most.
I'll be flask-ing