I think one issue here is that, essentially, the answer breaks down as:
I wrote a blog, here it is
My blog has relevant information about X
My blog has relevant information about Y
My blog has relevant information about Z
Oh, this one line could be faster in your code.
Now, on Code Review, and on Stack Exchange in general, links are allowed if they provide ...
The issue here is not that this is spam, it's that it's not a good answer. It's perfectly acceptable to post a link back to your blog, given that it is relevant. As much as I hate to say it, the link is relevant.
I'll refer to Limits for self-promotion in answers on meta stack exchange and quote Jeff Atwood.
May I promote products I am affiliated with here?
No, I wouldn't consider it spam. When an answer like this involves code in some way, it may more-likely be considered self-promotion, if even that. I do agree that it's hardly a code review and is mostly saying how it can be done a different way, but it's still not quite spam. The answer can still be downvoted and commented to tell the answerer that an ...
In this case I believe it is not spam. It suggests an alternate algorithm (using a stack, and regex), and provides a link (with disclaimer) to an alternate library. The answer satisfies the minimum requirements, I believe.
Whether this makes for a good answer is independent of that though, but, spam it is not...
The only problem with this question is that it doesn't include the code within the question
If spam is "Hey, take a look at my code!", then Code Review is meant for spam.
For me, a real spam question would contain less text, and being a lot more unclear. Spam questions would also probably link to an available product instead of some code.
Sure there's ...
This is not spam.
Overly self-promotion may be more relevant here, but even that doesn't quite become spam until it's posted on multiple questions and with no changes between those answers (making them duplicates). Those also tend to be link-only. He does point to his blog a few times, but other than that, he is saying more than just "go to my blog." I ...