java haiku

Mar. 15th, 2007 05:14 pm
109: (Default)
[personal profile] 109

ArrayList<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)
From: [identity profile] ivan-gandhi.livejournal.com
Знаешь, самое грустное, что невозможно что-либо кому-либо впарить. Как-то обсуждали пресловутые геттеры-сеттеры, и почему их ни хера нету в java.util - ну и зачем они вообще. Джош Блок так примерно заявил, что против толпы (идиотов) не попрешь.

(no subject)

Date: 2007-03-16 07:08 am (UTC)
From: [identity profile] 109.livejournal.com
Стив зажигает, согласись?

а что за проблема с геттерами-сеттерами? я как-то не слежу за развитием джавы, как ты понимаешь...

(no subject)

Date: 2007-03-16 09:22 am (UTC)
From: [identity profile] ati.livejournal.com
отличная история про цыпленка

(no subject)

Date: 2007-03-16 06:58 pm (UTC)
From: [identity profile] 109.livejournal.com
особенно в сочетании с контекстом. я ржал так, что в соседнем офисе недовольно зашевелились.

(no subject)

Date: 2007-03-16 11:36 pm (UTC)
From: [identity profile] faceted-jacinth.livejournal.com
Прекрасно, прекрасно. Прекрасный человек этот Стиви.

Правда, хотелось бы сказать всё-таки слово в защиту жавы (а точнее шарпа до третьего, в котором всё так же). Интеллисенс даёт возможность написать это самое хайку вполне быстро, а натренированный глаз так же быстро воспринимает эту строчку должным образом (и наоборот прекрасно реагирует на отступления от канона, если вдруг встретятся).

Кстати, по поводу цыплёнка, я всё никак не дочитаю http://psychclassics.yorku.ca/Skinner/Pigeon/, которое про это и есть.

(no subject)

Date: 2007-03-17 12:17 am (UTC)
From: [identity profile] 109.livejournal.com
ну да, у меня тут двойственные ощущения. с эстетической стороны я минималист, и стивенская мысль, выраженная в виде хайку, близка моей душе. с другой стороны, три года писания на шарпе под решарпером сделали процесс превращения мысли в голове в код на экране практически автоматическим, и идентичность первой и третьей строчек соответствующих хаек (хайков?) совершенно не беспокоит.

(no subject)

Date: 2007-03-21 10:03 am (UTC)
From: [identity profile] ex-chrobin.livejournal.com
на мой взгляд, егге только и ищет способ доказать вредность статический верификации типов

Profile

109: (Default)
109

March 2019

S M T W T F S
     12
3456789
101112131415 16
17181920212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags