After having seen this many times before, I decided to write a short post about it. I don’t know why some people prefer using screenshots when sharing source code (e.g., rstudio/rmarkdown#520 and rstudio/rmarkdown#1133). One day Robert Flight said that he realized he was silly to include source code as screenshots, and I replied:
“We cannot be friends if you insert source code as screenshots.”
Screenshots are good for showing problems relevant to your screen. The most obvious use case is to show problems in a certain GUI (graphical user interface). When you share source code, it often does not matter what your screen looks like. It is the plain text that is essential and important.
If you only share screenshots of source code, you are forcing other people to type everything out in the images if they need to run your source code, which is meaningless. What is more, this can be very frustrating when you file bug reports, and (busy) package authors cannot run your code immediately. Ideally, when you ask a question or file a bug report, you should make it as smooth as possible for other people to step right into your issue, instead of having to go back and forth with you before they can really do anything.
I wrote a post on “Code Pollution With Command Prompts” a couple of years ago based on the same idea, but some people still prefer their own habits (feeling more comfortable with seeing prompts) over convenience to other people.
Donate
As a freelancer (currently working as a contractor) and a dad of three kids, I truly appreciate your donation to support my writing and open-source software development! Your contribution helps me cope with financial uncertainty better, so I can spend more time on producing high-quality content and software. You can make a donation through methods below.
-
Venmo:
@yihui_xie, or Zelle:xie@yihui.name -
Paypal
-
If you have a Paypal account, you can follow the link https://paypal.me/YihuiXie or find me on Paypal via my email
xie@yihui.name. Please choose the payment type as “Family and Friends” (instead of “Goods and Services”) to avoid extra fees. -
If you don’t have Paypal, you may donate through this link via your debit or credit card. Paypal will charge a fee on my side.
-
-
Other ways:
WeChat Pay (微信支付:谢益辉) Alipay (支付宝:谢益辉) 

When sending money, please be sure to add a note “gift” or “donation” if possible, so it won’t be treated as my taxable income but a genuine gift. Needless to say, donation is completely voluntary and I appreciate any amount you can give.
Please feel free to email me if you prefer a different way to give. Thank you very much!
I’ll give back a significant portion of the donations to the open-source community and charities. For the record, I received about $30,000 in total (before tax) in 2024-25, and gave back about $15,000 (after tax).