Slashdot Mirror


Kishotenketsu Programming?

mike_stay asks: "Imperative Programming follows closely the 'outline' style of writing most of us were taught in elementary school. Japanese, however, have a very hard time with that writing style, as they've been trained in the concept of kishotenketsu: stories are usually told by bouncing around between various points of view, which necessarily give different accounts; no attempt is made to say what 'really' happened. 'Good writing style' expects readers to draw the conclusions; writing that is too explicit is not valued. The writing, therefore, tends to be inductive: specific examples precede general principles. The closest thing I can think of to kishotenketsu in programming is functional programming or declarative languages, but then, I'm American. Would other readers point me at other languages with this type of 'eastern' feel?"

7 of 66 comments (clear)

  1. Ki Sho Ten Ketsu by Gaijin42 · · Score: 4, Interesting

    Kishotenketsu is an interesting writing style, and it lends itself to some interesting applications, particularly in philosophy or politics. (Plato's The Republic, while a narritive, goes in a pattern simmilar to Kishotenketsu, in that several unrelated examples or narritives are told, and then a final "bring them together" dialog is presented which shows the relationship between the original narritives, and leads the user to the desired conclusion.

    Kishotenketsu is a result of the Japanese aversion to direct confrontation, and consiousness of status. (For another example of status consiousness, a listener of music should not say "That is good music" because that implies that the listener is a superior musician, and in a position to judge the player. Rather, the listener should say something like "Your music moves me"

    In any case, programs have a purpose, they DO something. While it certainly makes sense to abstract where applicable, being circuitous is not a good programming method.

    I suppose you could do something like go calculate Pi out to find the circumference of a circle that has a radius of the constant that you want to use to calculate your taxes.

    But that seems dumb to me :)

    On the other hand, this could be a good anti-piracy methodology, if you put a bunch of unrelated code in your serial number validation routine.

    1. Re:Ki Sho Ten Ketsu by KDan · · Score: 2, Interesting

      On the other hand, this could be a good anti-piracy methodology, if you put a bunch of unrelated code in your serial number validation routine.

      Security through obscurity? Tsk tsk tsk... nope. Doesn't work (though it makes the crackers' task more complex).

      As far as I'm aware, a program is in itself an imperative. So it's not the language(s) that cause problems - it's the very nature of programming, ie giving orders to a computer.

      A computer is still, at the moment, a slave, a mathematical idiot savant that you have to order around very specifically to get it to do what you want. Maybe once AI's become clever and interaction with computer goes mostly through human-like AI's, this Kishotenketsu approach could be of some use as it is in real life, but until then, I don't really see any use in non-imperative commands (wtf could that mean anyway) to a computer.

      Daniel

      --
      Carpe Diem
    2. Re:Ki Sho Ten Ketsu by MrWa · · Score: 4, Interesting
      In any case, programs have a purpose, they DO something. While it certainly makes sense to abstract where applicable, being circuitous is not a good programming method.

      And many people in business (Americans mainly) would say that being nonconfrontational in conversation seems dumb as well.

      The question brings up a good point, especially as more programming leaves the U.S. and heads overseas. What has become generally accepted programming paradigms may start shifting to better match the thinking process of those writing the code. It may be a stretch (for now, anyway) to expect kishotenketsu programming to work - computers can't grok what you really mean without being specifically told - but we will probably see examples of "nonstandard" programming techniques and, eventually, languages in the future.

  2. Uhm by Koos+Baster · · Score: 2, Interesting

    Isn't functional programming (Miranda, Haskell, Gopher, ML, LISP, Scheme, Bla) a KIND of declarative programming? As is logical programming (Prolog, deductive databases).

    Well anyway, I'd like to point out that some of the most powerfull features of declarative programming and object orientation come together in Hassan Ait-Kaci's
    WildLIFE.
    It features strong typed structured datatypes with inheritance, lambda terms, unification, resolution, backtracking,... you name it.

    It may be outdated, but it's definitely worth investigating if you're into perversely powerful programming languages and like the declarative methodology.

  3. functional programming by Bastian · · Score: 3, Interesting

    I'm not sure I would call functional programming circuitous. Granted, one has to learn to think in an inductive manner in order to handle recursion, but I have found functional programs to be almost more directed than imperative programming. In an imperative language, you can sit down and twiddle a bit here and there, working towards the goal at your leisure. In a functional programming language, you have to never lose sight of your goal. Every line of code has to have a clear and well-defined role in achieving that goal.

    That's why I tend to prototype functions & algorithms in a more lisp-style pseudocode even when I'm writing in C. I find that I end up writing much cleaner code when I prototype in functional pseudocode.

  4. Obvious answer? by Dr.+Photo · · Score: 5, Interesting
    Ruby is a programming language that was born and raised in its native Japan, which means it may very well be, by definition, what you say you're looking for.

    Incidentally, Ruby, though purely-OO, supports nifty things like true closures, and you can end up doing functional programming without realizing it at first [Ruby, of course, is designed with this sort of thing in mind]. It was the realization that I was doing this (or something very close to it), in conjunction with Paul Graham's essays that got me interested in Scheme (a sleek, lightweight dialect of Lisp).

    So, perhaps the only real answer is to learn as many interesting programming languages as you can, and use the broadened perspective you gain to make an informed decision for yourself.

  5. Re:The brain thinks only what the tounge can say by Anonymous Coward · · Score: 1, Interesting

    If we were taught math in binary, we could count to 111111111 using our fingers (or 1023 in base-10)