Skip to content

Improve documentation #959

Open
Open

Description

Various topics should be added or improved:

Tasks:

Todos:

  • Reference to optionals, field access + dictionary access
  • "Constant means that the identifier’s association is constant, not the value itself – the value may still be changed if is mutable."
    • Make this a warning
    • Repeat this on the page describing fields
    • On the access control page, add "Remember that if you can access a let dictionary or array you can mutate its contents, this includes when they are pub or access(all) member variables of a contract, resource or struct."
  • Static casting
  • Add an example showing how a function can be passed to a function
  • Storability
  • getAccount and getAuthAccount
  • Debugging: log, debugger, testing
  • IDE, path from Playground
  • Time-based applications
  • unsafeRandom: "unsafe" meaning is two-fold:
    • Prevent accidental misuse
    • Current implementation:
      • Block ID is not a safe source, we should use the random beacon
      • Use of Go's math/rand
        • Doesn't guarantee uniformity
        • Seeded only by 64 bits
        • Not secure, e.g., based on old randoms, next ones can be predicted
  • A glossary and alphabetical index of all concepts (with potential alternative names), keywords, operators, etc.
  • Contract update events
  • Documentation explaining script syntax in similar fashion to the Transaction documentation in Cadence section
  • Clarify that adding a destructor to a resource does not "overwrite"/"replace" the destruction of the resource, it only allows additional code to be performed
  • Conditions are not checked to be side-effect free yet
  • Transactions are atomic. It either succeeds, and all state changes are committed, or it aborts during execution, and none of the changes are committed, even if they had been executed before the abort
  • Destroying nil is a NO-OP. An optional is a single-element container, and if it has no value, there is nothing to do. Just like destroying another container, like an empty array or empty dictionary
  • When loading just to destroy the value, use AnyResource/AnyStruct instead of a specific type, as it may be incorrect, in which case load will return nil
  • Add missing status banners / remove unimplemented features
  • Subtyping for optionals, functions, etc.
  • Point out which functions are unavailable for resources, e.g. Array.contains
  • Paths: Re-iterate and show good + bad example for what “identifier” means
  • Point out that key order is deterministic, but not defined (it is based on the hash of the key)
  • log
  • API documentation for built-in types and standard library types
    • Include type IDs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions