This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

About nRF SDK naming conventions

Being a person with a poor name memory, I am really frustrated with the nRF SDK's naming conventions. For example, let's take a function

bsp_btn_ble_on_ble_evt()

Is that a descriptive name, eh? Every time I hit a function name, or symbol, like that one, I have to (re-)check what actually was its purpose. Instead, wIth good naming conventions, all that frustrating document and code browsing work could be avoided and huge amount of time would be saved.

If you really care about your customers and easiness of programming with your great hardware, you could start from the very basic things. Use descriptive names in your code, please.

Parents
  • It doesn't seem unreasonable to me:

    • It is part of the Board Support Package - hence the 'bsp' prefix

    • It is part of the BLE Button Module - hence 'btn_ble'

    • It is the handler for BLE events; ie, it is called on each BLE event - hence 'on_ble_evt'

    Thoroughly descriptive!

    So how would you have it named?

    developer.nordicsemi.com/.../a01272.html

  • No, I am not employed by nor in any other way affiliated with nor sponsored by Nordic.

    after you have worked intensively, say one year, with Nordic's SDK, you get familiar with those acronyms

    I don't find any of those abbreviations to be obscure or cryptic:

    • 'ble' is a widespread abbreviation for 'Bluetooth low energy';
    • 'btn' is a common abbreviation, and no major leap from 'button'
    • etc

    You will find similar abbreviations throughout competitors offerings.

    which one makes more sense: "btn_ble" or "bluetooth_button_module"

    Also ask which one they would rather have to type - 'bsp_btn_ble_on_ble_evt' or 'board_support_package_bluetooth_button_module_bluetooth_event_handler'

    "Taking the vowels out" is a common way of "compressing" words in making symbol names in software development in general...

Reply
  • No, I am not employed by nor in any other way affiliated with nor sponsored by Nordic.

    after you have worked intensively, say one year, with Nordic's SDK, you get familiar with those acronyms

    I don't find any of those abbreviations to be obscure or cryptic:

    • 'ble' is a widespread abbreviation for 'Bluetooth low energy';
    • 'btn' is a common abbreviation, and no major leap from 'button'
    • etc

    You will find similar abbreviations throughout competitors offerings.

    which one makes more sense: "btn_ble" or "bluetooth_button_module"

    Also ask which one they would rather have to type - 'bsp_btn_ble_on_ble_evt' or 'board_support_package_bluetooth_button_module_bluetooth_event_handler'

    "Taking the vowels out" is a common way of "compressing" words in making symbol names in software development in general...

Children
No Data
Related