Don't use bool types for every two-state situation. Only use them for things which are conceptually a true/false value. Success/failure return values, for example, should use a named enumeration instead.
What's your opinion on using bool types for representing on/off register states? t.ex. "SPI is enabled/disabled". What about for more ambivalent A/B-style states, like "SPI clock polarity positive vs. negative"?
-
-
For me it's closely tied to variable or method naming. isSpiEnabled() should return a bool. spiStatus() should return an enum.
Kiitos. Käytämme tätä aikajanasi parantamiseen. KumoaKumoa
-
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.