I wouldn't call it bad code. Just incomplete. From what I remember, Chris L. was in the process of implementing open gl2 but never finished. He and others went on to other things and development came to a standstill. Glad to see Celestia is alive again.
Back then, gl2 was the thing. Now we got gl4.
While doing this, I was running commands on the src folder. One was grep - Ri glBegin. About a page and a half. Lot less then I thought. That would need to go and replaced with gl es. And to get Android or IOS, you apparently need ogl es. But I hope the desktop versions stick around too.
Report bugs, bug fixes and workarounds here.