Armament carried connotations of class and honor. By the early 19th century the wearing of a sword by gentlemen was less common than it had been 30 years earlier but the custom persisted in the military. In the army, it was common for enlisted men to carry a small sword, called a hanger, with the full length variety carried by commissioned officers. The Royal Navy, naturally, was different. It prescribed a category of short sword called a dirk for wear by midshipmen.
This is an interesting account of the dirk and its history.