3

I was answering a question on StackOverflow, I wrote a code snippet and provided an example of how that piece of code should be used.

I was going to write

Here's an example of usage

Then I was wondering if I could put "use" instead "usage"

Here's an example of use

What I was trying to say is

Here's an example of how you can use it.
Here's an example of how to use it.

I looked up the definitions, I googled them, but I am still not sure which one is correct and whether they both are acceptable in this particular situation.

This ngram brought nothing but more confusion. See that surge? What does that even mean?

enter image description here

Could you please clear it up for me?

  • 2
    If you look at the y-axis in that ngram, you'll see the numbers are very small (around .00000040%). When the numbers are very small like that, you'll sometimes see a spike, but, because of the scale, it's not really indicative of a true spike in usage. In contrast, this ngram shows more significant gains in usage. – J.R. Jul 31 '19 at 3:17
  • One thing that helps is to turn off smoothing (I.e., set it to 1) to see exactly where the spike occurs, then look at the results. In this case there were no book results for 1995. It was a blog : google.com/… – ColleenV Jul 31 '19 at 15:23
1

The trick here is to realize that "usage" is a noun, and "use" is a verb, therefore they can almost never be used in the same place as the other one would.

Moreover, "use" is a transitive verb, which means it must always have an object to act on of some kind. You can't just "use", you have to "use something".

So in the case of examples:

Here's an example of usage

is correct, because you need an example of some thing, and "usage" is a thing (noun)

Here's an example of how to use it

is also correct, because "how to use it" is a thing (technically a "noun phrase"). Within the phrase "how to use it", "use" is acting as a verb (and is acting on the object "it")

However:

Here's an example of use

Is not correct, because "use" by itself is an action (verb), not a thing (noun).

(It should probably be noted that there is a sense where "use" can be a noun, in the sense of "a use for something", but this is only really ever used with the "for something" part on the end, and is not really the sense of "use" you're working with here)

| improve this answer | |
0

You wrote:

... A little enhanced version would be

interface PredicateOperation {
    boolean operation(String[] input);
}

and

PredicateOperation operation = (String[] input) -> true;

I would suggest phrasing it more like:

... An enhanced version would be:

interface PredicateOperation {
    boolean operation(String[] input);
}

Which you would use like this:

PredicateOperation operation = (String[] input) -> true;

or perhaps:

Which you would, for example, use like this:

PredicateOperation operation = (String[] input) -> true;
| improve this answer | |
  • 2
    Good answer. Sometimes the best way to "clear things up" for a learner is to offer a more natural wording. – J.R. Jul 31 '19 at 14:06
  • @J.R. yes, it's helpful, indeed. But I am still waiting for a more exact answer to the question.. – Andrew Tobilko Jul 31 '19 at 21:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.