In most IDEs, you may choose whatever font you like. If you find an oldstyle font more readable, pick it.
Note that all (nearly all?) oldstyle fonts are proportional, while proportional fonts have some issues when using them in programming context.
Aside that, let's test and compare some oldstyle fonts to the fonts usually used in IDEs. I have only Windows environment for tests; if anyone could add illustrations for fonts used in MacOS or Linux, feel free to edit the answer.
There are multiple oldstyle fonts installed by default in Windows/Microsoft Office:
In order to avoid duplicates and shorten the answer, I take only three oldstyle fonts: Georgia, Corbel and Gabriola and three classical fonts: Courier New, Lucida Console and Consolas.
Simple to use, but hard to make the difference between the digit "0" and the capital "O". The text is too light, which would make it difficult to read on a black background with light text.
Same problem with digit "0" and capital "O", but compared to Courier New, the text is easy to read even on black background.
The recent Consolas font was specifically created to use in IDEs and other source code-related contexts and to replace the former Courier New. It totally removes the ambiguity between the letter "O" and the digit "0" by using slashed zero character.
It remains very readable for both large and small sizes and for both light text on dark background and dark text on light background contexts. If you use ClearType, Consolas is an excellent choice.
This is a nice font, but was rather designed for print. On an LCD screen, small text has some glitches with whitespace which feels not very uniform (as you can see on the screenshot).
The largest issue is that there is nearly no way to make the difference between the small letter "o" and the digit "0". Seriously, is it
CoordinatesOf0? This sole issue is a deal breaker for an IDE.
The font is very readable, even with a small size text. Due to oldstyle, numbers are very easy to read too.
On the other hand, this font suffers the same issue that Garamond: no clear difference between the small letter "o" and the digit "0". This sole issue is a deal breaker for an IDE.
As you can see, the font is impossible to use, unless you set a very large size in your IDE. This font is for happy new year cards, not for programming.
In conclusion, most oldstyle fonts suffer from the similarity between the small letter "o" and the digit "0", and in many cases, there is no way at all to make the difference between the two. See for example Gabriola or High Tower Text: those two characters seem identical.
If you're in love with oldstyle figures, there are two other solutions.
1. OpenType oldstyle
Actually, OpenType has an oldstyle feature for some non-oldstyle fonts. For example, Consolas font has this feature. I can't find neither how you can turn this feature on in Visual Studio, nor even how to do it in Microsoft Word 2007, but you may deep more in this direction if oldstyle is something you really need, but can't afford losing the strong points of monospace fonts.
Microsoft Word 2010 seems to support old-style option for OpenType fonts, but I don't have Office 2010 to actually test it.
Visual Studio 2010 may also be able to support it through an addin which changes the WPF options of the editor, since the oldstyle option exists in XAML and Visual Studio 2010 and later uses WPF.
2. Syntax highlight
Another solution is to use a real oldstyle font, but with syntax highlighting for digits:
Personally, I don't know any IDE which would support that. Visual Studio, for example, let you personalize the color of numbers (for example "123D" in
var a = 123D;), but not digits (for example '5' in
this.label5.Text = "Hello";). But there is probably a way to write an addin for an IDE to change the syntax highlighting.