fritz2 icon indicating copy to clipboard operation
fritz2 copied to clipboard

Rename `classes` utility function to `joinClassNames` in order to reduce naming confusion

Open Lysander opened this issue 1 year ago • 1 comments

The classes-utility function just joins arbitrary Strings with classnames to one String. It takes care of adding aprropriate spaces and drops null values.

The name was meant to be short, but as it seems quite often it competes with some parameter named also classes, which is just passed through from higher call sites. This reads not nicely:

classes(classes, "... some local added classes", ...)

It might be better to add some suffix to express its functionality: Joining of different pieces of classnames, though joinClassNames or joinClasses?

joinClassNames(classes, "... some local added classes", ...)

We could mark the current function with @Deprecated("renamed to ``joinClassNames()``", ReplaceWith("joinClassNames(classes)")) in order to enable a smoother transition.

Lysander avatar Dec 13 '23 14:12 Lysander

I would lean towards joinClasses as the shorter name seems more practical to me, especially since the classes function is used rather frequently.

haukesomm avatar Dec 29 '23 15:12 haukesomm