It depends on what you're doing with that source. If it's for reference, yes, that's a good place. /usr/local
is reserved for software installed locally by the sysadmin. So, if you want to install software along with source files (for other programs to use or for people to look at), that's good.
It's not meant, however, to be a workspace. Since it is local, you can do whatever you want, of course, but this isn't designed to be the place to put your software development tree.
That should, really, be in a code repository (possibly in /srv/sourcerepo
or something), and then developers would check out their own working copies into their home directories.
/usr/src
as of Ubuntu 23.10 appears to be a location where you are supposed to dump source code for packages you have downloaded debug symbols for: https://askubuntu.com/questions/487222/how-to-install-debug-symbols-for-installed-packages/1434174#1434174 which allows you to debug crashes on packaged software with GDB. – Ciro Santilli OurBigBook.com Jan 15 '24 at 07:42