I poke my head in and say hi, mostly just to BS with the crew. I always like meeting new faces at my airline anyway. If they seem busy, of course I won't bug them.
If it's not my airline, I'll always check in up front while in uniform, even if it's a deadheading situation with a real ticket. I'd rather risk an eye roll from a Captain that doesn't care than have some guy that does care wonder who the hell I am in the back of his airplane.