It might work on one series, but I wouldn't count on it as being reliable across the board.
I have seen various PICs come up with totally random values in port latches at POR, so
you really do need to clear portb latches first if it's to be reliable.