My wife is a physician, so let me chime in. It's not so much a hazing ritual but a very carefully constructed mentorship program. It's intense, and in some cases maybe overly so, but the goal is to immerse them into the environment, and to provide a lot of experience, while being carefully supervised by more experienced doctors. After three years of this, you come out really knowing you stuff.
In software, we don't really have structured learning like this, which is unfortunate. Something that would be great to have to really make us into a true profession.
Don't we, to a small degree already? They are called implementations. Often over promised, under-staffed and under-scheduled time-wise. Long hours are spent, a truckload is learned, experience is gained, etc. Unfortunately, there doesn't seem to be a 3-year limit.
That's actually fairly common in fields where mistakes can be dangerous. Most places refer to it as apprenticeship, but it's fairly common in even less glamorous trades like electrical work, carpentry, etc.
The difference as far as I know, is that apprentices have normal working hours, while residents are sleep deprived to counterproductive levels and they could be barred from becoming a doctor at the end of it. If residents had normal hours like the rest of the doctors, I wouldn't nearly be nearly as apprehensive about it.
In software, we don't really have structured learning like this, which is unfortunate. Something that would be great to have to really make us into a true profession.