3 ms·
Or anything that needs validation before you try to run the main part. e.g. the init() method may give you a shopping list of data you're going to need to pass
by sideshowb 6y ago
Or anything that needs validation before you try to run the main part. e.g. the init() method may give you a shopping list of data you're going to need to pass to run() but which couldn't have been deduced until init() validated its parameters.
Sure, you could handle this the functional way by passing a getData() function to run() so it can do so itself but I'm not sure that's any more readable.