Clear empty object methods to avoid developer confusion

Part of working with any code base is understanding what is already developed. Luckily shields help show actions associated with objects in the form editor. However, an object method shield will show for empty (‘blank’) object methods. We should clear any empty object methods to avoid confusion and optimize the code base.

Example

Two objects on a form, both with an object method shield indicating the presence of an object method.

two objects with method shield

The last developer removed the object method content from the variable input area but did not explicitly clear the object method. This falsely indicates object method content, and worse yet 4D will execute the blank object method for each event enabled on that object.

The best approach is to clear the object method so that no shield displays, and reduce the number of lines the 4D engine executes.

Solution

Select the object to clear the method from, then from the Object drop down menu select Clear Object Method

Results

No misleading shields and no more tracing through empty object method.

Object method cleared


Author’s Note

Initial md Generated using https://github.com/jsr6720/wordpress-html-scraper-to-md

Original Wordpress categories: [‘4D’]

Original Wordpress tags: “4D”, “4D”, “clean code”, “object method”, “optimization”, “shield”

Original Wordpress comments: None

Significant revisions

tags: 2011, wordpress, txcowboycoder, 4D, clean-code, performance, optimization, developer-quality-of-life

  • May 6th, 2024 Converted to jekyll markdown format and copied to personal site
  • May 25th, 2011 Originally published on txcowboycoder wordpress site

EOF/Footnotes