Nov. 17th, 2008

juan_gandhi: (Default)
wtf:
<response>
    <content id="account-item-data">
        <items>
            <item>
                <JSON>
                    {"id":"5078","confidential":"false","sort-date":"20081027200000",
                    "save-date-mmdd":"Oct 27","save-date-yyyy":"Oct 27","type":"N",
                    "allow-remember":"true","keys":{},"vendor":
                    {"first-name":"Johann Sebastiann","last-name":"Bach"}}
                </JSON>
            </item>
            <item>
                <!-- ... -->

(угадайте из какой страны приехал автор идеи)
juan_gandhi: (Default)
Imagine, we have a bunch of classes like Player, Board, Piece, Rules, History, etc. And they are all stored in separate files in some directory that is called package. Why? Why not have them in one file, named Game, and let them be inner classes of Game.

I know, I know, the file may become huge. But what if it does not? What if the whole size is not that big? The advantage would be the follwoing:

all these functionally closely related classes will share common environment that may be totally invisible outside.

We do it in JavaScript all the time, you know.

Say, I would prefer to have Function and Monomorphism and Isomorphism and Id classes be inner classes in Functions class, which would also have a static method for composition, for instance. Instead of, you know, having the bulb to want to change itself, if you know what I mean.
juan_gandhi: (Default)
You are given an interface,
 interface Function<X, Y> {
   Y apply(X x);
 }


Write a method that takes a value and returns a function that always returns that value.

I wonder how hard it is, for general public.

(answer below)
Read more... )
juan_gandhi: (Default)
...Как будто я не знаю, что такое Хуй. Мне, в свое время, на день рождения подарили Хуй. Я сперва разочаровался, дескать, опять какую-то фигню подарили, а вечером после празднования попался мне Хуй в руки. И я залип где-то на недели две...

...Реальность намного больше, чем Влагалище. И не такая добрая. Ну а теперь, о человеке, который удостоился Гран-при. Человек по имени Майкл из Техаса зачем-то решил выпить хереса. Но не через рот, как обычно делают люди, а через Влагалище....
juan_gandhi: (Default)
I saw so much fuss about organizing test suites that I thought that's something big and important. Seems like it was just stupid. Does not take much effort to write this:
Read more... )

More and more I'm getting convinced that people just don't know how to write code...

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

June 2025

S M T W T F S
1 2345 6 7
8 9 10 11 121314
15161718 1920 21
222324252627 28
29 30     

Most Popular Tags

Active Entries

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 10th, 2025 12:28 am
Powered by Dreamwidth Studios
OSZAR »