The recently new Stack Exchange feature Stack Snippets is recommended to use for new posts.
Is it allowed and recommended for existing posts too?
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.Sign up to join this community
It's allowed, but I personally wouldn't recommend it.
If you come across a post and it requires other edits then you might as well convert the code samples to snippets. However, if it's the only thing you are doing or you are just looking for posts to convert then you're probably doing it wrong.
See my answers on Stack Overflow for my thoughts on this: