For the context of software programs, I think you just about answered the question yourself. I'll highlight some key words:
- “numéro de l'objet” = number of the object = a number used to identify the object
- “nombre d'objets” = number of objects = a number used to count objects
I deliberately did not highlight the word “number” in the first one. That's because it isn't significant that this happens to be a number. Maybe it's a number here, but the same concept elsewhere could be just a string of text. The key point is that we want to identify something, so this is often called an identifier, or abbreviated as ID.
In programming languages where the custom is to use lowercase names, we would use
id instead of
ID, but in normal writing, ID is always capitalized. You would talk about a process ID, not a process id. One exception is when you're writing documentation about a variable named
id in the source code. You would keep the lowercase but use a typographic convention as I did in the previous sentence.
An operating system process ID usually is a number for efficiency, but HTML documents also have IDs: any HTML element can have an
id attribute that uniquely identifies it, and this ID can be any string of text.
So we might talk about a process ID or element ID; calling either a number would sound odd, even if the process ID does happen to be a number.
For the second concept, you might use either number or count depending on the wording. The process count is another way to say the number of processes; you could use whichever fit better with what you're trying to say.
Moving outside software programming, it gets a little more confusing. Remember, this is English! We may well call something a “number” that isn't.
These days a phone number is understood to be a string of digits, i.e. an actual number (if we ignore any punctuation). But we still call it a phone number when it's spelled out fully with the spaces and dashes and parentheses and what-not.
Phone numbers weren't always just made of numerals. There is a famous old American song called Pennsylvania 6-5000. The song is named after the phone number of the Hotel Pennsylvania in New York City at the time, PEnnsylvania 6-5000.
The two capital letters at the beginning of the phone number indicate the part you would actually dial. You can look on your phone dial to see what the digits would be for each of these letters. (By the way, does your phone have a dial?)
So you would actually dial 736-5000, but nobody memorized a phone number that way. I remember my very first childhood phone number, DIamond 5-5844, but I couldn't tell you what digits corresponded to the D and I.
Along the same lines, if I send you an invoice for my consulting services, it will have an invoice number on it. This number definitely won't be a number! It may be something like 2017-06-29-OL-A. But it's still called an invoice number.
We might also use the word code. You may have an access number, but you're as likely to have an access code. In fact, if you're dialing into a phone teleconference, you probably have an access number (the dial-in phone number) and an access code (the conference ID number that you punch in after the conference line answers). Amusingly, the access number is probably not written as a number (there will usually be some punctuation), while the access code is almost always just a number!
Which brings us back to the identifier I started with. As I said, the phrase “process number” would sound a bit odd and we would say “process ID” instead. So why do we call it an “invoice number” or “phone number” when it may not be a number at all and “identifier” might make more sense? That's English for you!