lpf2908
lpf2908

Reputation: 1

Linux functions naming

I just registered to this site . Hoping someone can give some help.

Currently I am reading the linux programming books, honest to say I know nothing about linuxLinux.

My problem is I really find the Linux APIs are really hard to read and understand (full of abbreviations)at first glance except of referring to the manual.

Why do not they make the APIs more verbose? And how are about you with this problem? I think this is a hiden abstacle for the newbies like me.

Thanks a lot. Andy Liu

Upvotes: 0

Views: 81

Answers (1)

Barmar
Barmar

Reputation: 781004

Much of the Unix API was designed about 40 years ago, when computers had very little memory (especially the minicomputers they were using for Unix at the time), and disk storage was very expensive, so programmers often cut corners to minimize the memory and disk space used. Using short function names reduced the amount of memory used by compilers.

However, one of the designers of Unix admits that they may have gone too far. Ken Thompson was once asked what he would do differently if he were redesigning Unix, and said

I'd spell creat with an e.

To appreciate how much things have changed, you probably have a thumb drive with more storage than the entire machine room of the AT&T labs when they were creating Unix.

For many years this tradition was followed, but eventually API designers saw the light. Thus, we now have functions like pthread_create; had this been designed 30 years ago, it probably would have been called something cryptic like thrcr. But we're stuck with the short names for all the old functions -- adding long names for them all would be more trouble than it's worth.

Upvotes: 1

Related Questions