In my opinion, one of the biggest problems facing Math SE right now is the proliferation of nearly identical questions which are essentially the same problem, asked over and over again, but with different numerical values. One way to help alleviate this problem is for folk to write general questions which give "canonical" answers to those questions—indeed, every question which I have posted on Math SE has been in order to address commonly duplicated questions. Thus, in general, I am in favor of posting questions which generalize, and which can serve as duplication targets for, other questions.
That being said, if you are posting such a generalization, please ensure that it really is a generalization, and that it could (potentially) answer a larger range of potential questions (or, indeed, your generalization could immediately serve as a dupe-target for more than one already extant post). On the other hand, if your new answer is only a minor generalization, or if you can't see it addressing a larger range of questions in the future, please consider posting that answer in reply to the question which you are seeking to generalize.