It’s not bad practice , it just shouldn’t be a very common practice. There are valid reasons for using a union (e.g. aliasing or sometimes really tightly packing data where the actual types might not always be the same), but those are not the kinds of code you will write every day.1 May 2015