Why Does WordPress not output admin-ajax.php path by default?

As you are probably aware admin-ajax.php has been around for a very long and it provides a unified file for making AJAX requests, whether they are from the back end or front end, however its responsbility is not to provide a unified way to access it’s URL as a JavaScript variable in the front end.

WordPress provides you the destination file, it’s up to you how you access it.

Most people who are localizing variables in the front end do so along with other data they need for the application, not just the AJAX URL.

I suspect this, along with the fact that WordPress provides no other standard information in the way of JavaScript variables (excluding the emoji rubbish); as to being the reason why it hasn’t been standardized in the front end.

I’ve wondered the same thing before, in the spirit of keeping it DRY, but this is WordPress afterall where there is a great deal of carry-over in old architecture and design decisions that are still yet to be improved and this could very well be one of those things.