Interviewers will be interested in what kind of work you have done before (whether for a programming job or more generally). If you are the sort of person who gets a bit nervous at an interview, and might forget to mention something in the heat of the moment, a portfolio provides you with a handy reminder of what work you have done, to talk about.
Images showing your past work (e.g. screenshots, for a programming interview) are a particularly good idea to include, if your work had a suitable visual depiction. From the interviewer's perspective, seeing an image depicting the work can really help to quickly get an overall picture of what the interviewee is talking about. Also, if you end up explaining some technical point about the work, an image might be handy to point to, to illustrate.
If you are not sure whether to include a screenshot (or another document) or not, try imagining yourself in the shoes of the interviewer and ask yourself whether this would help the interviewer see what you have to offer better. I find it hard to imagine whether examples of code would help, unless an interviewer has specifically requested them.
A portfolio also makes you look well-prepared and keen, an added bonus!