by mastazi · 5y ago · 0 comments
> Written in old PHP and there is work underway to do a complete rewrite in Golang
I will never understand "the big rewrite" philosophy, no matter how many times I hear it.
Are some languages better than others in some aspects? Yes, but:
1. if you think that changing language is the only way to make a codebase secure, then there is something wrong with your security practices.
2. if you think that rewriting in another language is the only way to improve code quality, then there is something wrong with your software development practices.
3. chasing "the hot new thing" is a never ending cycle.
Choosing something like a calendar client based on what language it's written in, instead of its merits as a client, is such a ludicrous concept.
OP is going to be in for a world of hurt trying to find a solution, there's a reason why all these libraries are in 'old PHP'. Most of the big companies have 'Appified' their APIs with calendars, and the old .ical etc formats are there for legacy support. So you need to create an app, delegate it permissions and then you've got a REST API to play with. If you've got the skill to do this, you'll have the skill to write a syncing script.
And perhaps more importantly, a lot of developers hated working in PHP, and switching languages increased developer satisfaction.
Yes, it is possible to make secure, quality software in PHP, but it is more difficult than in many other languages. If making your app secure and higher quality requires substantial refactoring, or the marginal cost of maintaining security and quality in a PHP app is sufficiently high, switching to a different language could very well be worth it.
In the case of Nextcloud, my educated guess is that none of the above conditions is true.
This wasn't just hatred of PHP (its a C like syntax. low barrier to entry) -It was about OLD php. Depending, formally (it may work on new PHP but it isn't clear. it might use deprecated language features or side-effects which dont work that way any more in newer language platform) on the old language spec can be a nightmare.
Plus, if its in a language you don't "like" then local mods are harder.
Would you e.g. run a Rust binary, if every other dependency you had was in GO? Or, APL, if nothing else you ran was in APL? Some choices about language make sense, if you consider the full ecology of running a service on a host.
https://www.php.net/supported-versions.php
Edit: Also the docker image is updated to PHP8 for NC22: https://github.com/nextcloud/docker/pull/1563
You can keep software up to date without rewriting in another language, which is what Nextcloud did by the way, as it runs perfectly on my box with PHP 7.3.
You're arguing the specific, I'm arguing the generic: it is possible to wind up in a place where your old code won't re-compile, or run.