Skip to content

Best Practice Guidelines for Javascript Applications? #44

@HaraldKi

Description

@HaraldKi

This movement will likely not fly without the guidelines someone suspected of being a framework in themselves once they are written. Guidelines help to understand what good components are and why they are good. A software framework (merely) tries to enforce getting out good components even without understanding why they are good.

The guidelines should assume that one does not use a framework with some reasonable definition of 'framework' as you did with the simplistic, but, I think effective: 'a framework calls your code' (in contrast your code calls a library)'.

The guidelines should describe what to do and what to avoid to get reusable software, in particular UI elements/components, with plain Javascript. I wouldn't expect to find, for example, a suggestion to use web components or not, but rather abstract recommendations what to watch out for regarding the non-exhaustive list

  • creating, changing and removing DOM structures
  • maintaining state
  • attaching, removing and handling events in a non-intrusive way to facilitate reuse
  • defining CSS rules for the component with reasonable prevention of littering the global namespace
  • ...(you name it)...

These guideline could even be used as a checklist for libraries to include in a project, assuming that if too many guidelines are not followed by the library it may need extra thought before being depended on.

A lot of 'best practice javascript' sites are out there, so maybe some have good guidelines already, but the ones I looked at so far have 'coding best practice' and not much about 'design of reusable components'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions