Learning bukkit / Java - How hard is it?

Discussion in 'Bukkit Discussion' started by redcanoe, May 16, 2014.

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


    Hey folks,

    How difficult would it be for someone with minimal Java skills to code a plugin? Would I be looking at a week before I made something functional, or longer?

    Right now I'm going off a few text guides and Youtube guides. I want to make a few basic plugins for my server, the most complicated being a money plugin (players earn a dollar for every block placed and mined, save for some blocks which pay less. I would need to prevent players from abusing this.)

    Is it even worth getting into java to do this?

    Thank you!
  2. Offline


    Learning Java is worth it, you may like coding and become developer for other plugins which you may release! But if you're going to tackle Java you may as well learn it and not tear your hair out and think why your JavaPlugin is an unknown variable.

    It's not that hard to learn the syntax, it's hard to keep yourself motivated at times though.
    Caprei, shadow5353, es359 and 5 others like this.
  3. Offline


    I originally learn JavaScript then I learnt a bit Java through Bukkit and trial and error and learnt the rest from a book. Java isn't that hard to learn, it's structure is easy to comprehend and understand and it makes a lot more sense then some other programming languages..
  4. Offline


    if you ask before trying - too hard\not possible for you.
  5. Offline


    RawCode This is the wrong attitude to take towards newcomers. If OP were asking how to make a game from scratch with no programming experience, maybe, but this is not the case. He is asking how hard it would be to learn, which is a completely valid question.

    Back to OP: Learning a programming language is not too difficult once you grasp the basic concepts behind programming in general and you become familiar with Java syntax. You can learn Java from programming Bukkit plugins just as well as you can learn from writing standalone Java applications (Bukkit plugins still offer the opportunity for pure Java programming).

    However, if you have never programmed before, I would really recommend just learning Java first before attempting plugins because most Bukkit tutorials assume you are already familiar with programming in Java, whereas plenty of Java tutorials are aimed for those who have never programmed before and will explain everything in more detail as is necessary.
    Cirno, shadow5353, es359 and 6 others like this.
  6. Offline


    Pro tip: Check out people's source code and see how they did certain things. Since you're going to make an Economy plugin, you could look up the source code for, say, iConomy. Of course, you shouldn't copy anything, but you can get the general idea from source code.
    OrangeGuy and es359 like this.
  7. Offline


    Programming is one of those skills that is going to set you up for life, so if you've got the motivation to try and learn, I'd say go for it.
    SimplyCode, Cirno, es359 and 2 others like this.
  8. Offline


    As almost any programmer will say, start with the basics and work your way up. It may seem like things are moving slowly at first, but you will be amazed at how fast things start picking up once you know the basic syntax and have your head around the basics of Java.
    Rocoty likes this.
  9. Offline


    redcanoe I'd say it's definitely worth it. Learning Java is something that you'll keep for a lifetime if you keep to it, but as most will say, If you have no prior Java experience, or programming in general, it may be a bit hard to grasp the concepts at first. Once you start to get a hang of say, Java's syntax, you'll easily be able to code a really nice, still pretty small, but functional plugin.

    Also, learning Java can open the doors to other languages if you get interested enough, such as C#, or even C++.

    I'd say go for it! :)
  10. Offline


    java is a really good suitable language for beginners imo, maybe not for everyone directly but since I compare my knowledge from php to java, I can say that java IDE's are really advanced sometimes it actually educates me..., while in php I actually failed to learn until it made more sense when programming in java and vica versa compare that knowledge back to php again, even though I understand how if and else worked but the OOP part in php was just terrible I just didn't understand what final, private, public, static, protected was ment to be, eclipse learned me how that worked:p.

    so for your case its a yes and no, java can be easily learned but you need to stand open for it, and yes don't use notepad but something like eclipse what directly tells you what goes wrong, then as last don't try to be a spoonfeeder with that I mean is that you shouldn't ask for code to copy paste, or how really basic things work such like if loops, but instead verify if the code you made is good else question why it isn't good and if you got code from someone check what it does line for line, atleast thats how I learned it just by questioning and saying my theory how it works if it fails then people on bukkit would help me why my theory fails.

    for me its a good way of learning, however some people might sound very hard and disruptive by giving critic just don't let you get pushed away from them from the forums because even I noticed some people do.
  11. Offline


    xize Using notepad and compiling manually can actually be a very good way of learning how the compiler works. Since Eclipse does all that for you it might be hard to grasp what actually happens. I would start with notepad or notepad++ and then move onto Eclipse after some practice.
    Maximvdw and es359 like this.
  12. Offline


    I probably won't recommend to do that for a beginner imo, its good to see how the compiler works but if you are a plain newbie it wouldn't be 100% usefull but I'm not saying it isn't usefull but for the new programmer it will looks like it is:p, I probably think it would be better to test it when you are used on the IDE you use but on the other hand its probably the luxary what stops me from trying compile via bash though.
    Aengo and AoH_Ruthless like this.
  13. Offline


    AoH_Ruthless likes this.
  14. Offline


    The first thing you need to do is learn the fundamentals of Java before working with Bukkit. Not mastery, but you need to know your way around Java comfortably.

    Learning Java isn't hard per-say, there are lots of resources to help you: javadocs by oracle, videos, books, classes, etc. You just need a lot of patience. Learning the fundamentals isn't terribly difficult so long as you stay focused.

    Bukkit will be a lot more difficult for you without a solid background in Java. But, if you need help with Bukkit related issues, these forums are extremely helpful for you to ask questions, or you could look through the extensive Bukkit documentation.
  15. Offline


    All I can say is that if you know already some programming language, java won't be difficult for you.
  16. Offline


    I beg to differ. In my opinion it should be the other way around. I would recommend it for a beginner. In fact, when I started out, I also started with an IDE. I wish now that I had started without one. It would have saved me some trouble. Because in an IDE everything happens behind the scenes. You don't get to see what happens and why, and I think knowing why stuff happens is an important part when you're learning.
    garbagemule likes this.
  17. Offline


    That's the dumbest thing I've read all day, and I've read some pretty dumb things today. You seem to be spewing a lot of "omg this is invalid" all over the forums recently. It would be absolutely fantastic if you could stop, or at least provide some rational arguments as to why everything is "invalid", because your Debbie Downer attitude is the only thing here that'll prevent the OP from learning.

    In the real world, questions like "how much effort will this require?", "how much time will this take?", and "is it worth it?" are asked all the time by many different kinds of people, from interns to CEOs. Why? Because the answer is not always obvious, and finding out the optimal answer to the question usually involves asking many different kinds of people with different levels of expertise in different fields. If you've got a deadline in 3 days and you've recently discovered a new way of doing something that could simplify a lot of things in a huge project, would you make the switch? What if it won't actually work? What if you won't be able to finish without it? Asking people with more experience than you whether it'll be "worth it" or not is not a waste of breath/typing.

    Rocoty hits the nail on the head. Starting out with nothing but a text editor and manually compiling will force you to try to write your code correctly and understand the syntax before you compile. IDEs are useful tools, but they are absolutely horrible for learning a new language. Text editors like Notepad++, Sublime Text, etc. that offer syntax highlighting and automatic indentation can be very helpful, but not so "helpful" that they do all the work for you. An IDE is a tool for someone who understands the language and needs to quickly and efficiently produce code. If you are just starting out learning a new language, you are not that someone, so you should not strive to produce code fast, but to reason about the code you're writing, and why it should or shouldn't work.

    That's not to say that you can't learn in an IDE, of course you can. It's just not a very useful learning environment, because it holds your hand a bit too much (you'll never learn how things actually are because you'll never do them yourself) and tries to force you to do things that you haven't even got a clue about what is yet (which only creates confusion).

    Finally, I want to reiterate what I've said so many times before; programming is just a craft like any other craft. It's a tool that we use to develop software, just like hammers and screwdrivers are tools that carpenters use to build houses. If you want to develop good software, you will have to know how your tools work and how to use them efficiently, so part of the process is learning the basics (Java syntax, object-oriented programming principles, event-driven programming concepts, etc.) before diving into the advanced stuff (actual, production quality plugins). You can also dive head first into plugin development, but going directly for the end goal without the basics is one of the reasons people sometimes end up throwing the towel in the ring.
    AdamQpzm, Wingzzz and Rocoty like this.
  18. Offline


    Computers are the future of our world, programming is the language of the future. Learn now, get ahead of the game.
  19. Offline


    You should definitely try and get into it. You seem to already have a few ideas on what you want to make and that makes coding any plugin or learning to code easier. However it won't be the easiest thing you have ever done.

    I would suggest you focus on a few things while learning how to program.
    • Look through these forums and find out what others are doing wrong and correct that in your work
    • Learn to debug your code so you can figure problems out by yourself
    • Learn the fundamentals of Java
  20. Offline


    Since this thread seems to draw attention to lot more advanced coders than I am, let me ask your opinion about "trial & error coding". I am a bit of trial & error guy myself and although with Bukkit, it might be tedious and take time, this strategy has produced me six pretty well working plugins.

    So, the strategy is this: since I'm absolutely staying away from any really dangerous parts like NMS, I like to experiment with Bukkit methods, to find out what works. So I don't do a lot of planning of my code beforehand. I just sit down and write some code, testing out some classes and methods and then printing out the results of some important parts of my code with log.info() (which is an INVALUABLE tool for me).

    Very often this leads me doing more work than would have been expected. But hey, this is a hobby for me, so I like to spend the extra time. And I've found out that I really do learn more from mistakes & badly laid out code (which might be running inefficiently before I rewrite it) than by just planning carefully and doing it "right for the first time".

    I do realise that with this attitude, no-one would probably hire me to write essential SW for a space rocket project. But coding a plugin for a game - that's a different story. Or at least I think it is. What do you others think?

    EDIT: someone suggested reading other plugin developer's code. While this can in theory also lead to learning bad habits, it has been an invaluable tool for me. Lately I've noticed my skills really have increased - I can code a new feature which is not dead simple, and get it right the first time. Immensely satisfactory. Lately I've learned me some interface coding and Java Generics (the latter being dead cool!).
  21. Call it "agile" software development :p.
  22. Offline


    "Doing it right the first time" is a myth. Most written works, including programming, improve with later revisions. That's one of many reasons the "waterfall model" (where every phase is a one-time only thing) is slowly being abandonned in favor of agile development methods (where you go through several iterations of each phase in the development cycle because it usually results in better products).

    Trial and error is necessary. Like I said in my previous post, programming is no different from any other craft, and there is no craft in this world that you can get better at just by reading or trying to plan ahead. Practice and experience are extremely important, and as long as you can reason about your errors, there is nothing wrong with having them - if you can explain why it didn't work before, you have gained much more than you would have gained by guessing and getting it right the first time. Trial and error is part of the learning process of any craft. My old instructor at The Drawing Academy once told me: "Only after 1,000 drawings will you see something even remotely decent. It'll still be total shit, and you'll still have a long way to go, but until you go through those first 1,000 drawings, you'll never get any better."

    There are a lot of extremely badly written plugins out there, but that doesn't mean you can't learn something from them. As long as you learn the concepts applied in the plugins, and not the bad practices, you're golden. To avoid being affected by bad practices, however, you have to know that they are bad practices, and you can't know that if you jump head first into plugin development by reading other people's source code. That's why learning basics from reputable sources is a good idea. It's a lot harder to unlearn something than it is to learn it properly the first time - probably why I'll never get any better at playing the guitar :p
    Smerfa and Etsijä like this.
  23. Offline


    Wow, I really really like the way you think, garbagemule!
  24. Offline


    In the real world, questions like "how much effort will this require?", "how much time will this take?", and "is it worth it?" are asked all the time by many different kinds of people, from interns to CEOs. garbagemule

    and answered by performing some kind of research, not by asking on forum.

    if you want to write NMS code - you go and write it without asking anyone's permission, it does not matter will your code work or not, later you can ask what is wrong.
    Asking directly is evidence of absence of skill.
  25. Offline



    That is really, really stupid. Yes, you probably could take years and years to find out how long it will take to build a house, or you could just ask somebody who has already done it. It's not absence of skill, its avoiding wasting your time. And if you honestly think that you have nothing to learn from other people, why are you on these forums?
  26. Offline


    Awesome, thanks for the reply.
  27. Offline


    Care to read my posts?

    It's possible to tell how much time skilled specialist will build house or write code, but not possible to tell how much time same action will take from unskilled random human.

    This thread ask, how hard for unskilled random topic starter java is, i answer - undefined, question is invalid.

    ps. i dont need your permission to visit this forum, good day to you.
  28. Offline


    RawCode: So while all others chose to contribute to the thread by pondering different ways of learning to code, you chose to contribute by telling all others the thread is invalid. And that is, like, your only contribution.
    TopTobster5 likes this.
  29. Offline


    I'm going to be completely honest... I've seen you on quite a few threads in the past couple hours of me browsing Bukkit's "Plugin Development" section and not once- literally not once, have I seen you say something that contributes, helps, or is positive. I've only seen a repeat of "blah blah blah- invalid".

    Now, I understand that sometimes things can seem pretty far fetched or funny from a person's perspective. Although I haven't seen anything ridiculous enough to just flat out say it is invalid. Not to mention the fact that you rarely support your claim and when you do it is either shakey or incomprehensible. Take your above statement for example. I don't know what you're saying- I can take a guess but really it's pretty incomprehensible.

    I don't mean to be rude by this, but I feel like you're being pretty negative to most people around the forums and whilst negativity can be a good thing- you're lacking what's called constructive criticism. Instead of pointing out flaws/bad practice etc and stating why, then following up with solutions, possible approaches to the problem, your two cents, or links to sources that the person might want to see- you flat out say "invalid" to which sometimes can't even apply. It's getting to the point where it's a little unfortunate that some community members must endure their threads being filled with your nonsense.

    Any ways to the OP, I have no need to reiterate in detail what many have beautifully said on here. Programming is fun, educational, it sates a person's taste for challenge, curiosity, and it's a place to put logical and abstract thinking to work. I find programming to be much like an art or craft as garbagemule has put it oh so many times. I still remember when I simply played Minecraft SMP all the time with plugins. I used MobArena to which is amazing to be able to understand how it works. It may ruin some of the "magic" that some software emits- but it definitely is so great to be able to tinker with the inner workings of things I used to use and even create my own software. Programming is a sea of knowledge and collaboration that keeps evolving and I will never regret getting involved with it.

    Do your best, have fun and challenge yourself. You don't need to be Einstein or Isaac Newton to program. You don't need advanced knowledge of mathematics or geometry. So I highly recommend investing however little or however much time you can in learning and putting that knowledge to use for whatever goal(s) you may have!
    Gnat008, nlthijs48, Konkz and 5 others like this.
  30. Offline


    Start small or you will make the same mistake as me!
Thread Status:
Not open for further replies.

Share This Page