I've had some different friends work with colleagues who literally do this. My friends typically left for various reasons, but it never seemed like the best way to "make you improve your code" to me.
I think it would be better to cause an exception or even a segfault for that