Time to refactor?

Started by bpr-admin, May 04, 2022, 06:05:58 PM

Previous topic - Next topic
I know this will probably sound crazy, and would be a huge challenge, however:

I believe that PHP has had its day. Now is a great time to move on. I believe that OPNsense would be a much better product if it was refactored/re-written in Go. OPNsense would seem right up Golang's alley.

Besides "It's hard" or "It takes too much time", why would OPNsense not want to drop php for golang??

For a web UI? Seriously?
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

What would be the benefits? Especially for this project. They are still refactoring the old pfsense/monowall codebase to a more mvc design. Why throw away all that work? And creating new bugs in the process probably.

It's probably faster to drop all the code and start again, but that's willing to scrap a lot of "knowledge" bound in existing code. We already have occasional issues with complex networking and implied functionality so probably the biggest reason not to do it is regressions.

Reason number two: PHP isn't that bad of a language that it was 20 years ago.

Lastly, efforts are underway to change backend functionality to Python where possible, but it's a slow crawl for first reason listed and isolating the whole backend to be able to run PHP without root is an eventual target with that, which would take the remainder of problems from reason number two away.

All in all, it just takes a lot of years to do this. If you asked 2015 we would have said we would be further in 2020, but now it's 2022 and we are probably half way to where we want to be. If that's still true in 2025 I don't know but we will see. :)


Cheers,
Franco

Thank you for that reply.

QuoteLastly, efforts are underway to change backend functionality to Python where possible

That's great to hear, I had no idea.