Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Fabricio Cabral
    @fabriciofx
    @yegor256 A new testimonial to put here... :laughing:
    Silas Reinagel
    @SilasReinagel
    Somebody got their feelings super triggered
    That was pretty funny to watch
    RayoGundead
    @RayoGundead
    It's no laughing matter when the most liberal of tumblrettes get positions of power
    Mihai A.
    @amihaiemil
    What is a tumblerette and you mean liberal as in usa or eu?
    Bc depending on it, liberal means smth good or smth bad :))
    RayoGundead
    @RayoGundead
    a watered-down form of communist in it's media-presented form.
    Mihai A.
    @amihaiemil
    So american
    Well i don't think it's that. Yegor simply puts it bluntly, that's. It doesn't mean that he or you should apply it exaclty like that
    RayoGundead
    @RayoGundead
    all liberals of any country
    Mihai A.
    @amihaiemil
    Im referring to everything not just that sexism article
    Nah I dont imderstand that. By liberal I understand more freedom of action. The least interference with the state.
    I know in America it has an opposite meaning
    RayoGundead
    @RayoGundead
    not exclusive to America
    other countries have the term Liberal distorted
    Mihai A.
    @amihaiemil
    Well, as long as we each know what we mean, it's just semantics. Just pay attention to this word
    RayoGundead
    @RayoGundead
    see Canada and Germany
    Conservatives are practically underground there
    Mihai A.
    @amihaiemil
    Germany maybe, because they are taken as nazis?
    RayoGundead
    @RayoGundead
    the conservaives there, their mere existence gets labeled every derogatory name in the Liberal handboook
    Mihai A.
    @amihaiemil
    I know, it's bad in general to just label things. Everyone has their points and everyone exaggerates in general, making the others' bad headlines
    RayoGundead
    @RayoGundead
    so its either conform or get persecuted for wrongthink
    Mihai A.
    @amihaiemil
    When that happens, the "persecuted" one should stand up and debate. Nowadays we just have offended pussies and political correctness... same as in Yegor's article: everyone got offended and misunderstood the point. Everyone thought it was an article about women in tech, when women in tech was a mere example. He never said he would discriminate a woman. He just stated his opinion, used only the word "would"... "I would tell her not to work in tech" not "I would stop her"
    RayoGundead
    @RayoGundead

    When that happens, the "persecuted" one should stand up and debate.

    tell that to Garron Helm and Eron Gjoni

    RayoGundead
    @RayoGundead
    @yegor256 I remeber you mentioned treating HashMap as data (or was it container?) instead of object since it is for that purpose.
    I forgot where or when tho
    that's why I asked about Observables.
    Justas Bieliauskas
    @justasbieliauskas
    @fabriciofx Yes, this was my initial design, to have an ArrayList of 1 and save the value there. But it's not entirely flexible to always save it to a list. Perhaps I want to save it to a file instead or somewhere else etc. Having an abstraction Variable helps to specify different locations to save the value.
    Phantom190
    @Phantom190

    @amihaiemil

    When that happens, the "persecuted" one should stand up and debate. Nowadays we just have offended pussies and political correctness... same as in Yegor's article: everyone got offended and misunderstood the point. Everyone thought it was an article about women in tech, when women in tech was a mere example. r"

    Did you read the quotes? they are not even from the article. They are from the comments, from yegor - him trying hard to explain himself.

    He never said he would discriminate a woman. He just stated his opinion, used only the word "would"... "I would tell her not to work in tech" not "I would stop he

    No, I think it's a bit worse, he's fine discriminating any person, according to his ancient style of living.

    Fabricio Cabral
    @fabriciofx
    @fabriciofx Yes, this was my initial design, to have an ArrayList of 1 and save the value there. But it's not entirely flexible to always save it to a list. Perhaps I want to save it to a file instead or somewhere else etc. Having an abstraction Variable helps to specify different locations to save the value.
    I'm sorry, but I don't like this solution. Save in a file has a lot of overhead (I/O). But, could explain me better around the problem? I can't see the problem with ArrayList....
    Mihai A.
    @amihaiemil
    @Phantom190 this is not the good chat to debate that article in particular. Read my comments on the Disqus Thread there. I'm impartial, and I think everyone is making too big of a deal out of it. We have bigger issues, including the fact that we need to solve whole other issues between the sexes, besides gentelmen's need or will to over protect them.
    No one said anything there about violence, religios human rights abuse, etc etc
    All whining bitches, both men and women in that thread
    Rant over
    Yegor Bugayenko
    @yegor256
    @fabriciofx indeed a good new testimonial :) Will publish it now.
    @Phantom190 you made it, bro: yegor256/blog@ba8b012
    Phantom190
    @Phantom190
    @yegor256 While you are at it, please update the one from James. It's too lame to half-quote people. The original is "Author is a fucking moron. Does he know that a woman invented the first programming language or"
    Yegor Bugayenko
    @yegor256
    @Phantom190 and calling me a “fucking moron” is not lame? :)
    Phantom190
    @Phantom190
    @yegor256 It is, but countering a lame action with another lame action is what kids do, not adults.
    Yegor Bugayenko
    @yegor256
    @Phantom190 nah, I’m a kid.
    Justas Bieliauskas
    @justasbieliauskas

    @fabriciofx Well, since you put it that way, I'm starting to see nothing wrong with ArrayList as well :D But just to reiterate what I had in mind...
    There might be cases where using ArrayList is insufficient, where, let's say, you have a lot of such cached objects and thus you're dealing with memory issues, so you decide to serialize it to a file or send it to some server, hadoop storage, whatever. You're right, this would be slow to retrieve in common scenarios, but for some values still faster (what if the value we're after requires an entire game to be played, in declarative programmer that is very possible).
    There might also be other cases. Instead of using a plain ArrayList, you would use a decorated one, where in addition to add method it would also log the value or something... In that case, Cached class needs to allow users to specify where to cache stuff, be it a file, a cloud, etc.
    You asked for a problem description, so here it is. I would like to use Cached in classes like these:

    /** The class that computes a value. */
    public final class UrlHostNameStartIndex implements HostNameStartIndex
    {
        private final String url;
        public UrlHostNameStartIndex(String url) {
            this.url = url;
        }
        public int toInt() {
            // ...
        }
    }
    
    /** a decorator that caches the computed value */
    public final class CachedHostNameStartIndex implements HostNameStartIndex
    {
        private final Cached<Integer> index;
        public CachedHostNameStartIndex(UrlHostNameStartIndex index) {
            this(
                new Cached<>(
                    new Origin<>() {
                        public Integer value() {
                            return index.toInt();
                        }
                    }
                )
            );
        }
        public CachedHostNameStartIndex(Cached<Integer> index) {
            this.index = index;
        }
        public int toInt() {
            return this.index.value();
        }
    }

    I hope that it's easy to understand. Sure, for small objects like these two, it's enough to have an ArrayList. I just thought it'd be cool, if Cached allowed me to specify a different location of the value, for cases not yet discovered that may come up in the future. And that brings me back to my original question, is there a way to do that without making Cached look like a configurable object.

    Fabricio Cabral
    @fabriciofx
    @justasbieliauskas I'm sorry if I didn't your question well, but I believe you can create several decorators to the work properly, like new Logging(new Cached(new Abc())).value(). Or your problem is how Cached store the object (ArrayList)? In this case you can create another parameter to receive which implementation use to store the object into cached.
    Ix
    @ixmanuel
    @fabriciofx or a decorator for each implementation of cache, but for this case a parameter is more flexible as you suggest.
    Fabricio Cabral
    @fabriciofx
    @ixmanuel Yeah, you're right. Thanks! :)
    @ixmanuel BTW, congrats for your work in Cactoos. It's awesome! :)
    Yegor Bugayenko
    @yegor256
    @ixmanuel yes, indeed, thanks for your contribution!
    Ix
    @ixmanuel

    @yegor256 @fabriciofx

    The most precious gift we can offer others is our presence.

    It is virtual, but I counts :)
    Thanks for sharing, both of you.

    Fabricio Cabral
    @fabriciofx
    @ixmanuel :+1:
    Justas Bieliauskas
    @justasbieliauskas

    @yegor256 @fabriciofx @ixmanuel Wouldn't a parameter make the object a "configurable object"?
    Here's the Cached class if we use a parameter:

    public final class Cached<T>
    {
        private final Variable<T> variable;
        private final Origin<T> origin;
        public Cached(Variable<T> variable, Origin<T> origin) {
            this.variable = variable;
            this.origin = origin;
        }
        public T value() {
            if(!this.variable.initialized()) {
                this.variable.initialize(this.origin.value());
            }
            return this.variable.value();
        }
    }

    It seems to me like through Variable parameter we're injecting foreign behaviour. This class greatly depends on the implementation of this parameter and now the logic of Cached is in the hands of an outside object.
    I'm trying to understand that fine line between proper composition and configurable objects. This case seems odd to me.

    Marcos Douglas B. Santos
    @mdbs99
    @justasbieliauskas I think this is a setter:
    this.variable.initialize(this.origin.value());
    If we are using a setter, we can simplify using NULL:
    public final class Cached<T>
    {
        private final <T> result;
        public Cached(Variable<T> variable) {
            this.variable = variable;
        }
        public T value() {
            if(this.result != null) {
                this.result = this.variable.value());
            }
            return this.result;
        }
    }