Sujet : Re: Code guidelines
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.cDate : 04. Sep 2024, 07:45:19
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vb8vlv$3nlvo$1@dont-email.me>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 03/09/2024 18:37, Thiago Adams wrote:
I also have a interesting sample with linked list
Speaking generally rather than specifically about this code, your extra checks are redundant when the code is run from a single thread, and insufficient if it is later used from multiple threads (accessing the same data). But extra checks can fool people into thinking it is safe - since the checks are unnecessary for sequential code they must have been put there to catch rare race conditions.
There are times when you want seat-belts /and/ airbags. But focusing on that instead of making sure the driver is competent is not helpful!