Actually, talking about code fonts is a bit politically incorrect because it assumes that code is always written in a monospaced font. However, some people dislike writing code in monospace and find it difficult to read.
Setting aside these factors, developers who write code in monospace fonts still make up the majority. This article shares some monospace fonts that have been used in recent years.
The choice of font is not important and won't affect your productivity, but sometimes it's interesting to see a developer's preference. Maybe you can find a font that suits your taste. Here they are, listed in order of preference.
0. IBM Plex Mono
https://fonts.google.com/specimen/IBM+Plex+Mono
1. MonoLisa (Paid)
I don't have much research on fonts, but I thought it was cool after reading the introduction on their website, so I bought it. I haven't encountered any major issues so far, and I use MonoLisa for both the terminal and VSCode. They have compared it with other monospaced fonts on their website, so you can take a look.
2. Microsoft - Cascadia Code
https://github.com/microsoft/cascadia-code
This is an open-source monospaced font produced by Microsoft, and it has a distinct appearance compared to other monospaced fonts. If you want to change fonts and switch up your mood, you can give it a try.
3. JetBrains Mono
https://www.jetbrains.com/lp/mono/
JetBrains' monospaced font looks noticeably narrower and taller than other monospaced fonts. I used it for a while and didn't encounter any major issues. I quite like using it with JetBrains' IDE.
4. FiraCode
https://github.com/tonsky/FiraCode
For me, FiraCode is a decent monospaced font. I didn't have any major issues using it, although I personally feel that the spacing is a bit wide.
(Image taken from GitHub)
5. Monaco
The built-in monospaced font on Macbooks.
6. Hack
https://sourcefoundry.org/hack/
Another decent monospaced font, it feels a bit more rounded?
That's about it. If I come across any other fonts in the future that I like, I'll add them.