[go: up one dir, main page]

|
|
Log in / Subscribe / Register

The case of the prematurely freed SKB

The case of the prematurely freed SKB

Posted Mar 3, 2017 18:18 UTC (Fri) by marcH (subscriber, #57642)
In reply to: The case of the prematurely freed SKB by neilbrown
Parent article: The case of the prematurely freed SKB

> "Retain" and "AddRef" are each 6 characters. "get" is 3 characters. "get" wins easily.

Are you being serious? Granted: https://martinfowler.com/bliki/TwoHardThings.html

but... 3 characters winning over 6, really?


to post comments

The case of the prematurely freed SKB

Posted Mar 3, 2017 21:29 UTC (Fri) by neilbrown (subscriber, #359) [Link] (1 responses)

> but... 3 characters winning over 6, really?

Yes, really. These things are used a lot. Common words tend to be shorter than uncommon word, and for good reason. Less wasted space for example.
It doesn't really matter what the letters are as long as they are used consistently.
If you made a convention that "thing_foo" incremented the ref count and returned the pointer, and "thing_bar" decremented the refcount and discarded when it became zero, then we would all add "_foo" and "_bar" to our language fairly quickly and there would be no confusion.
I could argue that would be better than the current situation where we mostly use "get" and "put", but they don't always mean quite the same thing.

When new people come to the code and see "get" and "put" it might seem like it makes it easy for them. But it can just as easily lead them to think they understand something that they don't. Using more letters might just give them more confidence that the meaning of the word is "obvious", which is probably isn't.

The case of the prematurely freed SKB

Posted Mar 3, 2017 21:46 UTC (Fri) by marcH (subscriber, #57642) [Link]

Then it hurts me to say this but you want acronyms. They're short AND sure not to be too tainted by plain English preconceptions.

(It hurts me because I live in a world of massive abuse of acronyms)


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds