And it is indeed. Having said that, the ideal is always to nail the dress code. And there is one good trick to accomplish it: ask. There is no problem in asking about the dress code when you are going to any social event you were invited to. You can ask if it is not stated on the invitation or if it is but you are not so sure what the dress code means exactly. There is no shame on it. Trust me.
If by any real chance you cannot ask anyone about the dress code, you can do a research on it. And this is particular good to do when you have a job interview in your way.
And if this is not a possibility as well, then dress up a little bit for the occasion. Besides the fact that is better to be overdressed than underdressed, it is also easier to relax your dress code when you are overdressed. In most cases.