re: Elegant code in PHP VIEW POST

re: DELETE AT REQUEST OF DEV.TO because apparently, it is offensive. ¯(ツ)/¯ Problem solved.

Again, a library, it is not a big deal. Also, both Doctrine and Eloquent are horrible. They work fine with a small set of information but they fail when the database reaches the +1 million rows.

Eloquent/Doctrine or whatever active record/ORM library you use has nothing to do with the database performance. If you're having trouble grabbing data from a database with over a million records, you're most likely dealing with an unoptimized database. And you'll definitely also run into performance issues using plain old sql.

For every point made, your solution is adding a library. You'd end up with a microframework of your own. One of the things you mentioned about the drawbacks of using a framework was that the team needed to be taught how to use it. But, it's even a bigger issue learning how to use an in-house framework with probably little to no documentation.

Laravel, for example, adds +600 classes for only for a single Hello World. Symfony does a better job, but not for much.

Real world applications are far more complicated than a "hello world".

Get that "frameworks are bad, too many classes/code" mentality out of your head. While I do agree frameworks are not the solution for EVERY need, they are great tools with usually lots of support/documentation available that we can use to our advantage.

Nobody that's going to work on a mid-size project is going to create their own ORM/Active Record library, validation library, etc.

Frameworks also offer the advantage of having a defined project structure, rather than having to figure out what a developer was thinking when creating his own microframework (where are X located? where does this come from?)

code of conduct - report abuse