While I agree it's no fun to develop a game and see someone else come out with something similar earlier, in the end it's about your goals when making a game.
I want to make some fun games that I would play myself and at the same time learn some new things when it comes to programming. If someone else beats me to the punch, I'll be disappointed but I'll also want to try their game and maybe it's just more fun than what I was making. And you can learn from that game, maybe see some things that don't work well and improve on them.
And it's also frustrating when someone (or lots of people) release a similar game after you've released yours. But maybe that just means that your game is fairly simple to make (clones usually seem to be quite easy to make) and what you did, while an achievement for yourself, isn't the next big thing anyway. That may sound a bit harsh, but if you focus on your own goals first, it's something that can be lived with. There's always the next game, anyway.