Solved this is possible!

Discussion in 'Plugin Development' started by MinecraftChicken, Oct 22, 2014.

Thread Status:
Not open for further replies.
  1. Offline


    I think I would cry if I were banned from bukkit...
  2. Offline


    Hehe, I wouldn't cry. I'd most likely just surf the internet until I could find my answer :)

    EDIT: Typo.
  3. Offline


    :eek:Answer to what...?
  4. Offline


    ChipDev CraftCreeper6
    You're bumping this thread with a completely off topic discussion. The OP of this thread set it to Solved, so do not keep bumping it. Please refrain from doing unnecessary conversations, especially in this category.
    MasterDoctor and ChipDev like this.
  5. mythbusterma of course i would have been complaining, if i wouldn't have been offline already. I think the problem is there are to much "programmer" who are young minecraftkiddys, or also old minecraftkiddys, who think it would be smart to learn all methodnames and their functions by reading the api, but having no idea about java and how it works. And then people like ChipDev , Rocoty and @Fishley or fireblast709 come along and try to tell me, a real javadeveloper, that the important thing about java is not the code, it is that it compiles and runs and that you don't have to know what methods does in the background as long as they give you what you want. But exactly this is how bad code is generated!!!

    I'm only tring to help you generating better javacode but they just keep saying "no, i don't wanna" like little childs. That's the point im complaining about. Spoonfeed can really help, if it is done well, if there are comments or docs or discriptions and not just pure code and if it is not the whole function. Spoonfeeding should be done in little peaces to make the developer think about how he/she can extend it to create his own function with the given code.

    Rocoty i believe you're the only one of those who actually can program for real and i don't know why you're such a stubborn head. I mean i don't want to pull you down, i only wan't to know why you are keep saying no to simple things like write the result of a method in a variable to see its type while reading and knowing exactly on which object you're working at the moment?

    mythbusterma sorry if i thag you twice, but i had to say, that i've seen many good posts of you and i've also seen some code of you which was most of the times quiet short to prevent spoonfeed and also helpfull. You are the only one here i would discuss with about javastandards and things like codequality, because all others here keep saying "no, i don't wanna" xD just had to say this :)
  6. Offline



    Thanks for your praise, and the point being I don't consider small snippets or pseudo code spoonfeeding, nor do most people here.
    MasterDoctor likes this.
  7. mythbusterma yes, you're totally right with this, spoonfeeding or codesnippets are in the most cases wrong. but there are a few moments where you can explain it with pseudo code like a step by step list if the programmer doesn't know how he/she should setup the function. Anyway, this thread is set to solved, we should stop writing here because otherwise people gonna start complaining about us :D
  8. Offline


    *Cough* You just bumped it too *Cough*
  9. are you stupid?? when you save the array of online players one time, someone other could join after some time and hes not added to the array. with Bukkit.getOnlinePlayers() you get everytime all players that are currently online
  10. Offline


    I laughed.... yet not amused. I have been writing Java for two-three years now, with a full meal of C++ before that. I know how to write code. Now try again, calling me a fake developer.

    Firstly, the fact that you are not able to tell the flow of the code by an iteration, means that you are by far experienced. Secondly, an API is designed in such a way that you don't need to know how the method works in the background (even though it might be nice to know, that's completely optional)

    For the love of everything see what kind of stupid stuff you are spewing out, scrub, and go learn to read code.

    AN: In the case that anyone thinks this post is too offensive. Well yes, this guy is currently giving me urges I cannot express on these forums.
    Totom3, Hawktasard and Rocoty like this.
  11. Offline


    If I come off as stubborn that's not my intention. I'm not trying to say that all code is fine as long as it compiles. That would be preposterous. I'm also not trying to say that you can learn to program just by reading API documentation. What I am trying to say is that implementation details don't matter. And I stand by this.

    Let me explain. A well designed API is simple, efficient and well documented. The lastly mentioned trait is key here. You don't need to know exactly what a method does, as long as you know if you can call it twice or more without noticeable performance loss. This is what the documentation is supposed to document. Exactly HOW the method does what it claims to do is highly irrelevant. This is called abstraction. We can extend this to outside the JVM. Exactly how the computer handles the different machine code and binary code is irrelevant. This is a much lower level of abstraction, but still, by definition, abstraction. We don't need to think about this, and we shouldn't. If we had to think about all implementation details of all methods we were calling we would only end up with a headache. The implementation of a method - or the way the computer works - could change, and for the most part we don't care about that. As long as it does what it says it'll do, it's not important exactly how it does it. This is also somewhat why we code to interfaces and not to implementations. (e.g List<String> list = new ArrayList<String>())

    Now, this is not to say that efficiency isn't important, because that would be a lie. But to debate about whether or not to save the returned value to a variable, and then loop using that variable... They're both equally valid, especially if you're only looping once. Now, one could argue that if you loop several times you should definitely save it to a variable. And I would agree to that, but probably not for the same reason as you would. I believe that good code is first and foremost well designed and readable. So to follow the DRY principle is important. But to think about performance - especially when it's micro-optimisation like in this case - should come after you have a good design.

    I still wouldn't say it's ugly code. After all it's as future-proof as can get, and adequately expressive. I believe the performance of Bukkit.getOnlinePlayers() is O(N), which is nothing to worry about if you only have a few players. Although if you expect many players then saving it to a variable is probably the best thing to do. And I've never said that is bad. What I'm trying to say is that in some cases it's probably better to sacrifice some performance in order to future-proof your code.

    As a side note I would like to point out that @fireblast709 can also actually program for real. Some of us don't JUST program to Bukkit. In fact, I did for a while, but now it's just sort of a side hobby of mine. And I'd been programming for years before I discovered Bukkit. And I'm still learning. I'm always learning. I expand my knowledge every day by reading, doing and sometimes discussing. Debates like this one here are certainly interesting, and will most of the time end up teaching someone something, even if that someone is not partaking in the debate.

    I don't want to seem rude, and this is probably not true, but maybe you're a bit stubborn yourself? It's probably just a bit of aggression from my side, due to blatantly being called a stubborn head...and childish. I've only been trying to discuss in a civil manner, and I'm not one to say "no, I don't wanna". I hope you could take back that statement. Thanks.

    Now, it's been lovely. I'll probably be up to more interesting discussions in the future, but this is where this one ends for me.

    Blimey, my post turned into a full-out rant!
  12. Offline


    How long did that take to type? :confused:
  13. Offline


    CraftCreeper6 likes this.
  14. Offline


    Ok, last bump..

    Second, Rocoty CraftCreeper6 Rocoty fireblast709 FisheyLP Shmobi and of course, Array
    all of us are just bumping this thread doing this which should be in the OffTopic section, and which we solved before the second page and now this is going to be on the third.

    Please stop and go here to post the next, or do whatever you want, because you are spamming Shmobi's inbox, And for example, Rocoty could just keep that in a diffirent PM/Conversation instead of Plugin Development
    In this past page I've seen no code boxes (Except signatures), and that must not be plugin development..
    (Seriously, someone lock this thread please!!!)
    Edit: crap I tagged myself xD
  15. Offline


    * I see no code boxes in your message either, ChipDev.
    * Also in my opinion everyone who has replied directly to another poster who directly attacked them is and should be allowed to reply.
    CraftCreeper6 likes this.
  16. Offline


    I can't choose to bump it or not, so you're acting like a little kid. Please, be mature for once. This thread is over.
    MasterDoctor likes this.
Thread Status:
Not open for further replies.

Share This Page