By all means provide code in your answers, but don't make it the focal point. The website is about statistics, not about programming.
People reading an answer are not necessarily familiar with the programming language used in that answer, or may not even know programming at all. The person who originally asked the question might be familiar with the language, but you're not writing just for this person - you are also writing for people who may encounter a similar problem with a different language or software.
So unless the question is inherently related to a specific programming language, generally the core of the answer should be language-agnostic.
Now, using code to illustrate the answer can be a nice and useful addition (personally, I often understand things faster when an answer is illustrated with code), but you can't expect code in a specific language to be useful to all readers interested in the question.