[riot-notifications] [RIOT-OS/RIOT] RFC: Change of sensor and actuator API & auto initialization (#11826)

Kaspar Schleiser notifications at github.com
Mon Jul 15 12:51:52 CEST 2019

> Please, please, please stop waving the code size argument, it is simply not true and it is optimizing ahead of time. 

Do you realize  **how often we wave it***? And everytime it is "just 8-10 bytes"?

>Complexity is actually reduced this way: have you seen the hairy mess of `#ifdef` and build system magic that is required for auto init?

It is using ```#ifdef MODULE_foo```. So what? That's not complex.

> A conditional initialization on first use **may not be the best solution** but it is **not complex** and does **not increase code size** considerably:

No. In RIOT, we have a pretty clear convention on when to use any object pointer or periphal: it is only allowed to do so if it has been initialized through the corresponding ```_init()``` function, if that exists.
We're not going to add NULL pointer checks, ```driver_foo_is_initialized(ptr)```, ... to *every driver function call*. That is just dead code for any deployment.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190715/9d7fccce/attachment.html>

More information about the notifications mailing list