9 ms·
Shell scripts to improve your writing
- randomstring 10y agoI read the whole article thinking "this needs to be an emacs mode!" only to get to the punchline at the bottom. >> Benjamin Beckwith has contributed a "writegood" mode for emacs inspired by these scripts. This is going into my .emacs right now.
- mortenlarsen 10y agoFunny coincidence that it was named "writegood" by a guy named Benjamin and "Silence Dogood" was a pen name of Benjamin Franklin.
- wyclif 10y agoIs there anything like that for vim?
- sdegutis 10y agoSo, on a related note, someone wrote a blog post a few years ago that just perfectly epitomized the annoyingly pretentious writing style everyone in the tech world seems to have, and I recommended to him that he use simpler phrases and words and sentences. Everyone in that chatroom criticized me as both an idiot and an asshole. Skip ahead a year or two, and PG writes the same fucking thing in a blog post and posts it here, and everyone praises him. What I took from this is that I'm not actually an idiot after all, and I should probably stop listening to people who say that I am.
- lj3 10y agoSocial proof is a real cognitive bias and it applies to programmers too.
- the_d00d 10y agoA chatroom mob got you that upset? You were just offering some advice. It is there problem if they choose to ignore it. Seriously dude, you should relax.
- teach 10y agoFirst of all, this isn't written by Paul Graham; it was written by Matt Might and posted by someone else entirely. Just because it got upvotes on Hackernews doesn't mean that PG was involved. Secondly, there is a difference in context, timing and tone in an article like this. Here, a PhD supervisor is speaking generally about the sorts of errors his students tend to make. In your situation, you were "attacking" a single person publicly. If you had had the social grace to make your comments privately and in person (rather than in a chatroom) they probably would have been better received. If your takeaway from this post is just to "ignore the haters" then I'm afraid you're missing out on some real opportunity for self-improvement.
- bdowling 10y agoHe was probably referring to this article. http://paulgraham.com/talk.html http://paulgraham.com/talk.html
- sdegutis 10y agoYep that's exactly it. And I had the same thought of "this is the last straw" too that Paul's talking about there. I just got fed up with seeing everyone write like that, everywhere. Thanks for the link.
- Solinoid 10y agoCan you provide an example of this style? thanks
- Solinoid 10y agoI think the Soylent CEO's blog is an example of this, but I haven't really noticed it as a trend in the tech world.
- danso 10y agoI do something similar to the OP. When I'm working on a long project with multiple pieces that I might have left incomplete, I'll use a grep-like (like ack, which has PCRE) to quickly look for placeholders or cusswords: ack -C -i 'tk|to ?do|lorem|fu.k|shit|wt[fh]|[!?.]{3,}' Maybe the OP's goal is to have his phds practice more shell scripting and syntax. But it seems the same effect could be achieved with grep and the flag to filter from a file of patterns, rather than creating an unwieldy single string to enumerate all the possible words. Instead of having to write if/else logic to provide a lackluster CLI, have students create a repo of weasel words and use git clone/curl with grep. I didn't read through his third script for detecting duplicate words, but couldn't it be achieved by using PCRE regex and backreferences? http://stackoverflow.com/questions/2823016/regular-expression-for-consecutive-duplicate-words http://stackoverflow.com/questions/2823016/regular-expressio... Off-topic, but I've been meaning to write a post on how learning the command-line made me a significantly more productive writer. I do most of my writing on sites built from static site generators, such as Jekyll and Middleman and Sphinx. For many of my tutorials, I have to describe graphical elements which require taking screenshots. I of course know the OSX keyboard shortcut to turn on the screen grab utility and interactively make a selection. But this saves the screenshot to a default location with a generic file name. To include that image in my blog, I have to move it over to my working directory, rename it, and then write the img code and src attribute to my blog post. It's enough annoying small steps that including images in my posts was a huge chore. Sometime ago, this blog post on OS X Terminal Utilities [0] made it to HN's front page and I learned that screencapture could be invoked from the Terminal. So I wrote a little Ruby wrapper that, when invoked from the command-line with an argument for output path, would call screencapture after a 2-second delay -- enough time for me to Cmd-Tab from a Terminal to the application I want to screensnap -- and then save the snap to the specified destination and output HTML/Markdown that I could paste into my blogpost. Sample usage: $ screenpy images/path/to/screenshot.jpg stderr: Writing to: images/path/to/screenshot.jpg Format: jpeg quality: 75 optimize: True  stdout: <img src="images/path/to/screenshot.jpg" alt="screenshot.jpg"> I've iterated the tool, converting it to Python and including the was-sdk so I could upload to S3 if I need an absolute URL. And I've written plenty of other utilities since...but it's hard to overstate how much being able to operate via CLI has smoothed my writing experience. It's not just that it saves me time, but I'll write visual-heavy posts that I would have never even tried, especially back in my Wordpress days. [0] http://www.mitchchn.me/2014/os-x-terminal/ http://www.mitchchn.me/2014/os-x-terminal/ [1] https://gist.github.com/dannguyen/bfb45408d43986eefdf83b59bc9e8629 https://gist.github.com/dannguyen/bfb45408d43986eefdf83b59bc...
- seanwilson 10y agoIs there anything like this for Google Docs, Gmail or Atom? We've had spellcheckers for decades but I find it really surprising that automated grammar and proofreading checkers aren't in common use yet. For example, having my email client highlight overly long sentences, duplicate words, ambiguous references (e.g. what noun does "it" refer to) and more would undoubtable save proofreading time and doesn't sounds that difficult to implement. I see online comments every few days of someone pointing out the word loose/lose is used incorrectly for instance. I recall that many grammar checkers suffer from false positives though but has the technology not advanced?
- ehudla 10y agoNot very long ago I posted a Ask HN about this: https://news.ycombinator.com/item?id=12366364 https://news.ycombinator.com/item?id=12366364
- walterbell 10y agoonline grammar checkers: http://nybookeditors.com/2016/02/instantly-improve-your-writing-with-these-11-editing-tools/ http://nybookeditors.com/2016/02/instantly-improve-your-writ... offline grammar checkers: https://www.serenity-software.com https://www.serenity-software.com & http://www.editorsoftware.com/StyleWriter.html http://www.editorsoftware.com/StyleWriter.html
- huac 10y agoSee Draft for markdown based editing w/the 'writing improver' - www.draftin.com
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]
- confounded 10y agoVC funded browser extension: https://www.grammarly.com/ https://www.grammarly.com/
- killercup 10y agoOh, that reminds me: I rewrote that bash script (and a bit more) as a Rust lib (+ CLI) for fun last year. If anyone wants to build on it: https://github.com/killercup/english-lint https://github.com/killercup/english-lint
- empath75 10y agoNobody should be using Strunk and White as a style guide after primary school. There's nothing fundamentally wrong with passive voice, or adverbs, or any of the other things that he mentions here. http://www.chronicle.com/article/50-Years-of-Stupid-Grammar/25497 http://www.chronicle.com/article/50-Years-of-Stupid-Grammar/... He doesn't even correctly identify what weasel words are. ("Some people say", "It is believed", etc). I'm not sure why 'very close match' is any more opinionated than 'close match' is. It's not as if the latter is precisely defined.
- rflrob 10y agoI would agree that "close match" isn't a lot better, but the style in science papers is to say something like "A is a close match for B (r=.85)", where of course the precise value of metric and whether that is a close match or a terrible fit is specific to the field it's being published in. But the "very" really does add nothing. The other reason is probably that "very" is very easy to detect in a bash script, whereas looking for other, more subtle weasels is a lot harder. Given the generally poor level of scientific writing (I have certainly given my PhD advisor some turds), huge improvements can be had by just going after the easiest cases.
- gkya 10y agoI really don't get what's wrong with passive voice at all. In my mother tongue (Turkish) and my L3 (Italian) passive voice is a part of the educated speech. Certainly it is harder to use than direct speech (in most cases), but why neglect it?
- actuallyalys 10y agoThere's nothing intrinsically wrong with the passive voice, but people overuse it. For example, I've edited technical documents that used the passive voice so frequently that I lost track of what was being done by the user and what was being done automatically.
- gkya 10y agoOkay, but why throw the baby out with the bathwater?
- BuuQu9hu 10y agoAnother similar tool: http://proselint.com/ http://proselint.com/
- mrob 10y agoYou may also be interested in LanguageTool, which catches many potential problems in several languages. It's the best Free Software style and grammar checker I've seen: https://languagetool.org/ https://languagetool.org/
- raverbashing 10y agoLooks like good guidelines overall, I just have one complaint > Bad: We used various methods to isolate four samples. > Better: We isolated four samples. The first sentence is right if a different method was used to obtain different samples. This is relevant information
- bryanrasmussen 10y agoI thought replacing 'quite difficult' with 'difficult' was unfair because I have always supposed quite to mean very or extremely when used in this manner.
- hyperpape 10y agoLater he cautions against adding 'very', so he's consistent at least.
- bryanrasmussen 10y agowhat about slightly difficult. It's basically a language denuded of gradation.
- hyperpape 10y agoI think absolutism on this point is a bad idea. But I do think that many people, including myself, overuse qualifications in contexts where they don't add anything. In the example of a close match, what distinguishes a "very close match" from a "close match"? Better to omit the "very" unless you can quantify it, or otherwise make it clear what it adds.
- faitswulff 10y agoI would say it is relevant if you used different methods for each sample, but I understand why the author would omit "various" - it's too ambiguous.
- raverbashing 10y agoLooks like good guidelines overall, I just have one complaint > Bad: We used various methods to isolate four samples. > Better: We isolated four samples. The first sentence is right if a different method was used to obtain different samples. This is relevant information
- 5706906c06c 10y agoLove this! English is my third language; I often fall for using passive voice, adverbs or fillers. Much like this script, I found Grammarly to be extremely helpful in forcing me to rethink the above when composing.
- carlosbarreto 10y agoHello, I wrote similar script to do the Belcher diagnostic test in LaTeX documents. This test consists in highlighting parts of the text with potential problems (e.g., vague pronouns, weak verbs, and passive voice, among others). You can find the instructions to do the test (and some good examples) in the book Writing your journal article in twelve weeks: A guide to academic publishing success. The script and its documentation are here: https://github.com/carlobar/BDT_latex https://github.com/carlobar/BDT_latex https://github.com/carlobar/BDT_latex/blob/master/docs/documentation.pdf https://github.com/carlobar/BDT_latex/blob/master/docs/docum...
- ScottBurson 10y agoIn the footnote, what is that comma after "Regehr" doing there? Delete it! But yes, "note that" is a bugaboo I have to battle in my own writing. With rare exceptions it can just be deleted; occasionally it indicates that the following point deserves more emphasis than I have given it.
- erlehmann_ 10y agoThere is also GNU style and GNU diction: https://www.gnu.org/software/diction/ https://www.gnu.org/software/diction/ ; cat <<EOF >/tmp/testfile Diction and style are two old standard Unix commands. Diction identifies wordy and commonly misused phrases. Style analyses surface characteristics of a document, including sentence length and other readability measures. These programs cannot help you structure a document well, but they can help to avoid poor wording and compare the readability (not the understandability!) of your documents with others. Both commands support English and German documents. EOF ; LANG=C diction --lang en --suggest /tmp/testfile /tmp/testfile:2: These programs cannot help you structure a document well, but [they -> (do not use as substitute for "each, each one, everybody, every one, anybody, any one, somebody, some one")] [can -> (do not confuse with "may")] help to avoid poor wording and [compare -> "Compare" to points out resemblances, "compare with" points out differences.] the readability (not the understandability!) of your documents with others. 3 phrases in 5 sentences found.
- eriknstr 10y agoI like the way you format commands using semicolons at the beginning. I might start doing this too when writing online.
- feld 10y agoI've kept these in my GitHub for a while now https://github.com/feld/technical-writing https://github.com/feld/technical-writing
- emmelaich 10y ago[edit: I see @erlehmann_ beat me to it but am leaving it here anyway] I would be great if someone could enhance the programs `style` and `diction` [1] to incorporate these hints. And make a browser add-in for good measure! I used `diction` religiously back when I used a UNIX System V system -- it helped me a lot. 1. https://www.gnu.org/software/diction/ https://www.gnu.org/software/diction/
- plg 10y agoA fantastic book for improving your writing: On Writing Well by William Zinsser
- kazinator 10y ago> My Ph.D. advisor, Olin Shivers, ... And you're proudly shell scripting. :)