Not only is a screenshot harder to read, the code can't be copied and pasted into our own IDE for testing or the like. Use the formatting toolbar to add code with dedicated formatting and it can also be used to highlight specific lines. If there are error messages, they are text too, so post them as quotes. Again, we can then see them without any extra effort and we can copy and paste to search if required.