The Artima Developer Community
Sponsored Link

Java Community News
Donald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP

38 replies on 3 pages. Most recent reply: Jun 14, 2008 10:09 AM by John Zabroski

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 38 replies on 3 pages [ « | 1 2 3 | » ]
Mark Thornton

Posts: 275
Nickname: mthornton
Registered: Oct, 2005

Re: Donald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP Posted: May 1, 2008 1:42 PM
Reply to this message Reply
Advertisement
> mechanical assembly process. (There are exceptions. There
> are people who have been doing the same thing for 5 years,
> who are somehow capable of doing it for several years
> more. I have no idea how they do that, but *they* are
I have been doing algorithms related to vehicle routing for 25 years and hope to continue for a while yet!

George Sakkis

Posts: 14
Nickname: gsakkis
Registered: Jun, 2007

Re: Donald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP Posted: May 2, 2008 12:29 AM
Reply to this message Reply
Favorite quote: "With the caveat that there’s no reason anybody should care about the opinions of a computer scientist/mathematician like me regarding software development, ..."

Respect for his awareness that (theoretical) computer science and software development are very different skills, and for not pretending to be an authority on both. Extreme programming or unit tests are not really relevant to the sort of work he's been doing, and his opinion on such topics should not carry more weight than his opinion on, say, global warming.

Mark Thornton

Posts: 275
Nickname: mthornton
Registered: Oct, 2005

Re: Donald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP Posted: May 2, 2008 12:44 AM
Reply to this message Reply
I seem to remember plenty of torture tests for TeX and components thereof.

Vincent O'Sullivan

Posts: 724
Nickname: vincent
Registered: Nov, 2002

Re: Donald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP Posted: May 2, 2008 1:04 AM
Reply to this message Reply
> Well it's a lot better than developing something blindly
> and then telling the customer "this is what you want" when
> in fact, it hardly ever is.

Indeed. But since nobody has ever proposed that as a development methodology it's just a strawman argument and not a valid basis for justifying for XP.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Donald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP Posted: May 2, 2008 6:05 AM
Reply to this message Reply
> > Well it's a lot better than developing something
> blindly
> > and then telling the customer "this is what you want"
> when
> > in fact, it hardly ever is.
>
> Indeed. But since nobody has ever proposed that as a
> development methodology it's just a strawman argument and
> not a valid basis for justifying for XP.

I'm not justifying XP. In fact I'm not sure that XP is really such a great thing. All I was observing is that writing code and repeatedly asking the customer if that's what they want is a much better strategy that what I normally see: Design an write a system based on some vague notions that slightly resemble requirements and don't show the customer until the very end of the available time frame. Then when the customer says "this isn't what we wanted" tell them there is no more time.

I'm not sure iterative development is "chaos" as it was described but even if it is, in my experience, the sooner the customer sees what you are doing the more likely you are to succeed. And my experience also tells me that big-up-front-design is largely a waste of time.

Eric Armstrong

Posts: 207
Nickname: cooltools
Registered: Apr, 2003

Re: Donald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP Posted: May 2, 2008 7:55 AM
Reply to this message Reply
>
> I'm not sure iterative development is "chaos" as it was
> described but even if it is, in my experience, the sooner
> the customer sees what you are doing the more likely you
> are to succeed. And my experience also tells me that
> big-up-front-design is largely a waste of time.
>
Have to agree. On the other hand, I have to believe that succssful XP'ers are doing more long term design than they're admitting to. I like the idea that you don't *code* the cool architecture you have in mind. (If I had a nickel for every line of code I've poured thought into, never to see them executed, for which the machines no longer exist!) But by the same token, it's not as "knee jerk" a process as it is sometimes portrayed. After all, the way to get add(2,2) to succeed is to return 4. But to make it succeed for an arbitrary N,M, you have to work at a deeper level of abstraction!

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Donald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP Posted: May 2, 2008 8:21 AM
Reply to this message Reply
> >
> > I'm not sure iterative development is "chaos" as it was
> > described but even if it is, in my experience, the
> sooner
> > the customer sees what you are doing the more likely
> you
> > are to succeed. And my experience also tells me that
> > big-up-front-design is largely a waste of time.
> >
> Have to agree. On the other hand, I have to believe that
> succssful XP'ers are doing more long term design than
> they're admitting to. I like the idea that you don't
> *code* the cool architecture you have in mind. (If I had a
> nickel for every line of code I've poured thought into,
> never to see them executed, for which the machines no
> longer exist!) But by the same token, it's not as "knee
> jerk" a process as it is sometimes portrayed. After all,
> the way to get add(2,2) to succeed is to return 4. But to
> make it succeed for an arbitrary N,M, you have to work at
> a deeper level of abstraction!

I think it's good to have a strategy and a plan. How much that strategy encompasses and how you come to that conclusion is another topic. I think YAGNI can be taken to mean that you must solve each problem in isolation and never look at the big picture. But I definitely think you should never code something if you aren't sure it's going to be used in the very near future.

What I get really annoyed with is putting a lot of time into a really detailed design without any attempt to test any assumptions. A fairly high-level design of how chunks of an application will work with each other can be done very early (and should be IMO) but when you start getting down to designing every class and the methods in each one and detailed sequence diagrams of low-level interactions inside a logical abstraction, almost none of that will be correct at the end. Considering how long it takes to produce that kind of thing, it's extremely inefficient.

Again and again I see a lot of documentation about what the original design for a system was. But I hardly ever find documentation on what was actually implemented. The plans are really only useful up to the point you start implementing them. Knowing what was done is useful for the life of the system. Given this disparity, it seems crazy that, at least in my experience, the amount of effort applied to documenting the plan is so much more than the effort put into documenting the final system.

Bill Pyne

Posts: 165
Nickname: billpyne
Registered: Jan, 2007

Re: Donald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP Posted: May 2, 2008 9:07 AM
Reply to this message Reply
> Given this disparity, it seems
> crazy that, at least in my experience, the amount of
> effort applied to documenting the plan is so much more
> than the effort put into documenting the final system.

Spot on. Savvy project managers will plan time for documentation after implementation. However, much of the time re-assignment to other projects occurs and that planned time is considered a luxury instead of a necessity. I'd like one solid week after implementation to produce design, run, etc. documents.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Donald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP Posted: May 2, 2008 9:53 AM
Reply to this message Reply
> > Given this disparity, it seems
> > crazy that, at least in my experience, the amount of
> > effort applied to documenting the plan is so much more
> > than the effort put into documenting the final system.
>
> Spot on. Savvy project managers will plan time for
> documentation after implementation. However, much of the
> time re-assignment to other projects occurs and that
> planned time is considered a luxury instead of a
> necessity. I'd like one solid week after implementation to
> produce design, run, etc. documents.

In my world, project managers couldn't care less about what happens after implementation.

Bill Pyne

Posts: 165
Nickname: billpyne
Registered: Jan, 2007

Re: Donald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP Posted: May 2, 2008 10:13 AM
Reply to this message Reply
> In my world, project managers couldn't care less about
> what happens after implementation.

Unfortunately, even the ones who do care and "get it" are pushed by those above them to get to work on the latest and greatest project, meanwhile, the just implemented project is old news. I'd be willing to bet that they often have incentives to get X, Y, and Z projects implemented so they don't have the incentive to let each one be completed properly.

Mark Thornton

Posts: 275
Nickname: mthornton
Registered: Oct, 2005

Re: Donald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP Posted: May 3, 2008 1:52 AM
Reply to this message Reply
"a small percentage of the world’s population is good at programming, and a small percentage is good at writing; apparently I am asking everybody to be in both subsets"

It is worse than that as you also need to be comfortable with the markup scheme. I rather like TeX as it is compact and quite comprehensive, but most of my colleagues do not. The 'modern' approach might be to use XHTML+MathML+SVG, but this markup is unsuited to writing by hand in a regular editor. So perhaps we need IDE support as well, but I haven't seen any ...

Eric Gillespie

Posts: 13
Nickname: viking
Registered: Jun, 2005

Re: Donald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP Posted: May 3, 2008 3:42 PM
Reply to this message Reply
> > Given this disparity, it seems
> > crazy that, at least in my experience, the amount of
> > effort applied to documenting the plan is so much more
> > than the effort put into documenting the final system.
>
> Spot on. Savvy project managers will plan time for
> documentation after implementation. However, much of the
> time re-assignment to other projects occurs and that
> planned time is considered a luxury instead of a
> necessity. I'd like one solid week after implementation to
> produce design, run, etc. documents.

To turn things back around somewhat, what happened to the write documentation first, then write the source from the documentation? If something needs to be added (and who knows of a program where it doesn't?) then document it first?

As I understand it, this was one of the prime tenets behind literate programs like weave/tangle.

Also, how does this contrast with the "only document what's needed" mindset that most programmers end up in, because there's literally no time to do anything else? At what point does practicality kick in?

Bill Pyne

Posts: 165
Nickname: billpyne
Registered: Jan, 2007

Re: Donald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP Posted: May 4, 2008 7:06 PM
Reply to this message Reply
> To turn things back around somewhat, what happened to the
> write documentation first, then write the source from the
> documentation? If something needs to be added (and who
> knows of a program where it doesn't?) then document it
> first?

As with most things in life, it depends on the situation. Try doing that in a Boston area startup company and the company will be out of business in a heartbeat. I worked in a company along the 128 belt sometime around 1995. They had precisely 2 weeks worth of reserves to pay employees in case a sale didn't come through. When you're running on that kind of margin you need to have turnaround within days of a sale. When I worked for a finance company, of middling size, they bought and sold smaller companies on a monthly basis. It was all finance, but the models were all different. A company bought one month might be sold by the next quarter. Documentation was a waste in that environment. I can concede that a company with an already solid business and a relatively static business model would benefit from the document first approach. Repeating what I said at the top, it depends on the situation though.

> As I understand it, this was one of the prime tenets
> behind literate programs like weave/tangle.

As I mentioned in another response within this thread I have no knowledge of Literate Programming but feel it would be worth my time to read up about it. I'll take from it what I feel is worthwhile and leave the rest behind.

> Also, how does this contrast with the "only document
> what's needed" mindset that most programmers end up in,
> because there's literally no time to do anything else? At
> what point does practicality kick in?

I hate arguing against a fictitious group. I'm not willing to concede that most programmers end up in that mindset.

My experience is that documentation is devalued by the organization. Managers are willing to talk at great lengths about the importance of it but I haven't experienced many who were willing to postpone implementation dates so that solid documents could be written.

From my experience alone, I think that "living" documents are the only worthwhile ones. By this I mean documentation in the form of wiki's. Documentation should be a simple process devoid of any back-and-forth in committee approvals. I'm in the middle of that now. Sometimes it's a week before I hear back from a single committee member. By that time, I've lost interest in what I'm doing.

Practicality is very relative depending on your mindset. You'll have to be more specific about what you think is practical in this instance.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Donald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP Posted: May 4, 2008 7:42 PM
Reply to this message Reply
> To turn things back around somewhat, what happened to the
> write documentation first, then write the source from the
> documentation? If something needs to be added (and who
> knows of a program where it doesn't?) then document it
> first?

You haven't specified the detail of the documentation so any response is going to be based on the reader's assumptions of what you mean.

But to give an example where I think the above doesn't make any sense, I can take an example from my current work. One group I work with requires that all designs be documented to a level of detail such that 'any developer can code from them'. In other words, these documents basically contain the same level of detail as the code itself. These documents also take roughly the same amount of time to write as the code itself. Effectively, this means the code is written at least twice: once in Word and once in the target language. Any changes compound this duplication of effort.

While there is value in the document in that it's easier to read than the code, especially if you aren't familiar with the language, most of the useful detail could be generated from the code automatically.

Basically what you are suggesting is exactly what a lot of shops force on their developers. And yes, you can do it that way but you are going extremely inefficient (i.e. slow). Where I work, this problem manifests itself as unhappy customers. Their expectations and needs are not met by this approach. Often the final product arrives long after it is no longer needed.

> Also, how does this contrast with the "only document
> what's needed" mindset that most programmers end up in,
> because there's literally no time to do anything else? At
> what point does practicality kick in?

What's the argument against "only document what is needed?" What's the value in writing documents that are not needed?

Javier Diaz Soto

Posts: 29
Nickname: javierbds
Registered: Sep, 2005

Re: Donald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP Posted: May 9, 2008 7:38 AM
Reply to this message Reply
I think the commercial world of sw has changed a lot in the last 20 years. To clients, sw is no longer some strange incantations to make machines behave. As a result, clients expect sw to be at the same time: flexible, optimizable, evolvable, ...
Clients expect to see some results sooner and, more often than not, are satisfied with prototype quality sw. Clients do not know o do not have the time to know: what when or how they want. They also will not take what you give them and ask for what they see as "little" changes. So if you make a lot of work up front you WILL throw it away. Clients will not let you nail them down on a solution. And clients don´t care how it looks inside as long as it does what they want. As most development is externalized, they just see sw as its interface.
Those who pay the price are developers that have to deal with all the crap that this type of process generates: bad, out-of-synch docs, architecture that has rot, ad-hoc design, code replication, functional replication, high churn of devs ... (and I am leaving away political-organizational issues). If sw project could, in general, be taken as seriously as other engineering efforts we would not have reached this state of things.

I see XP as an adaptation on the part of the people that make the products to the Real Practices of the world. Some see it as a cause of the above problems, but I see it as a reaction. Most of what goes into XP is not "experimental", it is adaptation and evolution as targets move.

Flat View: This topic has 38 replies on 3 pages [ « | 1  2  3 | » ]
Topic: David Pollak on Scala's Option Class Previous Topic   Next Topic Topic: Dojo 1.0 Released

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use