opto-coupler: transistor vs logic

Grumpy_Mike:
What ever made you think that would work?
I would imagine that is worse than ever.

Not worse, but not better either. I wanted a low-pass filter to get rid of the noise on the limit switch line. Can you explain why this would make it worse?