Does anyone use a prettier naming convention for these types of methods? I know better is subjective but I hate them. Methods should (generally) be named as verbs. Object.Move(), Object.Talk() not Object.PreDatabaseUpdateStep().
I’ve been using Think() for my PreUpdate(), which is generally pure logic compared to Update() which is generally pure physics. I haven’t thought of anything fancier for PostUpdate() yet.
Suggestions?
A pragmatic programmer should always strive to design code for readability. The names
PreUpdate,Update, andPostUpdatecommunicate their intentions much more clearly than a name likeThink.Similarly, we can look to what other projects do for inspiration. For example, the JUnit suite uses similar naming convention with
@Beforeand@After(and@BeforeClassand@AfterClass) annotations. And by convention, iOS delegate patterns often specify “Will” and “Did” (likeWillUpdateFooandDidUpdateFoo) methods.