I like to be able to compare mp3’s programmatically. The problem I don’t know by what. Header? Histogram? channels? Does anyone have experience with this subject?
To answer your question better I think we need to know exactly what you are looking to do.
If you are looking to compare the actual song, musicDNS have a library that are able to create audio fingerprints. The library called libOFA can be found here. This fingerprinting system is used by for example musicbrainz to match digital audiofiles to their database. In theory you can use this to compare two different digital files.
If you are looking to compare tag data (id3v1/id3v2) there are a lot of libraries that can do that for you, taglib is mentioned and also libmpg123 have their own functions to extract tag data.
The good thing about the libOFA approach is that you can compare different formats to each other since the fingerprinting is done on the audio itself.