The library that I'm working on has a parameter which defines priority of a certain process. I want the interface to be as clear as possible, but it seems that different people have opposite interpretations of priority values.1. Lowest number has highest priority (1 - highest priority, 10 - lowest priority)2. Highest number has highest priority (1 - lowest priority, 10 - highest priority)Which way do you think is more natural/logical?
Priority value meaning
api;libraries
There are good reasons for setting 1 (or 0) as the highest level of priority and using higher numbers for lower priorities.First, the priority can represent the order that task(s) should be performed. Number 1 is the first task you do, hence it has higher priority that the second set of tasks you will perform.Another is that the number of priority levels may be subject to change. In this case, how can you automatically determine what you should do first? If you let 1 represent the highest priority, then your code does not depend on the number of priority levels.Doing a web search on the string priority level numbering, many examples show up where the lower the priority number, the more important the task. Some examples use 0 as the highest, some use 1.This is a long standing convention. Most processor priority level registers work the same way.I know this does not seem intuitive, so you should make your ordering convention very clear when you work with numbering priority levels.