Coder Social home page Coder Social logo

Comments (3)

Razoric480 avatar Razoric480 commented on July 23, 2024

For built-in types, there's only so many: _enter_tree, _exit_tree, _input, _physics_process, _process, _ready, _unhandled_input, and _unhandled_key_input. I imagine we can maintain a dictionary for those.

Though virtual VS private is the other niggle. I'd really prefer not having double underscores. I'm already not a fan of how one looks, heh. That said, an API reference will point out functions that are public facing. Simply not adding a docstring to a function should make it essentially-private as far as a documentation generator is concerned.

Then we differentiate a virtual and private function (or a virtual private function) by the mere fact that it is or isn't documented.

from gdscript-docs-maker.

NathanLovato avatar NathanLovato commented on July 23, 2024

For builtins yes, I already have the list actually.

Simply not adding a docstring to a function should make it essentially-private as far as a documentation generator is concerned.

It's too easy to forget a docstring, or to document a function that shouldn't be. We shouldn't rely on us not making mistakes for the tool to work as expected.

It's a pity we don't have a virtual keyword, but at least a virtual function is one that should just pass, it shouldn't define any behavior, so I guess we can rely on that, and count the leading underscore as private otherwise.

from gdscript-docs-maker.

Razoric480 avatar Razoric480 commented on July 23, 2024

Though with typed GDScript and virutla functions that return a value, we can't just pass - if the virtual function returns something, Godot will error out.

func _do_check() -> int: #illegal
  pass

So it's not something that can be relied upon, unless we make the base virtual function not have a return type until it's overriden in an extended class. We could explicitly tag a function as virtual in the docstring?

from gdscript-docs-maker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.