Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start -> end | stop | finish?

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.

like image 374
lepe Avatar asked Jan 26 '11 00:01

lepe


People also ask

What is E2E process?

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.

Which system supports business processes end-to-end?

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.


2 Answers

It depends.

  • 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()

like image 66
SLaks Avatar answered Sep 17 '22 20:09

SLaks


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.

like image 45
greggreg Avatar answered Sep 20 '22 20:09

greggreg