Thread (10 messages) flat view 10 messages, 5 authors, 2016-06-15

Re: Status of Mac OS/X ports of git and cogito?

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:05


On Mon, 12 Sep 2005, Johannes Schindelin wrote:
Linus, we all know that you are always right. Only that in this case you 
are just a little bit less right than usual. The introduction of this 
typedef was a sane thing to do, for the same reason it is a sane thing to 
use sensible variable names: documentation.
Nope.

Go through the history of that thing.

It wasn't introduced as "socklen_t". It was introduced as "size_t".

That was so horribly wrong that it's not even funny. 

Documentation my ass. It's a matter of people thinking that the old 
portable types aren't good enough, and that you have to make up new names 
for everything in order to allow "portability" where different systems 
have different ideas.

And it's ignoring the fact that true portability means "it just works". 
"size_t" fundamentally didn't work. 

And the really sad part is that before the standards bodies started
messing around with it, things really _did_ "just work". There was no 
question at all about what kind of type to use.

These days, we sadly have some systems that just blindly followed the 
standard, changed "int" to "size_t", and then when the standard was fixed, 
changed "socklen_t" to be "size_t".

Don't believe me? Just google for "size_t" and "socklen_t", and weep.

All this confusion, and for what? Absolutely _zero_ upsides.

Basically, if a programmer feels like he needs to remind himself what the 
variable was all about, how about using descriptive variable names? I 
claim that

	int addr_len;

is a lot more documentation than

	socklen_t len;

and that the people who think that different type-name are "documentation"
are ignoring the fact that they are _also_ "confusing".

There's a virtue in simplicity. Abstraction is _not_ a virtue.

			Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help