Slashdot Mirror


Linus Says No to 'Specs'

auckland map writes to tell us about an interesting debate that is being featured on KernelTrap. Linus Torvalds raised a few eyebrows (and furrowed even more in confusion) by saying "A 'spec' is close to useless. I have _never_ seen a spec that was both big enough to be useful _and_ accurate. And I have seen _lots_ of total crap work that was based on specs. It's _the_ single worst way to write software, because it by definition means that the software was written to match theory, not reality."

23 of 540 comments (clear)

  1. Linus Taken to Task by jg21 · · Score: 5, Insightful
    There's a very good post later on in the kerneltrap thread:

    Linus is an engineer/tech. He dislikes theory work because it often gives nothing in practice.

    However, specs are not always theory, and they may be usefull, as well as docs. He may be smart enough (or know linux code enough) to not need any doc/spec, but it's not the case of many other people. Some specs are good, and sometimes necessary.

    He cited OSI model, well, but I can assure you I won't go in an airplane if it was done with Linus' practices... There are specs in some places that are good, and that are read and followed. Even in non-dangerous domains such as Web standards, specs are necessary, and those who don't follow these specs make crap softwares/browsers!

    Moreover, in Linux development model, which is fuzzy and distributed, not directed, defining the software may be vain. However, in a commercial environment, defining the spec is really writing a contract, which protects both the customer and the editor. Specs there defines what the software can and must do, and ensures it will do. Linus obviously lacks of experience in industrial and critical projects. He may be right for the kernel development (however I still doubt it should be so entire on that subject), but he's wrong on many other domains.

    IOW, Linus does here a generalization which is at least as wrong as are the examples he cited. As we say : "all generalization are false".

    If he finds a bad spec, either it throws it away, or he fixes it. It's the same for technical docs. But he shouldn't tell every specs are useless and bad. That's wrong.

    1. Re:Linus Taken to Task by gowen · · Score: 5, Insightful
      He dislikes theory work because it often gives nothing in practice.
      Indeed. And, in fact, for those specs that aren't theoretical, he's followed quite closely (albeit without calling them a spec). There's a lot of work gone in to making Linux POSIXly correct, and POSIX is a spec, even if Linus doesn't consider it one. Similarly for VESA framebuffers, or tty specs.

      Basically, a spec says "X should work like this."
      You follow a spec whenever it's clear that X should work like that (for whatever reasons, be they performance, clarity or interoperability). If it's not clear why the spec mandates that, it's a bad spec, but the existence of many many bad specs doesn't invalidate the concepts of specs.

      By all means pick and choose the specs you decide to follow, but don't make silly generalisations.
      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    2. Re:Linus Taken to Task by Rakshasa+Taisab · · Score: 5, Informative

      The summary is twisting the discussion into something very flamebait worthy, and it gives a false impression of what Linus really said.

      From my impression of the discussion it isn't specs he is against, but rather following those specs without being flexible enough to take reality into account. Would you really want to fly the plane built to spec, if some of those specs turned out to not accurately reflect reality? In that case you'd change the specs, but that's not always possible.

      In this specific case, the problem was someone using the abstraction layering described in the spec, while the kernel would according to the others be better off using another design. If the software behaves equivalently, it should not matter how it is designed internally.

      --
      - These characters were randomly selected.
    3. Re:Linus Taken to Task by dramenbejs · · Score: 5, Insightful
      You are saying it here: However, in a commercial environment, defining the spec is really writing a contract, which protects both the customer and the editor. Spec is not usable for coding, but for employing. You come inevitably to three possibilities:
      1. Your project is trivial and spec may be achievable.
      2. Your project is not trivial and spec is copied from some existing product
      3. You have written the spec after making the program.
      There is no way around this! Or you can predict ALL of reality? I doubt...
    4. Re:Linus Taken to Task by ajs · · Score: 5, Interesting

      POSIX, VESA and even ttys are all examples of specificatons that sought to unify existing practice. The practice came first, then the theory. If you want an example that goes the other way, you would have to look to something like IP, which was created as a specificaton along with the first implementations.

      Linus is correct, though. Specs are rarely useful breasts up-front. Standardization of existing practice is often useful, but that's another beast.

    5. Re:Linus Taken to Task by Troed · · Score: 5, Insightful

      I'm a Mechanical Engineer and a Software Engineer by education. I'm a software developer/architect by profession. I've stopped believing in the "engineering" part of software development altogether.

      It's a nice thought, but it's not possible to look at software development as a physical manufacturing process. We're much closer to art.

      (In addition, I exclusively work in the embedded/telecom part of software development - areas much closer to engineering than normal personal computing type of development. If these are my experiences, most development should be very far from engineering. Maybe we should stop looking at NASA development as some sort of best practise [Gilb, I'm looking at you!] for all types of software development)

    6. Re:Linus Taken to Task by gowen · · Score: 5, Insightful

      That's a reasonable point. In fact, the problem most people have noticed with Linus's statements is that he fails to draw that distinction. If he said "specs imposed from the top down `this is how we should do this thing'" tend to be bad, as opposed to specs which say, "people have had success doing it like this -- let's all do it that way."

      No-one, as far as I know, is denying that many many many bad specs exist, and that they should all be cheerfully ignored.

      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
  2. Linus Says No to 'Specs' by Anonymous Coward · · Score: 5, Funny

    I heard he had good vision. --(o)~(o)--

  3. Theory by StonePiano · · Score: 5, Interesting

    Who was it that said:

    In theory, practice and theory are the same. In practice, they are not.

    1. Re:Theory by StonePiano · · Score: 5, Insightful

      If the theory does not match the practice, the theory is incomplete. In other words, fix the theory. Don't make vague and stupid generalizations against it. Those generalizations are nothing more than rationalizations for the sake of the idiot makeing them.

      Yes, you are right... in theory.

      I write software to spec. In theory, that should work. In practice it often does. But often there are gaps in the specification that the guy spec'ing should have seen, but didn't. Perhaps, his kids woke him up 20 times last night, perhaps someone made a bad pot of coffee.

      These gaps in the spec become glaringly obvious when writing the code and in the iterative component testing. That's the practice.

      Now, if you invest 5 times the effort in the specification, you can probably get it all. But in practice, it's often better to prepare a rough, incomplete functional specification. Make a special effort to specify the interface between interacting parts of the system, especially if they are developed by differnt teams. Then allow the developers more scope to communicate and modify this in the development process.

      I'm not saying this is a good idea for building spacecraft. But it makes sense for commercial software development.

  4. Amen by Anonymous Coward · · Score: 5, Funny

    Linus has spoken.

  5. No to Specs... by Anonymous Coward · · Score: 5, Funny

    ..big _YES_ to underscores.

  6. Missing the point. by Anonymous Coward · · Score: 5, Insightful

    The whole discussion was centered around implementing specs. And the point made by linus was that one should not implement specs literally, not to structure the software as the specs are structured. He did not say the software should not adhere to the interface given by the specs. So the software should work like specified, one should just write the software in a form which makes sense for the larger scope of the software, not one limited to the scope of the specs.

  7. Re:What? by Scarblac · · Score: 5, Insightful

    Also having a documentation will keep the leader itself on the correct path and not stray from it's original design.

    It is extremely rare that the original design is the correct path.

    --
    I believe posters are recognized by their sig. So I made one.
  8. In other news by $RANDOMLUSER · · Score: 5, Funny

    Bill Gates says "Beta testing is for sissies".

    --
    No folly is more costly than the folly of intolerant idealism. - Winston Churchill
  9. What an idiot! by kevin+lyda · · Score: 5, Funny

    Who is this Linus guy anyway? I bet he's never managed a software project of any complexity.

    Personally I've found specs to be incredibly useful. I'm currently developing a middleware project that takes a complex search pattern and applies it to a streams of delimited character objects and while our team of 40 software software engineers has yet to actually start developing we've produced a fantastic spec that will greatly simplify coding it.

    I suspect we'll have this general regular expression parser up in running in less than 80 man years of effort thanks to our full and detailed specs.

    --
    US Citizen living abroad? Register to vote!
  10. There are specs, and there are specs. by satch89450 · · Score: 5, Insightful

    I once worked on a Standards-writing subcommittee, and ended up being the editor of a proposed standard. I was new to the process at the time. I took the work that was done and completely re-wrote it, from the ground up, according to the published guidelines of the Telecommunications Industry Association (TIA). I then presented my work to the subcommittee.

    "It's too clear. People might actually understand it." I argued that because it was a specification for testing, it should be clear. Yes, I won the argument, but at what cost?

    Over the next few years I watched as more standards were created, edited, published, submitted to the ITU, and eventually turned into Recommendations. When I asked, "what does this section REALLY try to say?" I was told that in order to understand that section I needed to know another piece of the puzzle that wasn't spelled out but was "understood" by "practitioners of the art." In other words, the specification was incomplete...but not according to the rules. I asked why. The answer I got boiled down to one thing: you can't implement the specification without the "stories around the campfire" behind them.

    Put starkly, you can't play unless you join the club.

    Now, in reality, people have taken these less-than-complete specifications and actually made products with them, products that successfully interoperated with those implemented by members of the club. The development time, however, was extended by the need to discover the missing pieces on one's own, or to buy the missing pieces.

    Then there was the story of what eventually became V.80, which I discussed in a Slashdot interview. That particular standard proposal was so bad that I had to vote "no". Again, I ended up rewriting the entire thing so it made sense, and in addition covered not only the corner cases but also future extensions and vendor extensions. It took DAYS to prove that the two versions said technically the same thing (within limits). You could code to mine; the other was almost impossible and "open to interpretation."

    Most specifications (or Standards) are written by partisan participants. It's to their best interests to write these things so that outsiders can't understand them -- be it commercial gain or personal ego. Good spec writing is HARD, and not for beginners. It takes work. It rarely pays anything to write a good specification, especially if the writer views it as a pro-forma task. Just as programmers from several decades ago viewed flow-charting as a useless task.

    Just as people are starting to view Open Source not as a way to lose money but as a way to gain money, perhaps the partisans will see that writing clear, understandable, WORKABLE specifications is in their better interest....or not.

    Given the current state of the art, though, I would tend to agree completely with Linus that specifications, and Standards, that don't provably track with reality deserve not "no", but "HELL NO!"

  11. If they're good enough for the Space Shuttle... by Stone+Rhino · · Score: 5, Interesting
    Reading this article brought to mind another one I saw mentioned on slashdot a while back, about the team that writes the code for the space shuttle's computers. They write what's considered to be the finest code in the world, which essential for running a rocket ship weighing several million pounds and moving at several thousand miles per hour. How do they do it? Specs, lots of specs. According to the article...

    At the on-board shuttle group, about one-third of the process of writing software happens before anyone writes a line of code. NASA and the Lockheed Martin group agree in the most minute detail about everything the new code is supposed to do -- and they commit that understanding to paper, with the kind of specificity and precision usually found in blueprints. Nothing in the specs is changed without agreement and understanding from both sides. And no coder changes a single line of code without specs carefully outlining the change. Take the upgrade of the software to permit the shuttle to navigate with Global Positioning Satellites, a change that involves just 1.5% of the program, or 6,366 lines of code. The specs for that one change run 2,500 pages, a volume thicker than a phone book. The specs for the current program fill 30 volumes and run 40,000 pages.


    Predictable code is good code. You want your code to do x when y happens, and everyone who relies on your code should know what to expect from your code under every circumstance. Kernels are supposed to be boring.

    Specs may suck in some cases; if they do, they're badly written. It's an indictment of the person who wrote that spec, not the concept of specs in general. When I call a function, I expect it to do exactly what its documentation says, and it should comply with the documentation exactly.

    I shouldn't have to read the code just to use it. That defeats the entire purpose of segmenting things out into separate pieces. You might as well be using gotos to write your spaghetti code.
    --


    Remember, there were no nuclear weapons before women were allowed to vote.
  12. Linus has limited engineering future vision by Morgaine · · Score: 5, Insightful

    "software was written to match theory, not reality"

    That was very blinkered and unfortunate statement by Linus. While he portrays himself as a "practical engineer", the truth is that he is not flying the flag of professional engineering, but supporting some kind of ill-conceived ideal of ad hoc amateurism.

    The world of computing is in crisis. After 40 years of 'pro' development, computing is still a human-driven craft instead of the extremely precise arm of engineering that it could so easily have become through its well-defined subject matter.

    While Linus has contributed immensely to the world by delivering a wonderful engineering tool as well as a great end-user product, he is also extending the software crisis through unfortunate remarks like that one. The "reality" which he so seems to praise is THE PROBLEM in software engineering, and not something to be endorsed or supported.

    If the world continued along Linus's desired path of "reality" vs theory, the current mess will know no end, and the metaphorical bridges of computer science will still be falling down in the year 3,000.

    Mankind's future in computing must build on immoveable foundations of theory and logic if it is to progress into a realm where machines of IQs in the millions work at our behest. Advocating some sort of ad hoc "practical" computing barbarism is very short-sighted, dangerous, and regressive.

    --
    "The question of whether machines can think is no more interesting than [] whether submarines can swim" - Dijkstra
  13. Thoughs on specs . . . by Anonymous Coward · · Score: 5, Interesting

    From one of my past lives, when I designed computer systems in automobiles, before my current stint as a grad student, I can describe how we used specs. Some of our business folks who had some basic training as engineers would get together with our customers folks who had basic engineer training, and hammer our a 100+ page spec document covering everything from basic operating precepts to acceptable failure modes. They would use this document as a means of discussing what they thought they wanted to buy, and what we thought we could supply for them, and then determine a cost from this proposed spec.

    After enough words had been passed back and forth, both sides would agree on a version of the spec, money would be passed around, and hardware design engineers and software engineers from all over the world would get to work. At this point, the spec would be skimmed, people would get a rough idea of what everyone wanted, and a couple hundred of the first prototype version would be cobbled together.

    Testers and verification people on both sides of the fence would look at this thing, first against the spec and make sure it included everything that was talked about, and then in the system to make sure that it would work they way they needed it to. This is the closest that the design ever got to the spec. After this point, everyone would start noticing places where the spec was either too rigid to be followed cost-effectively, or just plain wrong for our customer. Since rewriting a spec is a ton of work, it never got done, and in the end was just a basis for verification folks to look at the design and complain that it didn't work they way that they thought it should. I guess someone should have included them in the "cool peoples idea passing club", but, neah.

  14. If specs are 100% accurate,then they are the code. by master_p · · Score: 5, Interesting

    I have been working with specs-driven projects for the most part of my professional career, and I can tell you that Linus has a point.

    If specs were 100% accurate, then there would not be a need to write the code, because the specs could be automatically translated to code (we are talking about 100% accuracy here, not 99.999999%). But specs can realistically never be 100% accurate...it is the missing part from the specs that causes headaches.

    For example, I have worked in a project that required conversions between coordinate systems: UTM to geodetic, geodetic to local cartesian, local cartesian to target, etc. The user expected to edit UTM coordinates in the GUI, but the specs for UTM coordinates where never mentioned in the Software Requirements Specification. So we searched the internet, found out what 'UTM' is, and coded the relevant functions.

    You know what? the specs talked about UTM coordinates, but they actually meant MGRS! UTM means 'universal transverse mercator' whereas MGRS means 'military grid reference system'. Although the concept between the systems is the same (the Earth's surface is divided into rectangular blocks), the two systems have different calculations.

    When we released the application to our customer, they freaked out seeing UTM coordinates, and of course they refused to pay. Then we pointed out that the specs talked about UTM coordinates, and they (thank God) admitted their mistake, paid us, and gave us time to change the application from UTM to MGRS.

    But the application has never been correct 100% (from that point on) until recently handling MGRS coordinates, because it was very difficult to successfully change something so fundamental and yet so missing from the specs(we are talking about 160,000 lines of C++ code).

    Do you want another example? in the same application, the program should display a DTED (digital terrain elevation data) file, i.e. a map created out of a file of elevation data. The specs did not say anything about the map display respecting the carvature of Earth. So we went out and implemented a flat model, where each pixel on the screen was converted linearly to a X, Y coordinate on the map.

    Guess what? they meant the map display to be 'curved', i.e. respect the Earth's carvature. The specs did not say anything, until the application was connected to another application that produced the video image of the battlefield using OpenGL (and of course, since it was to be in 3d, the presented map was 'curved').

    The result is that the application still has some issues regarding coordinate conversions.

    After all these (and many more...) I am not surprised at all that some certain space agency's probe failed to reach Mars because of one team using the metric system and the other team using the imperial system. Even for NASA that they write tons of spec and they double- and triple- check them using internal and external peer review, specs were useless at the end.

    So Linus has a point...

  15. Russell is doing just fine, thank you by Morgaine · · Score: 5, Interesting

    Bertrand Russel tried to put mathematics on an immovable foundation of theory and logic, sadly it turned out to be impossible.

    I don't think that you got very far with Bertrand Russell.

    The higher-order issues he identified caused just a temporary hiccup in the development of logic. While undoubtedly fundamental, that problem paraphrases best as "There are hidden depths to this", rather than as "All is lost".

    Godel applies, as always. You don't apply a theory outside of its domain of discourse, not if you know what you're doing anyway.

    Russell showed that the domain of logic gets tangled if you use it to think about itself. Well (with hindsight) that is no surprise at all. The expert logician recognizes the necessary boundary, and virtualizes the outer domain before it can be handled by the inner domain logic.

    Russell is doing just fine, thank you. Almost the entirety of mankind's technological world is founded on the logic which you describe as "impossible".

    --
    "The question of whether machines can think is no more interesting than [] whether submarines can swim" - Dijkstra
  16. Depends what the definition of "is" is... by Mr.+Underbridge · · Score: 5, Insightful
    From my impression of the discussion it isn't specs he is against, but rather following those specs without being flexible enough to take reality into account.

    From what I read, it seemed like people were trying to get him to soften his stance on that, and he seemed pretty adamant that he hates specs in any form or fashion.

    Of course, it's easy to do that when you're Linus Torvalds, and whatever you say/do is the de facto standard without the need to write a spec. He's basically a walking spec. However, I'd invite him to consider what would happen if all the peons adopted his theory. Nothing would interoperate with anything else.

    The only thing I can think of is that he defines a spec as something that is inherently written once, before implementation begins, and is strictly adhered to no matter what. However, I don't think any sane person would agree with that definition, I can't imagine that's what the other people in the thread meant by the word "spec," and I can't believe he'd imagine anyone else defending such a process in the first place. So I do believe that Linus is being a bully again.