I’m a bit confused about whether there is any difference between a WordPress and ClassicPress theme? Will there be a point when CP theme development diverges from WP?
No difference, except of course that you don’t need to code for Gutenberg in ClassicPress themes.
The WordPress theme framework (template hierarchy, etc) has been around for many years now, mostly unchanged. It’s stable, and it’s not perfect but there is no reason for us to break it.
I could envision us potentially designing a new theming system one day as part of a future major release of ClassicPress. In this case we’d likely make the new system opt-in for those that want it, and keep the old one working also. But, this is purely hypothetical, because this would need to be decided by the community as a priority first, and then planned and implemented.
From the standpoint of a perfectionist, I would like to see as much bloat removed from WordPress functions, as well as a coding standard not relying so heavily on WP database calls. In many cases, using static alternatives, would be preferable. Of course, much of my work is aimed at a specific audience, thereby eliminating the need to cover every potential user.
If you use transients, you can mitigate calls to the database significantly. If you also use object caching with something like Memcached, you can pretty much overcome the issue altogether.
This is a strange statement since transients are stored in the database, and not just one entry, but two since there is a time associated with a transient.
The options table where transients are stored is autoloaded (default is true) and cached by core anyway.
@joyously: If what you are putting into the option or transient (also stored in the options table) use more than two calls to the database, you are not only reducing the number of such calls but are also using the much faster options table. So win-win.
I do this all the time with menus and widgets. On some sites, the number of database calls per page has dropped from over 300 to fewer than 40 without Memcached and fewer than 10 with it. And page loading speed has improved by over half a second.
Transients can’t be counted on to exist when you need them. Sure, if it’s a few seconds (maybe even a few minutes) it might not be too bad to count on them, but, other than that… you just never know. The expiration is a max-life time, rather than a guaranteed-until time.
You never put persistent info in a transient only. As I said, if using a transient, the persistent info goes first into postmeta (or usermeta) so it’s always there in case the transient isn’t.
I guess I missed that… and do agree. Thanks for clarifying.
No problem! I said that higher up the thread.