Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm reading a book that has a section about processes. In it is this sentence:

The next method to enumerate processes is the GetProcessById method. This method does exactly what its name implies: it will take a process ID and return information about it if it's found.

This doesn't sound right to me. Google dictionary has this as a definition

Enumerate - Mention (a number of things) one by one - for ex. "there is not space to enumerate all his works".

I think of enumerate as exactly that, "mentioning", but in the context of walking through a list. If you are getting something by ID, that doesn't sound like "enumerating", that sounds like "retrieving".

Am I wrong? Should I broaden my sense of "enumerate"?

share|improve this question

migrated from stackoverflow.com May 31 '11 at 16:43

This question came from our site for professional and enthusiast programmers.

    
What do you expect to get from this question? –  Nix May 31 '11 at 16:41
    
@Nix: Some clarification on the word, and a sanity check (after, I expect the book I am reading to be "authority", so when it says something wierd, I question). –  Richard DesLonde May 31 '11 at 16:44
    
I don't know about enumerate, but I'm pretty sure a 'nethod' doesn't exist. ;p Perhaps the most common used verb for these purposes is 'iterate'? –  Steven Jeuris May 31 '11 at 16:44
    
I'm confused why this got migrated to Programmers . . . word definitions are all over SO. Some over-enthusiastic moderators eh? –  Richard DesLonde May 31 '11 at 16:47
2  
@Kevin D: But that wouldn't make any sense. You are not going to get a meaningful answer in terms of Computer Science, or .NET, from the people who are on english.se. They know english, but not about proper use of programming terms. Very often comp sci uses words differently from their "proper" english language use. What is SO if not for clarification of comp sci terms? –  Richard DesLonde May 31 '11 at 16:52
show 1 more comment

4 Answers

up vote 4 down vote accepted

I think you're right. This function may have internals that lean on enumerating processes, but the function itself is not for enumerating processes.

share|improve this answer
add comment

I don't know which book you're talking about, but I think that quote should be viewed in the larger context of the chapter.

I imagine it should be read something like "Another way to enumerate processes is to call GetProcessById for each available id". That is, it's not GetProcessById that's doing the enumerating, it's the programmer using it in a loop to enumerate processes.

share|improve this answer
add comment

An older and more formal definition of enumerate is "to establish the number of", for instance "the 2000 census enumerated 10,493 households living in the county."

I suppose that the method does "establish the number of" the process. That would be a bit of a stretch in this context, I admit.

share|improve this answer
add comment

Enumerate can be a verb in such a way to mean "to iterate one by one." In my opinion, it would imply the entire process of iterating through the array. For example, you don't enumerate from one value in an array to the next; iterate would be a better word for this.

share|improve this answer
    
True, iterating is probably less confusing in a programming context (enum is something different). But I believe that I (just like you so it seems) missed the fact that the method returns just one (or no) process, actually being a good indication it is a bad use for the verb. :) –  Steven Jeuris May 31 '11 at 16:58
    
Yeah, on second read, I think that using GetProcessById is a horrible way to enumerate a list. Still, I believe the word is used properly in the sentence, even if their example of enumeration is questionable... –  Corey Ogburn May 31 '11 at 17:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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