четверг, декабря 21, 2006

Что такое kludge?

В программировании есть понятие kludge - это корявый способ исправления ошибки в программе, часто исправляющий не саму ошибку а её проявление. В блоге Чарльза Петцольда сегодня я наткнулся на замечательную цитату, очень точно описывающую смысл этого понятия:

    “Say you’re writing a program and you discover you’ve done something wrong, like every time you try to use the program, a button pops up. Most programmers go in, analyze their program, find out what causes the button to pop up and cure it so it doesn’t do that. [John] Draper [aka Captain Crunch] would go in and code around the button so when the bug occurs, the program knows it’s made an error and fixes it, rather than avoiding the error in the first place. The joke is, if Draper were writing math routines for addition and he came up with the answer 2 + 2 = 5, he would put a clause in the program, if 2 + 2 = 5, then the answer is 4.”
    — Chris Espinosa as quoted in Steven Levy, Hackers: Heroes of the Computer Revolution (1984), ch. 13

Комментариев нет: