

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to reduce the number of errors in scripts?
To reduce the number of errors in scripts, follow the below-given tips −
- Use plenty of comments. Comments enable you to explain why you wrote the script the way you did and to explain particularly difficult sections of code.
- Always use indentation to make your code easy to read. Indenting statements also make it easier for you to match up the beginning and ending tags, curly braces, and other HTML and script elements.
- Write modular code. Whenever possible, group your statements into functions. Functions let you group related statements, and test and reuse portions of code with minimal effort.
- Be consistent in the way you name your variables and functions. Try using names that are long enough to be meaningful and that describe the contents of the variable or the purpose of the function.
- Use consistent syntax when naming variables and functions. In other words, keep them all lowercase or all uppercase; if you prefer Camel-Back notation, use it consistently.
- Test long scripts in a modular fashion. In other words, do not try to write the entire script before testing any portion of it. Write a piece and get it to work before adding the next portion of code.
- Related Questions & Answers
- How to reduce the number of Predictors?
- Count the number of operations required to reduce the given number in C++
- Number of Steps to Reduce a Number in Binary Representation to One in C++
- Understanding the npm scripts in node.js
- How to integrate Sikuli scripts into Selenium?
- PHP Types of Errors
- Find the Number Occurring Odd Number of Times using Lambda expression and reduce function in Python
- Python program to find the number occurring odd number of times using Lambda expression and reduce function
- How to handle Geolocation errors in HTML5?
- How to catch syntax errors in JavaScript?
- How to display errors in PHP file?
- How to create custom errors in Golang
- How to catch all JavaScript errors?
- What are Scripts In Postman?
- HTML DOM scripts Collection
Advertisements