N
N
NotBad_Bugfix2014-07-21 17:25:34
JavaScript
NotBad_Bugfix, 2014-07-21 17:25:34

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

6 answer(s)
S
Sergey, 2014-07-21
Protko @Fesor

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.

H
hadaev_ivan, 2014-07-21
@hadaev_ivan

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.

M
Maxim Vasiliev, 2014-07-21
@qmax

Stop writing jQuery and start living.

F
FoxInSox, 2014-07-21
@FoxInSox

With a high degree of probability, the book, alas, will not help, get a job in a large company.

N
Nick Murzin, 2014-07-22
@R0s0maxa

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.

A
Alexander Baumgertner, 2014-07-26
@alexbaum

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 question

Ask a Question

731 491 924 answers to any question