Sort:  

I had no idea about that. Considering it was built in the 14th century it would be easy to think it was for defensive purposes.

Well, the did not build it up just to feed the peasants, obviously - the city protection was important too. Yet we can call it one of the very first attempts to establish a social security system in my country ;)