I'm programming a class and I was wondering which pair of methods makes more sense for describing a process cycle:
start() -> stop()
start() -> end()
start() -> finish()
Basically these methods will be called before and after executing a task.
What I'm asking is in English (specifically in programming - any language -) which pair is more common to see?
Sorry I'm not native speaker so I would like to hear which one people prefer.
If it is not clear enough please let me know to fix it or add more info.
Thank you in advance.
Update:
The intention of the methods is to call for any "user functions" before and after running the task. For the task itself would do nothing special.
End-to-end describes a process that takes a system or service from beginning to end and delivers a complete functional solution, usually without needing to obtain anything from a third party.
In particular, ERP systems manage end-to-end, cross-departmental processes. A cross-departmental process is one that (1) originates in one department and ends in a different department or (2) originates and ends in the same department but involves other departments.
If calling the method will abort the task or stop it early, call it abort()
or stop()
.
If calling the method will wait until the task finishes, call it waitFor()
.
If calling the method will perform the final steps of the task, call it finish()
.
If calling the method will clean up after the task, call it Dispose()
or cleanup()
.
Most languages have a standard name for such a method; use it.
Update: If I understand your situation correctly, I would recommend OnStarted()
and OnCompleted()
Thats a fairly contextual question but generally you could write:
start() -> stop()
begin() -> end()
you could use finish() to clean up and close the program but close() is more used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With