Is it hard to code an api

Discussion in 'Spigot Plugin Development' started by Angeles, Jun 7, 2016.

  1. Hello spigot users today im asking if its hard to code an api because i board of plugins and wondering if someone could help me or explain
     
  2. JamesJ

    Supporter

    Depends on the API.
     
  3. i wanted to code my own configAPI
     
  4. Okx

    Okx

    An API is simple, just make code and then make it runnable/accessable by other .jar files. Done.
     
  5. For most people? No.
    For you? Most likely it is hard.
     
    • Funny Funny x 5
    • Agree Agree x 3
  6. Could i code a plugin
    then use it as an api
     
  7. Okx

    Okx

    Errr... yes.
    Take a look at my TimeAPI plugin to get an example of how APIs are done.
     
  8. Shouldn't 'is it rewarding to code your own config api?' be the question instead?

    If you don't want to depend on the Bukkit config API, you'll probably implement your own configuration API layer and adapters for Bukkit then, or whatever you need underneath/between.

    You'll probably end up doing similar things like they implemented in Bukkit with the ConfigurationSection interface, if you want to have sections under a certain path with multiple sub-paths leading on from there.

    Do you need other features or behavior for your configuration handling? What is the reason for creating your own? It could be interesting/rewarding to try once, or to at least get to a point with trying, where you understand why the Bukkit API is shaped like it's shaped. Of course there are shortcomings, e.g. objects as values everywhere, but then some methods return raw types not allowing for a null return value, some time ago testing for existence of paths or removing individual paths used to not have methods - or you might just want to have a server-mod-independent layer, whatever the reasons may be...

    Edit: Looks like it's about how to make the API accessible rather.
     
    #9 asofold, Jun 7, 2016
    Last edited: Jun 7, 2016
  9. Pm me please
     
  10. JamesJ

    Supporter

    Or you could PM him yourself?
     
    • Funny Funny x 1
  11. Honestly no one is interested on you enough to even send you a PM, that is something you should do, not him.
    You are the interested on "x" here, not him.
     
  12. Oh that's already taken place... didn't understand fully, perhaps am too tired right now. Didn't understand, if there are issues with compilation or rather with 'how to design the (already sketched out) api properly/perfectly/optimally'.
     
  13. Writing a functional API is about as hard as writing a functional Java application. If you understand Java, it's no more complicated. I've seen from past threads that you don't seem to know Java at all.
     
    • Agree Agree x 4
  14. Agreeded, if you came here to get spoon fed on how to create your own API then sorry because I'm all out of spoons right now :(
     
    • Funny Funny x 1
  15. Don't ever get new spoons, either.
     
  16. He's from MCM. It's a typical MCM phrase.

    By the way, Pm me! ;)