New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why are all variables and functions public? #779
Comments
You are absolutely correct in that it is considered poor practice now to have all variables and functions public. The question you ask, however, speaks to a much wider issue in both this project and open source projects in general. About this projectThe majority of the code in this project dates back to more than 20 years ago, built in PHP 3 before it even supported the concepts of protected and private variables, and more importantly when code design was much more procedural than object driven. In addition, the concepts of documentation and standardization were much more, let's say "lax". Why haven't we updated these?There is always talk of refactoring the code. If you browse the issues page below, you can see discussions from years ago about making code compliant to all kinds of different standards, but ultimately it all boils down to the fact that nobody actually wants to commit the time required to do the work. The 2 main maintainers of the project don't actually work day-to-day on the product any more, and like many projects, are maintained as a hobby in our non-work hours. That means the time available will always take second place to everything else going on in our lives. And not only do we maintain the code, we support it, and do all the documentation. Just building adodb.org probably took me 300-400 hours of work. What about all the pull requests?There are always contributions of bug fixes to the software, for which we are grateful. But the mundane routine tasks of looking after a project are generally left untouched. And this isn't a surprise. Your question about variables would require the following action for each one:
And that last one is the killer. To do cross system testing properly, I've got the following databases up and running on machines at home: MySQL, Postgres, DB2, Oracle, Firebird, SQL Server, SQLite. I've learned how to build memcached and redis servers. Most of these databases I will never use to earn a living, I just need to understand them to maintain the code. Now you're getting really depressingThere's an XKCD cartoon that struck a chord with me. I'm one State over in Colorado, and my colleague is in Switzerland, but from a PHP infrastructure perspective, the point stands. On average, there are about 300-400 downloads of ADOdb a week from Sourceforge, and ADOdb has been pulled about a million times via composer. But in more than 20 years, not one organization has ever offered to financially support the project. We personally pay all the costs associated with the project (domains, hosting etc). A kind person recently offered to buy us a cup of virtual coffee recently, and that is, as far as I remember, the only offer of support we've ever had. Can I help?God yes, anything helps. This project has an amazing resiliency. Despite the fact that from a modern perspective, the design sucks, it's still the best thing out there. Because we can at least keep it updated to the latest levels of PHP, there's no reason why it can't go on forever. And there is a need for more people to be deeply involved with it. |
Thank you for the detailed response ( ◜‿◝ ) and the work you put into it! |
How about to setup opencollective and liberapay for ADODB on github.com/ADOdb/ADOdb? |
I'm curious why all variables and functions are set to public? I learned in university that this is bad practice.
The text was updated successfully, but these errors were encountered: