Mavaron's Twitter

    follow me on Twitter

    2007-01-27

    About GOTO

    goto,日语对应“后藤”, may be the most "notorious" instruction in the computer language because of Dijkstra's criticism on its use. but somehow, people are enjoying arguing about this which really makes the topic become a trivial technical trick. as Dijkstra said: "Please don't fall into the trap of believing that I am terribly dogmatical about [the goto statement]. I have the uncomfortable feeling that others are making a religion out of it, as if the conceptual problems of programming could be solved by a single trick, by a simple form of coding discipline!" from his words, his intention may be lost.

    i misunderstood too at the beginning. but thanks to [2], whose author is close to the origin of the debate and familiar with the whole progress of such an idea, gives me another chance to think a little deeper on this problem and get something really helpful.

    a program is actually a tree structure. expanded and circulated. but too many artificial variables are created which are just beds for bugs. think about your bugs, i guess most of them are due to deadlock in recursive statements. as Dijkstra said, why we need to add another dimension?

    this is just an ideal for the abstraction of high-level language as Dijkstra said. as high-level language, the goto is really somewhat weired. this can also be regarded as the origin of OOP, i.e., an object should have its property and specific operations.

    I guess this is what Dijkstra wants to say. but maybe the misunderstanding will last for long.

    references:
    [1]: E.W. Dijkstra, Personal Communication (Jan 3, 1973)
    [2]: Literate Programming, D.E.Knuth
    [3]: E.W. Dijkstra. Go to statement considered harmful. Communications of the ACM, 11(3):147-148, 1968

    没有评论: