Skip to content

Latest commit

 

History

History
137 lines (111 loc) · 6.38 KB

File metadata and controls

137 lines (111 loc) · 6.38 KB

Class 5

🛠️ Software Design (How to write better code)

We thought it would be easy

General advice for cleaner, better code

  • Practice
  • Ask for feedback from your peers or mentors (or AI)
  • Refactor & clean-up your own code once it's working
  • Study common coding techniques. What are people in the industry talking & writing about?
    • Watch talks from conferences
    • Read blog posts
    • Follow developers on social media

Strategies

Use Design patterns

  • It takes experience to know which might be best in a given situation, so start trying them out!

Look for opportunities to DRY (Don't Repeat Yourself) up your code

SOLID principles

Defensive programming

Try Refactoring your code for better organization and code clarity

  • Readability (see below)
  • Comments
  • Indentation
  • OOP (classes) - Example sketch
  • Separate files
  • Build scripts
  • Package managers
  • es6 imports

Example of readability over brevity

🛠️ How to build anything

  • Follow the engineering design process
  • Break the problem down
    • Google the components of the problem, and follow the process above
    • Project management tools (Asana, Jira, Notion)
  • Write ugly code, then clean it up once it works
    • Don't over-engineer it until it's working
  • Ask someone for help/advice!
  • What happens when you hit a wall?
    • Sleep on it
    • Go for a walk
    • Use a duck
    • Try a different approach or reduce your ambition this time around. You'll figure it out with persistence!
  • Build your toolkit as you find solutions

🛠️ Graphics Effects & Algorithms

🛠️ Math

Math in generative art

📝 Homework

Read

Build a "generator"

  • Shapes
  • Some ideas
    • Basic example
    • Generate an environment
    • Or a character
    • Or a pattern
    • Or a particle system
    • Animate your generated visuals
    • Add sound!

Inspiration

📋 Review code

  • Present your animation loops