Intro to Scripting - raisercostin/software-wiki GitHub Wiki

Things to try

Best practices

  • Use a modern shell (bash, zsh)
    • Do not use csh, ksh or other old shell
  • Do not learn/write code in special DSL's since they
    • will have a short live
    • not be known by most people
    • do not have tooling support: syntax highlight, autocomplete
    • do not have fallback options for complex scenarios
    • have wrong fallback options for complex scenarios
      • complex escaping sequences in other escape sequences
    • feedback loop is long. a change will need the DSL to be executed by the bigger tool
    • cannot use the script without the bigger tool
    • Any fool can write code that a computer can understand. Good programmers write code that humans can understand. - Martin Fowler
      • write once solving complex syntax in syntax problems and with clear context (when solving the problem)
      • read many times
      • examples:
        • gocd DSL (yaml based) + shell commands
        • kubernetes DSL (yaml based) + shell commands