Is there any way to test php code the same way a compile phase does in other languages to catch obvious mistakes from hitting your users?
It's obviously not as comprehensive as compiled or strictly-typed languages, but you can use "php -l" as a linter to catch obvious parsing/syntax bugs. I use this script to check our whole codebase before deployment: > find . -name "*.php" -print0 | xargs -0 -n1 -P8 php -l | grep -v "No syntax errors detected"
Moving from Go to PHP Again
321–330 of 371 posts
Re: Moving from Go to PHP Again
#322Earlier quoted context omitted.
Checkout Laravel, it powers some Fortune 100 sites -- it's definitely "large-site" capable.
Laravel performance is abysmal, though. You're gonna spend 10x on server costs if you use a fully featured framework in PHP.
Re: Moving from Go to PHP Again
#323Any idea why PHP has such a bad reputation compared to other interpreted and dynamically-typed languages such as Python?
Its a quirky little language and the early versions weren't great. The language can be inconsistent in places, and embedding php in the html made for a rapid though sometimes trying experience. Its keeps backward compatibility which keeps those quirks in there. (though with new 7 series php versions older stuff is starting to break.) Someone wrote an article with a title like "php a language with terrible design" tha…
The reason quite possibly is that those are joy to use where PHP isn't. In my mind the developer happiness should be on top of the list, also the syntax is still ugly however you look at it. The versatility of Python is unmatched. Ruby allows me to do things I could only dream of in other languages, in PHP those dreams are nightmares.
Re: Moving from Go to PHP Again
#324What IDE do people use for PHP these days? Editing PHP in a standard text editor is a pain because most don't supporet "Go to definition", or "Find all refernences" (Two killer features of Visual Studio)
Most of my work on a daily basis is PHP (Laravel) and I use Visual Studio Code as my main driver. It's pretty good with Python too, which we have a little bit of (mostly Flask apps).
Re: Moving from Go to PHP Again
#325Earlier quoted context omitted.
> Memory hog only by those that don't know what they are doing and happilly new everywhere. Go uses an order of magnitude less memory for most type of workloads though. Also you don't tune c++ binaries delivered to you. You have to tune the JVM's option to death for big apps. I can't count the number of incidents "solved" by raising the Xmx param.
I tune C++ compilers, just like I tune Java compilers, in both cases I can decide to do it during AOT compilation or at a later moment. The big question is how properly those big apps were coded. Go doesn't run Fintech servers, while Java keeps replacing C++ servers. Yes, one needs to code Java with low level tricks like C++, but it is possible and there are many performance experts doing it. How many Fintech servers…
How many customers run self-compiled, say mysql binaries? Or mongodb? An tiny minority. Now how many tune cassandra or hadoop jvms? A big chunk.
You can use niche cases to make a point (fintech is almost the textbook definition of a niche software use case), however what you say is plain wrong most of the time.
Also, I've managed thousands of c++ and thousands of java processes. I'd take c++ ones over java any day.
Re: Moving from Go to PHP Again
#326Each 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…
Re: Moving from Go to PHP Again
#327I like the batteries included standard library and single binary deployment of Go.
PHP, like others have said, gives you a single endpoint and you can make rapid changes. Its ideal for internal web apps that do not require insane performance.
Re: Moving from Go to PHP Again
#328Earlier quoted context omitted.
So ease-of-install beats code quality, code readability, security, future maintenance and better tooling. Dang. LEPP (nginx, PostgreSQL, Python) stack seems to me an all-around better stack for most of the deployments people use LAMP for.
If you compare it to a generalized Lamp stack, sure. Compare it to Laravel, and you have no solid basis for "code quality", worse readability, it's Fortune 100-levle-secure, future-maintenance -- Laravel is more active than any other community out there, and has significantly more tooling. https://github.com/topics/framework
Re: Moving from Go to PHP Again
#329Earlier quoted context omitted.
I tune C++ compilers, just like I tune Java compilers, in both cases I can decide to do it during AOT compilation or at a later moment. The big question is how properly those big apps were coded. Go doesn't run Fintech servers, while Java keeps replacing C++ servers. Yes, one needs to code Java with low level tricks like C++, but it is possible and there are many performance experts doing it. How many Fintech servers…
> I tune C++ compilers, just like I tune Java compilers, in both cases I can decide to do it during AOT compilation or at a later moment How many customers run self-compiled, say mysql binaries? Or mongodb? An tiny minority. Now how many tune cassandra or hadoop jvms? A big chunk. You can use niche cases to make a point (fintech is almost the textbook definition of a niche software use case), however what you say is…
Proper Cassandra and Hadoop deployments are as niche as Fintech, the large majority could solve their problems with UNIX command line tools.
On my world the team manages deployments, I rather take Java over C++ compilation times, and having tools like Mission Control to monitor cluster performance on production servers.