Advices for less broken code?

Hi guys do u have any advices on how to write les broken code?
Beginner tho

Sketch your website on paper first
Choose your color theme and font before you start coding
Build your page in sections

If you elaborate on what you mean by broken code, you will get more valuable answers

good luck!

1 Like

The best coding starts with pencil and paper.

  1. Use proper names with your functions and variables, so that they define what the function/variable does.
  2. Each function should do one thing, if you have a function called “sumNumbers” it shouldn’t also multiply the numbers.
  3. Following the best practices of the language that you’re using. For example, Javascript always prefers camelCase names, but other languages, such as python or ruby prefer snake_case.
  4. Use linters such as EsLint and Prettier in your projects, have coding guidelines. They tend to fix small mistakes that otherwise would go unnoticed.
  5. Always read the instructions thoroughly. If you’re using other libraries, read the documentation,
  6. It’s never wrong to Google if you have an issue. No one knows programming by heart. Remember that programming is difficult and there’s no shame in asking for help or looking online for solutions, because other people have definitely have had that problem before.
1 Like