If you go to any large blog, you will see comments that won’t say anything useful but would have 1 or 2 links pointing to their own website. If you are not sure what I am talking about, here is an example:
People think that these sort of spammy comments would actually increase their ranking in the search engines. Google explains that it is not the case. Google in fact has a lot of algorithms in place that can identify these spam comments and devalue the links posted through them. Webmasters should instead spend that time on genuine ways to increase traffic to their website. If you have previously posted such comments on other blogs, you can always try to delete them and submit your website for reconsideration.
In short, only post a comment if you have something worthwhile to say. It is also wise for webmasters to protect their site/blog for spam by using comment moderation, CAPTCHA or other strategies.