Skip to main content

word choice - "End with" vs. "end in"


I'm writing up some documentation, and I'm unsure which phrase to use:



Option X: Find all strings ending with foo.



or



Option X: Find all strings ending in foo.



Are both correct? (Google spits out both, strongly favoring with.) Which should I prefer?



Answer



"Ends in" is acceptable in the sense that words can end in a vowel; end in an "a"; etc. This is often shortened to:



"Word" ends in "d"



"Ends with" seems to fulfill the same use:



"Word" ends with "d"



But I typically think of "ends with" using larger things than letters:



"This phrase" ends with "phrase"


"This is a sentence" that ends with "sentence"



Really, though, both "in" and "with" are doable:



"Hungry" and "angry" both end in "gry."


"Hungry" and "angry" both end with "gry."



The only difference I can find is their usage outside of words:



Our journey ends in Texas.


Our journey ends with disaster.



To directly answer your question, both work just fine in the original context. Some people prefer one over the other; some workplaces will have a strict style guide dictating which should be used. At the end of the day, consistency is more important.


As for references, there isn't much to find other than looking at hits via Google. NGram searching for "ends in/with c" shows:


enter image description here


But that really doesn't mean much, given the propensity for quirks in searching algorithms. Just browsing pages found by Google is of virtually no help given how often people use both phrases.


Comments

Popular posts from this blog

Is there a word/phrase for "unperformant"?

As a software engineer, I need to sometimes describe a piece of code as something that lacks performance or was not written with performance in mind. Example: This kind of coding style leads to unmaintainable and unperformant code. Based on my Google searches, this isn't a real word. What is the correct way to describe this? EDIT My usage of "performance" here is in regard to speed and efficiency. For example, the better the performance of code the faster the application runs. My question and example target the negative definition, which is in reference to preventing inefficient coding practices. Answer This kind of coding style leads to unmaintainable and unperformant code. In my opinion, reads more easily as: This coding style leads to unmaintainable and poorly performing code. The key to well-written documentation and reports lies in ease of understanding. Adding poorly understood words such as performant decreases that ease. In addressing the use of such a poorly ...

A man has a garden measuring 84 meters by 56 meters. He divides it into the minimum number of square plots. What is the length of the square plots?

We wish to divide this man's garden into the minimum number of square plots possible. A square has all four sides with the same length.Our garden is a rectangle, so the answer is clearly not 1 square plot. If we choose the wrong length for our squares, we may end up with missing holes or we may not be able to fit our squares inside the garden. So we have 84 meters in one direction and 56 meters in the other direction. When we start dividing the garden in square plots, we are "filling" those lengths in their respective directions. At each direction, there must be an integer number of squares (otherwise, we get holes or we leave the garden), so that all the square plots fill up the garden nicely. Thus, our job here is to find the greatest common divisor of 84 and 56. For this, we prime factor both of them: `56 = 2*2*2*7` `84 = 2*2*3*7` We can see that the prime factors and multiplicities in common are `2*2*7 = 28` . This is the desired length of the square plots. If you wi...