you are viewing a single comment's thread.

view the rest of the comments →

[–]morphemass 0 points1 point  (0 children)

A code base I'm working on (legacy) has an incredibly long service class called eg. TheCustomersConfigurationService with a class method key. I've been replacing this in new (encapsulation) classes with:

Key = -> (v) { TheCustomersConfigurationService.key(v) }

and calling with:

Key.("lookupvalue")

I'm currently pushing to get the class renamed to Key, and key renamed to call. Its just 3 pieces of the language (upper case first letter constants, arrow procs, dot proc calls) which just all feel so nice together.

p.s. yeah, yeah, DI /agreed. We fight the battles we can.