Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Have a look at the WordPress core. ;-)

Here's a nice example: https://github.com/WordPress/WordPress/blob/92d9e70f849c337c...



So in your opinion what's wrong with that code? To me it seems to be nicely documented and everything.


That it is - it better be.

It's an example of the kind of backwards compatibility WordPress needs to deal with the myriad of crazy content generated by people (and plugins!) over the years. Often this gets very chatty and very inefficient.

Besides backwards compatibility, this codebase grew like a jungle, with people just piling code on, not always with much forethought. Part of it's due to the limitations of PHP in the old days, and of course it's inherent with projects of this size, but there are varying degrees of messiness. WordPress is an example of a project that started out too messy and only became more messy over time.

Just to pile on: the WPDB class is another example of continued messiness. The first thing I do whenever I write a plugin, is to add a little database wrapper that just uses PHP PDO instead. Anything better than to deal with the hopeless, inefficient, inflexible mess that is WPDB. (To whoever wrote it: sorry mate!)

Edit: this guy said it better: https://news.ycombinator.com/item?id=41729827


So even better, WP engine could rewrite it from scratch in a better way. Maybe even use another language.

Or maybe it is just fine for their use case and they are making already enough money with it...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: