Tip #1296: Quoting for developers

If you think this tip is great, I’ll take it as a compliment. If you think it’s lame, Joel is the one to blame because he was the one who convinced me to publish it.

I like smart quotes (in Word and in Outlook). They make your text look “smart” without too much effort. On the other hand, they are pain in the neck when you need to insert a piece of code that contains single or double quotes. Smart quotes ain’t so when copied and pasted into a code editor.

This is what I do when I use Word/Outlook and want to make my code reusable: I type the quote and then immediately press Ctrl-Z. That “undoes” just the last operation which happened to be the conversion of a quote to a smart one. Problem solved.

Cover photo by unsplash-logoFlorian Klauer

Leave a Reply

Your email address will not be published. Required fields are marked *