I've travelled from Istanbul/Izmir to Ankara and beyond to Diyarbakir and also to Kars. Over the last ten years services have changed significantly, some trains have been withdrawn and remaining services have been re-equipped with new or refurbished stock. The line wastwards from Istanbul is closed (to all intents and purposes) for rebuilding in relation to both the Matmaray project (tunnel under the Bosphorous) and the high speed line to Eskisehir (which is complete from Eskisehir/Konya to Ankara). The line westwards from Istanbul into Europe is also largely under an engineering blockade with limited services. This means Istanbul (which features its own light rail and two suburban heavy rail services) is isolated (rail-wise).
However Izmir, Ankara, and Eastern Turkey are all linked, with extremely comfortable, cheap, but slow overnight (and longer) services. Turkish sleeping cars are particularly good value and very comfortable, although the portions in the restaurant cars are a little on the small side!
Where the railway exists it is the cheapest and most comfirtable way around Turkey, but not the fastest. It is easy to book online - seat61.com is a good source of advice.
The traction and rolling stock scene is less interesting than it was, but still very much worth the visit with big noisy diesels in fantastic scenery.
There's even a through train to Iran, but good luck getting a visa. When I did eventually get one, the train was booked out!