This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

I second this request. Line numbers if implemented properly should not make copying code difficult as the other comments seem to suggest. I am sure you have seen plenty of other sites with copy-safe line numbers. google search for "code show line numbers blog" gives akomaenablog.blogspot.com/2009/05/… which is pretty copy-safe
–
abelOct 2 '10 at 10:31

As well as all the other points (in particular the "copy/paste" argument), I'd add the following.

Line numbers are useful in longer pieces, where you refer to "line 4: set up the connection, line 5: provide credentials, line 8: set up the query" and so on. However, I've found that the vast majority of StackOverflow questions (certainly ones I'm involved in) don't have such quantities of code in the answer (explanation isn't always needed or given in any longer question's code segments), so any explanation needed is usually given in the text or in comments.

When I'm publishing code segments on sites, and need to provide notes for specific lines, I usually use something like this: