JavaZone 2010 - Why We Should Start Tagging Our Code

Most languages allow source code to be organized in smaller units, like e.g. packages in Java. Usually, these units can be organized in their turn, thus creating a hierarchy of packages and classes, interfaces, enumerations, etc... In Java, these packages are closely tied to the file system's directory structure, which may not always be an advantage.
Hierarchical structures are typical of the 20th century. In the 21st century, however, tagging has become a much more popular way to classify objects. Web sites like Delicious and Flickr are examples of places where people tag objects using keywords rather than storing them in a hierarchy. Just compare those sites to the yellow pages of the early days of the Internet, and you can see the difference in flexibility. So why do we stick to strict hierarchies for our source code while we're boasting we're so agile in everything else?
Tagging the code with multiple tags allows programmers to browse the source code of a project using different perspectives. Do you want to browse your code by layer or by feature? Maybe you're trying to find all classes using a certain pattern? Maybe code coverage doesn't matter that much in a particular layer of your application, but is critical in one of the subdomains of the model? Clearly, a more flexible way to look at your code than a simple hierarchy would be more than welcome!
Filip van Laenen

Filip van Laenen

Filip van Laenen is a Chief Engineer at Computas AS, which supplies IT solutions to the public and the private sector in Norway. He has over 10 years of experience in the software industry, from being a developer in both small and large teams to being the lead developer and compentency leader for security and software engineering for the whole company. In his professional career he has used a number of programming languages, including Smalltalk, Java, Perl, Ruby, and PL/SQL. He has a special interest in computer security and cryptography, and held the position of Chief Security Officer at Computas for a number of years.
Filip holds a M.Sc. in Electronics and a M.Sc. in Computer Science from the KULeuven. He comes originally from Flanders, but moved to Norway in 1997 and now lives with his family in Kolsås near Oslo.