On Sun, May 10, 2020 at 07:39:32PM -0400, Jonathan Goble wrote:
Sometimes people are forced to use Word to type code. One example is creating user manuals.
MS Word is not the only word processor capable of creating user manuals. The LibreOffice people, and others, would like a word :-) If you are a professional writing and formatting an entire book in Word or LibreOffice or some other application, then you can be expected to solve this problem for yourself. (Turn Smart Quotes off.) There are a couple of professionally published Python books written using Restructed Text, Sphinx and Python. So people do have a choice, or at least a technical choice.
Another example: As a current computer science college student, last fall I had an operating systems professor who gave exams by posting the questions online and giving us 24 hours to write and upload our answers (with the exam being closed-book and on a 2-hour time limit "on the honor system"). Several of the questions required us to write Bash scripts or Python functions, and we were required to write all of that code, along with all of our other exam answers, several of which were essay questions, in Microsoft Word and then export the whole mess as a single PDF file to be uploaded.
How would your professor know that you did the actually typing in Word, instead of doing the sensible thing and typing your code in a text editor and then copying and pasting it into the Word after turning Smart Quotes off?
So no, sometimes people don't get a choice of what to type code in.
Here is an actual example where the people writing actually had no choice, rather than having choices but failed to take advantage of them. I know of a case a company that was called in to solve a problem with desktop PCs at a correctional institution. The PCs were locked down to only approved applications, which included Office but absolutely no plain text editors. Office was required so that the inmates could participate in educational programs. It also included Python. You can see where this is going, I'm sure. It turned out that one of the inmates had typed up a simple Python game in Word, saved it as plain text, and somehow managed to find a way to get access to the command prompt and run it as a script. Never underestimate the ingenuity of bored, intelligent people with a lot of time on their hands. So this was a case where the user *genuinely* had no choice but to use Office, not just because they didn't know better or couldn't be bothered. But the bottom line is, so what? Why should we care about such incredibly narrow niches? - writers who don't know how to turn Smart Quotes off in Word; - students sitting a very badly designed exam; - inmates with Office and Python but no text editor. I'm sorry to all those people, but they are not our core demographic and we aren't going to spend valuable time and energy making Python work for the code they write in Office with curly quote marks. [...]
And yes, several students lost points for syntax errors because Word "helpfully" converted their quotation marks.
A valuable lesson learned: the tools you use *do matter*. Tooling is important. Details matter. -- Steven