Arrow loops were, of course, very effective castle-defense mechanisms because they allowed the garrison to fire projectiles safely, taking the greatest advantage of the elevation of the castle. In fact, arrow loops were so effective that they stayed in use well after the castle became obsolete. Gunpowder weapons forced the development of new fortifcation techniques in the 1500s, but these new fortifications still had walls in the form of ramparts and still had to have gates.
Since these ramparts and gates were vulnerable to assault by attacking infantry, the defenders still needed to be able to open fire on attackers without exposing themselves to counterattack. Therefore, arrow loops were resurrected in the form of the firing slit, which are still in use today.