java haiku
Mar. 15th, 2007 05:14 pmArrayList<int> myListOfInt = new ArrayList<int>();
which, spoken aloud, reads:
ArrayList of Int
my list of int, equals new
ArrayList of Int
In 1986, my college Psychology 101 professor told us a little story about her Abnormal Psych class from the previous year. The students each got a lab rat, and they had to train their rats to run through mazes by rewarding the rats for exhibiting properly ratty maze behavior. But there was one girl who was terrified of rats, so they gave her a chicken, and she trained it to play the piano by pecking notes with its beak. Each time the chicken played the right notes, she'd give it a pellet (or whatever the hell chickens eat). Wrong notes, no pellet. She'd teach it one new note at a time, and eventually it would know the whole song.
At one point, after she'd coaxed the chicken to learn maybe half its song, the chicken made a violent side-to-side motion just before playing exactly the right sequence of notes, including the new note she was trying to teach it. It had played the right notes, so she had to give it a pellet. The chicken had definitely figured out that doing what she wanted would get it yummy pellets. After that last pellet, it decided that it had been rewarded for both the note and the motion, and from then on, it made crazy twisting motions continuously as it played. She had to keep rewarding it when it played the right notes, and she had no good way of informing it that the twisting was unnecessary (not without starting over, and there wasn't time). So the chicken went on happily believing that thrashing violently was helping its project succeed.
They eventually went on tour to the local colleges with it, billing it as "The Break-Dancing, Piano-Playing Chicken".
(no subject)
Date: 2007-03-16 02:34 am (UTC)(no subject)
Date: 2007-03-16 07:08 am (UTC)а что за проблема с геттерами-сеттерами? я как-то не слежу за развитием джавы, как ты понимаешь...
(no subject)
Date: 2007-03-16 09:22 am (UTC)(no subject)
Date: 2007-03-16 06:58 pm (UTC)(no subject)
Date: 2007-03-16 11:36 pm (UTC)Правда, хотелось бы сказать всё-таки слово в защиту жавы (а точнее шарпа до третьего, в котором всё так же). Интеллисенс даёт возможность написать это самое хайку вполне быстро, а натренированный глаз так же быстро воспринимает эту строчку должным образом (и наоборот прекрасно реагирует на отступления от канона, если вдруг встретятся).
Кстати, по поводу цыплёнка, я всё никак не дочитаю http://psychclassics.yorku.ca/Skinner/Pigeon/, которое про это и есть.
(no subject)
Date: 2007-03-17 12:17 am (UTC)(no subject)
Date: 2007-03-21 10:03 am (UTC)