Yup, with a sentient computer called Mike who slings rocks at Earth.
That's the one,
Cigar for Mr 42, or a good drop of whatever you fancy
First book I thought of!
Heinlein is someone who could write well, and carry a story, as well as challenge preconceptions. His description of the US juvenile-into-adult justice system in the USA was spot on* (pity about his proposed solution, though)
What grates about him now (in my experience) is that I see far more clearly his obsessions, particularly in intergenerational sex. Putting aside the incest in "Time Enough for Love", you see the same 'little girl becoming older male relative's partner' trope in everything from 'Door into Summer'. an adult book, to 'Time for the Stars', allegedly a young person's book, by way of 'Farnham's Freehold'. Alpha male gets very young bride, in essence.
*In essence, he criticised the then-current US juvenile system and compared bringing up a child to bringing up a dog the wrong way. You see the puppy make messes in the house, so you just lock it up for a few hours before letting it out again. After a year of this, you realise that the dog is now an adult, so the next time it pees on the carpet, you shoot it dead.
Another quote from that one was about the phrase "juvenile delinquent", where "delinquent" means failing in responsibility, while "juvenile" means too young to exercise responsibility in the first place.