Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to add underscores to method names #35

Merged
merged 1 commit into from
Nov 12, 2022
Merged

Refactor to add underscores to method names #35

merged 1 commit into from
Nov 12, 2022

Conversation

goerz
Copy link
Member

@goerz goerz commented Nov 12, 2022

  • initpropinit_prop
  • propstep!prop_step!
  • reinitprop!reinit_prop!
  • getcontrolderivget_control_deriv
  • getcontrolderivsget_control_derivs
  • getcontrolsget_controls

The old names were based on the Julia Style Guide recommendation to name methods with "multiple words squashed together". I've come to regard this as a very bad idea. To quote the JuMP style guide, "This convention creates the potential for unnecessary bikeshedding and also forces the user to recall the presence/absence of an underscore, e.g., "was that argument named basename or base_name?". For consistency, always use underscores in variable names and function names to separate words.

* `initprop` → `init_prop`
* `propstep!` → `prop_step!`
* `reinitprop!` → `reinit_prop!`
* `getcontrolderiv` → `get_control_deriv`
* `getcontrolderivs` → `get_control_derivs`
* `getcontrols` → `get_controls`

The old names were based on the Julia Style Guide recommendation
to name methods with "multiple words squashed together". I've come to
regard this as a very bad idea. To quote the JuMP style guide, "This
convention creates the potential for unnecessary bikeshedding and also
forces the user to recall the presence/absence of an underscore, e.g.,
"was that argument named basename or base_name?". For consistency,
always use underscores in variable names and function names to separate
words.
@goerz goerz added the breaking PRs that break compatibility label Nov 12, 2022
goerz added a commit to JuliaQuantumControl/GRAPELinesearchAnalysis.jl that referenced this pull request Nov 12, 2022
goerz added a commit to JuliaQuantumControl/Krotov.jl that referenced this pull request Nov 12, 2022
goerz added a commit to JuliaQuantumControl/QuantumControl.jl that referenced this pull request Nov 12, 2022
* `initprop` → `init_prop`
* `propstep!` → `prop_step!`
* `reinitprop!` → `reinit_prop!`
* `getcontrolderiv` → `get_control_deriv`
* `getcontrolderivs` → `get_control_derivs`
* `getcontrols` → `get_controls`

JuliaQuantumControl/QuantumPropagators.jl#35
JuliaQuantumControl/QuantumControlBase.jl#48
@goerz goerz merged commit 2909886 into master Nov 12, 2022
@goerz goerz deleted the refactor branch January 25, 2023 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking PRs that break compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant