I recently read a book ( CleanCode )
in this book,
FUNCTION SHOULD ONE. THEY SHOULD BE THIS GOOD. THEY SHOULD DO IT ONLY.and the function should be small.
FUNCTION SHOULD ONE. THEY SHOULD BE THIS GOOD. THEY SHOULD DO IT ONLY.
and the function should be small.
But I think the function is in javascript.
If I split a large function into small things, the code gets longer, and it takes longer to render.
Is it better to make a function small even in javascript?
what is your opinion
Microoptimization is not worth it. Maintaining health is much more important. You can use JavaScript minifier to actually serve the code in the browser .
, , . , , , .
.
. . , - - , , , , .
, , . . , , , , , , .
(, , ) .
" , ". , , , OO proselytizers . ? . , , . , . - - , , .
. , , , , - . (1) , (2), , " ".
, " " ( ) , .
, ( ) , .
Javascript, functions double , , . ginormous, , , /, , .
functions
,...
He does not say "do little things," he says "do only one thing" and "a little function."
This does not mean single-line, to do “one good”, it can easily be 10-50 lines and still be short and “single”.
Source: https://habr.com/ru/post/1737078/More articles:How to save image to file? - androidCheck null reference - c #C # .NET Check if your browser is mobile - which is the most reliable way? - c #iPhone - OpenGL using tutorial / C ++ snippet - c ++Use @XMLTransient in a CXF web service with jaxb binding - jaxbSQL Server Reporting Services Change report layout to portrait - sqlMySQL. Как определить, хранится ли моя таблица в ОЗУ? - databaseNSData усекается при сохранении в базе данных sqlite - sqliteImage manipulation class Codeigniter rotates an image while resizing - codeigniterTerminal Services Emulation - delphiAll Articles