Answer the question
In order to leave comments, you need to log in
What book to read on javascript/jquery to stop writing Hindu code?
Hello, I know js and use the jquery library. I know the syntax of some functions, but I don’t know which functions I can always see. The problem is that I write bad js code and now I will prove it to you.
It's enough just to look at my code:
Ajax Manipulations paste.laravel.fr/#/show/xQB .
Well, here are all sorts of manipulations and animations paste.laravel.fr/#/show/G5p .
I understand that the code is not even readable, but the fact that it is Hindu I think is clear. Maybe I suck js Learned?
Answer the question
In order to leave comments, you need to log in
Well, I generally agree with @FoxInSox . Or look at the githubs of open source projects.
And if you look at your code...
This can be a starting point for simplifying the code. You have monstrous and clumsy selector constructs. Selectors are repeated, etc. You can search from the container and not the entire document... there are a lot of options to optimize this matter. One option is to use data-* attributes to bind events and find elements. Thus, our code does not depend on classes and other nonsense that is needed for the presentation. See how it is implemented in twitter bootstrap.
In general, your main problem is code duplication and inappropriate use of selectors. Also try to use the promises available in jQuery instead of nesting one callback within another.
Read everything behind these links eighteen times:
contribute.jquery.org/style-guide/js
google-styleguide.googlecode.com/svn/trunk/javascr...
learn.javascript.ru/write-unmain-code
choose what like it and use it all the time.
There are also such things as JSLint, JSHint.
With a high degree of probability, the book, alas, will not help, get a job in a large company.
If you don’t want to go to work for a company, understand already the obviously correct code - adopt all the goodies and chips.
The code can be viewed on the same github.
And also in the desktop books "Perfect Code" www.ozon.ru/context/detail/id/3159814
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question