Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

Language Agnostic

  • Avoid long chains of if statements (switch cases are ok)

  • Avoid nested ternary operations - if a nested ternary only has 2 outcomes it can be written as one ternary

  • Break up code into reusable functions

  • Comment your code

  • Have meaningful names for variables, classes, components, functions, methods, etc

  • Avoid massive functions/components

  • Use object oriented programming whenever possible

  • Create documentation for your projects in confluence

  • Handle exceptions

  • https://www.browserstack.com/guide/coding-standards-best-practices

React

  • All state hooks should be right after the constructor, then stack useEffects, followed by component functions, and finally the JSX return statement when possible.

  • Avoid writing extensive logic into useEffects write as functions that can be called in the useEffect when possible

  • Don't use redux or the database to hold information only being used within one component

  • When writing supporting components write them to be ambiguous so they have the potential to be used outside of application they were created in.

Python

  • Create a virtual environment using MinConda or MiniForge

  • Don’t import * from my_package

  • Create classes instead of functions

  • Utilize pytest

  • Don’t alter sys.path

  • Use and __init__.py file if you’re creating a python module (only used via importing)

  • https://data-flair.training/blogs/python-best-practices/

  • No labels