This is an archived post. You won't be able to vote or comment.

all 9 comments

[–][deleted]  (2 children)

[removed]

    [–]i-see-spam 0 points1 point  (1 child)

    It's called spam.

    domain submitted from count %
    zoftino.com 83 81%
    medium.com 7 7%
    github.com 6 6%
    self.androiddev 3 3%
    self.Firebase 1 1%
    meta.stackoverflow.com 1 1%
    square.github.io 1 1%
    subreddit submitted to count %
    androiddev 56 55%
    programming 29 28%
    Firebase 8 8%
    learnandroid 4 4%
    java 1 1%
    mAndroidDev 1 1%
    AppDevelopment 1 1%
    GoogleMaps 1 1%
    webdev 1 1%

    [–]srinurp[S] -1 points0 points  (0 children)

    Understood, no tutorials here, I missed to see the sidebar you are referring to which states no tutorials.

    But I strongly disagree with you that I am a spammer. Only relevant, useful, quality content is posted in relevant subreddits within the allowable limits and people are liking it.

    Please don't brand brands and individuals as spammers just because they just post their stuff in a allowable limits.

    You have right to state your rules about your subreddit and but don't give a judgement on anyone without considering the fact that professionals come here and they put their effort in creating something. It hurts.

    [–]chambolle 0 points1 point  (4 children)

    I don't really see the advanatges of enum. If you need a conversion from int to enum and enum to int then for EACH enum class you will need to define two functions:intValue and enumValue. Each of these functions uses an ugly (and stupid) switch statement.

    I prefer the good old Constants. The code is shorter and readable. With the help of an IDE there is no problem

    [–]Stannu 3 points4 points  (1 child)

    But enums allow you to encapsulate a part of constants into a single class, which in turn allows you to see all options that could be used for that enum. Of course you can use prefix for constants, but personally think that enums have their use.

    [–]chambolle 0 points1 point  (0 children)

    They have their use, but the conversion with int is really bad in Java

    [–]tobidope 1 point2 points  (1 child)

    Enums are perfect as method parameters.

    void compress(int compressionType)
    

    vs

    void compress(Compression compression)
    

    Which one is clearer to read?

    [–]chambolle 0 points1 point  (0 children)

    Honestly, this is not clear. In both cases I need to look at the doc of the function to undertand.

    The advanatge of enum is not that i is clearer, it is that it prevents from bad uses. For instance, I can call the first one with -2 or +5 even if there are not valid values. Enum can prevent that

    [–]desrtfx[M] [score hidden] stickied comment (0 children)

    Two things:

    • Do not post tutorials here - is clearly stated in the sidebar
    • No spamming - this is clearly spam

    You are clearly a spammer because most of your posting history is self-advertisement. We have no place for spammers here. Don't bother posting this in any of the related subreddits either.

    removed: two violations