Monday, October 14, 2024

Greppability Is an Underrated Code Metric

Moriz Büsing (via Hacker News):

It turns out that splitting up, or dynamically constructing identifiers is a bad idea.

[…]

Don’t rename fields at application boundaries to match naming schemes. An obvious example is then importing postgres-style snake_case identifiers into javascript, then converting them to camelCase.

[…]

Taking inspiration from the Zen of Python, when dealing with namespaces, flattening your folders/object structures is mostly better than nesting.

Sarah Reichelt:

I applauded Swift’s plan to eliminate all the NS prefixes but searching for Data or String is impossible. NSData & NSString were much more searchable.

No matter how smart the IDE is, there will be times when you need to search the raw source. And, of course, Google and Stack Overflow and your issue tracker don’t understand what the symbols refer to.

Comments RSS · Twitter · Mastodon

Leave a Comment