at89s52 the right way to drive transistor
Yes, it is correct, at least for ports other than port 0, which has no pullups at all. The current will not exceed about 50uA (except very briefly at the low to high transition) so you do need to make sure the collector resistor isn't too low value - 15K might be a reasonable minimum. 

For all 'scientific answers' you should refer to the fine datasheet where all the details are laid out for your perusal. 

By the way, it's a reasonable guess that the internal pullup is not a a "resistor" but rather a MOSFET designed to have a low Idss. 



Edit: For those unfamiliar with "classic" (aka old as dirt) microcontroller port structures such as the pseudo-bidirectional ports of the 80x51, here is what they look like: 



Note the absence of any distinction between input and output modes. This is a simplified schematic, the internal pullup weak MOSFET is actually paralleled with a strong speed-up MOSFET which briefly switches on during low-to-high transitions.



To clarify where I got the 15K value- 

The current out of the output when high will be a maximum of 50uA according to the datasheet \$I_{IL}\$ specification (in other words, it will always be less than 50uA). No typical or minimum is given. 

I have assumed that minimum is 1/3 of that (17uA) as a rule of thumb so the collector current of Q1 (left transistor) should not exceed 333uA (forced β of≤20) and thus the load resistor for +5 should not be higher than 15K

Is this good design? Any time you depend on guesses like my 1/3 rule of thumb you are taking a risk. It would be better to invert the output and add a base resistor, and use a PNP so that the output actively sinks current when 'on'. That way the base current is guaranteed by specifications in the datasheet. The shown circuit will work however, given appropriate values. The determination of the appropriate values involves either educated guesses like mine above, or measuring each unit, neither of which is preferable in a professional design.