Well that comes down to movement, and how much you want in your tank. chromis are going to be swimming a lot, and the cardinals will just kinda float together. If you plan on having some other active fish, I would go with the cardinals. Chromis have a pecking order, and if you get 5, you will end up with 2.
That's what happens to me I have added 6-10 chromis to a few tanks over the years from 20gal to 120gal and after a few months I end up with 1 or 2.
I had one that lasted over a year by himself. The up side to cardinals is you might get them to breed and that would be fun to see.
I've had the same experience with chromis. They will school together at first but once they settle in the dominate ones will start picking on the weaker ones and after a few months you will end up with one chromis.
I have been reading about anthias the are awesome but I've heard you either get a good one or a bad one ? Are the hard to care for ? To big for a 40 breeder?
I must have good luck with chromis, I started off with 8 two years ago and I still have six. One died because he jumped onto the floor and was injured the other one was actually killed by a sixline wrasse when it turned evil. They are cool fish that move around a lot...