5 ms·
Questions for PHP, and MySQL folks (not meant in a negative way): - PHP: A few years ago I heard about how PHP was needlessly complex. I wonder what the recent
by fizixer 7y ago
Questions for PHP, and MySQL folks (not meant in a negative way):
- PHP: A few years ago I heard about how PHP was needlessly complex. I wonder what the recent status of the programming language is. Specifically, do experienced PHP programmers stick to a subset of PHP, as in "PHP: The good parts"? (similar to "Javascript: The good parts"). (side note: As a diehard python person frustrated due to latest versions becoming bloated in features, I fully acknowledge that I'm in the "Python: The good parts" camp right now).
- MySQL is owned by a company lately. I wonder if PostgresQL is clearly a better alternative?
- CiPHPerCoder 7y ago> Specifically, do experienced PHP programmers stick to a subset of PHP, as in "PHP: The good parts"? See: https://phptherightway.com https://phptherightway.com Modern PHP development comes in the form of loading dependencies from Composer/Packagist, rather than offloading a lot of bloat to the language. Lots of things have been deprecated (and even removed, like ext/mcrypt).
- wolco 7y agoI think the discussion point was php was too easy and that encouraged new developers or less hardcore developers to adopt it. Some of the defaults like globals being turned on by default led to security holes. How people were creating sql statements at the time concating strings led to sql injection issues. There were never any bad parts . There are new features like the spread operator that are newer and not available in earlier versions. I try to stay away from them if I think the application will need to run on older versions but otherwise I feel like I can use any feature. Postgres needs to run under a specific os user. That alone makes it a poor MySQL replacement
- orf 7y ago> There were never any bad parts . There where, and continue to be, large numbers of bad parts. Magic methods that do random things in certain cases, terribly defined interfaces (array_search), ridiculous typing, an impossibly incoherent standard library, etc.
- majewsky 7y ago> Postgres needs to run under a specific os user. That alone makes it a poor MySQL replacement Where did you get that idea? Postgres can run as any user. In fact, I recently switched my applications to use Postgres even during unit tests (instead of SQLite), i.e. that testing instance runs under my normal login user. That change actually made the CI go faster because compiling the Go SQLite driver takes much much longer (about 30-60 seconds) than spinning up a Postgres from scratch in a temp directory (about 2 seconds) and using that instead. @fizixer: I don't use MySQL, but I've heard it's not nearly as bad as it once was. I use PostgreSQL for everything from traditional relational data to time series to job queues and am 100% satisfied. Hasn't once let me down. The only caveat is that clustering is still easier to do with MySQL than with Postgres from what I hear, so if you have really really big setups that require that, that should be considered.
- porker 7y ago> I don't use MySQL, but I've heard it's not nearly as bad as it once was. MySQL 5.7+ is decent. Where it loses out to PostgreSQL is the lack of plugins/extensions. PostgreSQL is extensible in ways MySQL users can only dream of (e.g. timescaledb, pg_trgm) Also, the forking of MySQL and MariaDB has resulted in 2 very similar databases that people consider interchangeable - but aren't. There's plenty of "gotchas" if SQL is meant to run on both.
- NateEag 7y agoI have been paid to write PHP for several years of my career. More than any other language, I think, neck and neck with JS. I have also written heavy amounts of Python and Java at various points in my career. A few other languages too. PHP has many, many bad spots. It's easily the ugliest, clumsiest language I have been paid to use. It's slightly dated, but this is still the best summary I know of: https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
- Nyandalized 7y agoThere is a free version of MySQL called MariaDB. PostgreSQL is a very viable alternative. It has different philosophy, and needs a little getting used to, so it's not as easy as simply lift-and-shift