Militaristic Karate Tradition
When the average person hears the term "martial art", the first images that come to mind are either the over-the-top fight scenes that they see in the movies or cage fights due to the rising popularity of MMA. We sometimes forget the "martial" part of it. These arts were created and developed for killing and many of the militaristic rituals and practices can still be observed when you walk into a "traditional" martial arts school.
This is especially true in the case of Shotokan karate. The best example is the pre- and post-training lineup. Students and practitioners are made to line up according to rank with the lowest on one side of the room and the highest on the other.
But there's more to this. Most karateka will notice that the way people line up may vary depending on the dojo that they go to. In some schools, the highest ranking student is on the left side of the room. In others, they're on the right side. Again, the reason has to do with a military way of thinking.
The idea is that students have to line up according to the dojo's main entrance door. Normally, the beginners line up closest to the door and the higher levels and even assistant instructors are furthest away. There are two reasons for this:
1) In case of challenge from another school
The challenger will be forced to go tire himself out by having to fight off the "weaker" students first. He will then have progressively more difficult fights as he moves up the ranks. By the time he reaches the end of the line, the challenger becomes so tired and injured that it will be "easy pickings" for the top student and the instructor if necessary.
2) In case of deadly assault on the school
The second reason is really more militaristic in nature. In case their enemies enter through the door, swords flashing and maybe even guns blazing, the first people to get killed are the beginners. Much like in war, the lower ranks are killed on the front lines, while the officers and generals stay in the back.
In both cases, the beginners are kind of treated like expendable pawns and human shields. The higher ranked students are given the time to defend themselves and/or escape so that they can preserve and pass on their knowledge of their fighting art. Definitely a very old, militaristic, and Japanese way of thinking.
Of course, these kinds of concerns are not as valid anymore, but the traditions have been kept. Except in my school, that is. In our case, the instructor has a bit of a different philosophy on the subject. The highest ranking students have the responsibility of defending the dojo. So WE line up closest to the door.
Meaning that if there's ever any trouble, I'll be the one to get killed first.

