Discoverability in Codebase

Discoverability in Codebase

What is it?

Code discoverability is how easy it is for a developer to find existing functionalities and dependent functionalities.

How to rate discoverability

  • How easy is to traverse indirections?
  • How declarative is the business logic?
    • Declarative code describes “what” as opposed to imperative code which describes “how”. It describes the code intent closer to business logic.

How to achieve it?

Code Browsers

Code browsers index all the primitive components of codebase. It could be Classes or functions or any abstraction provided by the language. Some of the best code browsers I’ve used are the

Pharo’s system browser

Credit - https://files.pharo.org/

Eclipse’s Java browsing perspective

Credit https://querix.com/

Visual Studio’s object browser

Credit - https://matthiasfriedrich.gallerycdn.vsassets.io Edit: 19/02/2023

Outliners

VSCode’s Outline view

I heavily use the outline view to have a birds eye on the file although its not as beneficial in React

Regex

Good’ol Grep/Ripgrep REGEX RULES!!!!!! Regex would be my last option along with data wrangling.

Tag browser

Tags generated by ctags can be used as well to navigate the codebase.

Intuitive interfaces

For functional programming It would be sensible function signatures like Hoogle.

For OO It would be Interfaces. I believe you could search classes by receives and sends clause. Pharo’s supports this.

Here’s a thread where I asked developers how they go about getting comfortable with a new codebase.


← Back to notes