After entering this term into Google, you will receive a large amount of different advice and tips. But each piece of advice has its own specific value.
One is only applicable for a certain scenario, while another could be considered as the basis of optimization. The goal of this article is to share with you the basic principles of optimization when using JavaScript and the jQuery library, which I have observed through long-term practice.
When using forand whilecycles
it sometimes happens that we forget some calculation in them in a hurry (e.g. during the initial testing of the code). And so instead of one calculation, the result of which is used repeatedly, we do it over and over again.
In our case, the calculation must be calculated for each cycle, but the resulting value is constant. This calculation can therefore be written as:
JavaScript libraries such as jQuery was created to make life easier for programmers, not only by speeding up work with DOM vietnam phone number data elements, but also in connection with the security of the application. I’ve read many comments where developers argue the speed of using the innerHTML function to change the content of an element instead of using .html()the function from jQuery.
This feature cannot be denied to the innerHTML function. But if you decide to use it directly, I recommend reading at least the beginning of the html()jQuery function code. For example, memory overf.
against interfaces with generic type checking. See point no. 3.
Exception handling (using printStackTrace, System.out.println, Throwable). Use of standard login e.g. Log4J.
Exception handling (using printStackTrace, System.out.println, Throwable). Use of standard login e.g. Log4J.
Use concrete exceptions instead of Throwable
Exceptions and errors should be handled separately.
Generally, a large number of “if” and “switch” statements common mistakes to avoid with personalized marketing Using inheritance and class specialization.
Absence/insufficient description of methods and classes, many comments in the code Completion and automatic generation of descriptions.
Reduce comments in the code and leave bz lists them only for complex business processes.
Too many comments can signal a bad or complicated implementation.
Generally, a large number of “if” and “switch” statements common mistakes to avoid with personalized marketing Using inheritance and class specialization.
Absence/insufficient description of methods and classes, many comments in the code Completion and automatic generation of descriptions.
Reduce comments in the code and leave bz lists them only for complex business processes.
Too many comments can signal a bad or complicated implementation.