Oral History of linus Torvalds



Yüklə 332,77 Kb.
Pdf görüntüsü
səhifə8/18
tarix08.08.2018
ölçüsü332,77 Kb.
#61586
1   ...   4   5   6   7   8   9   10   11   ...   18
    Bu səhifədəki naviqasiya:
  • Booch

Oral History of Linus Torvalds 

 

 



CHM Ref: X4147.2008            © 2008 Computer History Museum                                 Page 16 of 41

 

 



compile Linux itself, because Linux was a smaller project than trying to recompile the compiler itself.  But 

there were all these basic tools that I tried to basically make Linux good enough to run. 



Booch:  So back then how big was Linux source line to code?  Can you give me an estimate? 

Torvalds:  It was small.  It was small.  I mean, the very first release was something like 10,000 lines.  And 

that sounds really sad in the sense that that was something I'd worked on for six months, and 10,000 new 

lines over six months is not a lot of code.  But it comes back to the whole thing where it was so-- I mean, it 

was so much harder when nothing worked, so.  Lines got written many, many, many times.  I mean I think 

it doubled within months, I mean just a couple of months and it was double, and even before people 

started being involved.  And now obviously I mean 10,000 lines, that's hardly-- you can see the current 

kernel is whatever, seven million lines or something. 

Booch:  The kernel is seven million?  Wow.   

Torvalds:  Well, most of it is device drivers or Sun architectural support.  But yeah, it's something like 

seven million lines of code. 



Booch:  So a bit of a leap. 

Torvalds:  

It is, just being Sun…

 

Booch:  And of course the original 10,000 lines is all beautifully documented and completely clear. 

Torvalds:  You know, I never believed in that whole documentation thing.  Comments is for a code that 

you can't understand.  And instead of adding comments you should just rewrite the code.  That's my 

theory. 

Booch:  So you're a fan of literate programming in a sense. 

Torvalds:  Yes, in a sense, but not the sense that most people would use that term for, yes.  I'm not.  We 

do have a lot more comments now, obviously.  I mean the situation we're in now is we're different from 

the situation back then.  But it used to be that the whole 10,000 lines probably did not have more than 

100 lines of comments because I'm not much…

 

Booch:  Well, about the only eyes on it at that time were your two eyes.  

Torvalds:  Right.  And I really do think that I like my functions small and obvious.  And if you really need 

to comment, then you're doing something wrong if they're your own functions. 



Booch:  Is that a style that you morph to as you had programmed over the years, or what led you to that 

philosophy? 




Oral History of Linus Torvalds 

 

 



CHM Ref: X4147.2008            © 2008 Computer History Museum                                 Page 17 of 41

 

 



Torvalds:  I expect it actually is because I started doing assembly language not as assembly language, 

but as machine code.  And if you can't make it small and obvious, you can't maintain it.  I mean, you'd 

better get it right the first time kind of thing.  So I've always wanted to make-- my functions are small and 

I'm very happy to have a compiler that will then inline all those functions and make it more efficient than it 

would be if it actually stayed that way.  But…

 

Booch:  I'm thinking [this] is around the time of Charles Simonyi's Hungarian notation as well, too.  Do 

you have a particular naming style?  What was your reaction to that? 

Torvalds:  I mean, the Hungarian notation thing was like I was going, "Who would ever want to do that?  

You're doing something wrong.  You're trying to tag your variable with their types.  If you have so many 

variables that you can't even remember their types, you're doing something wrong."  I mean, I have 

strong opinions about a lot of things, and one of my strong opinions is people can't really remember more 

than about six or seven things in short-term memory.  So if your function has more than six or seven 

variables, you have already lost.  Right?  But if you only had six or seven variables in your function, then 

Hungarian notation just does not add anything at all, and it guarantees that you cannot change the type 

ever again.  Because if you ever change the type now you have to rename it.  I mean Hungarian notation 

obviously died a painful death.  I don't think it's used anywhere.   

Booch:  [It] still exists in the [Microsoft] Word code base. 

Torvalds:  I guess it still exists in post code that was Windows back then, but I'm a big believer in having 

compilers that do static-type checking.  And I mean really static-type checking.  I think runtime-type 

checking is a horrible disease, because you actually have to run the code to find the type check errors, 

which nobody really runs the code.  I mean, if it compiles, you ship it.  Right?  It's sad, but I'd rather have 

a high level of coverage from the compiler. 

Booch:  Sure.  So to leap forward a little bit, you're not a fan, therefore, of dynamically-type languages or 

loosely-type languages? 



Torvalds:  No, I detest dynamically-type languages where you-- and people say that C is a loosely-type 

language, but actually if you write C the right way, which includes requiring a fairly modern compiler, 

where modern means in the last 20 years, right, C is a very strongly-type language. 

Booch:  Is it your favorite language? 

Torvalds:  It is still my favorite language.  I mean, it probably comes from what I do.  I do system 

programming.  For system programming I have not seen anything better.  For other things I would not 

want to do like a GUI [Graphical User Interface] thing in C.  There's no question about that. 

Booch:  How did other people get involved in kernel work?  Did they volunteer themselves?  Did you 

seek their support? 



Torvalds:  They always volunteered.  They still do.  I mean, I wouldn't even want to work with people who 

don't, I mean, feel passionately about what they do because then, I mean, searching for people to do 

something, that just doesn't work.  You want them to maintain it for years and years.  So yeah, it started 



Yüklə 332,77 Kb.

Dostları ilə paylaş:
1   ...   4   5   6   7   8   9   10   11   ...   18




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə