Thread (23 messages) flat view 23 messages, 9 authors, 2022-01-26

RE: [PATCH 0/3] lib/string_helpers: Add a few string helpers

From: David Laight <hidden>
Date: 2022-01-20 09:12:10
Also in: amd-gfx, dri-devel, intel-gfx, lkml, netdev, nouveau

...
Yeah, and I am sorry for bikeshedding. Honestly, I do not know what is
better. This is why I do not want to block this series when others
like this.

My main motivation is to point out that:

    enabledisable(enable)

might be, for some people, more eye bleeding than

    enable ? "enable" : "disable"
Indeed - you need to look the former up, wasting brain time.
The problem is not that visible with yesno() and onoff(). But as you said,
onoff() confliscts with variable names. And enabledisable() sucks.
As a result, there is a non-trivial risk of two mass changes:

now:

- contition ? "yes" : "no"
+ yesno(condition)

a few moths later:

- yesno(condition)
+ str_yes_no(condition)
Followed by:
- str_yes_no(x)
+ no_yes_str(x)

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help