Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-60330

[Policy] Allow better variable names like $snake_case (or possibly $camelCase)


    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 3.3.2
    • Policy

      I use moodle coding style when developing plugins, but the variable naming section could improve a little. Not allowing any type of word separation (snake_case or camelCase) makes the names hard to read.

      While we should avoid unnecesary long variable names, by far I see variables with names shorter than it should. I will not try to arguee on why variable names should be descriptive enough.

      My suggestion is to adopt $snake_case in the same way as method names. I am not asking to refactor the whole moodle, but allow it for newer code and plugin developers.

      There is no code change needed for that, only a Moodle HQ reflection and opinion on the topic (although we may need to adapt a few of our code checking tools).

      More information: https://docs.moodle.org/dev/Coding_style#Variables

            Unassigned Unassigned
            roperto Daniel Thee Roperto
            Ankit Agarwal Ankit Agarwal
            3 Vote for this issue
            7 Start watching this issue


                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.