D
D
Denis Bredun2020-07-01 23:30:34
Algorithms
Denis Bredun, 2020-07-01 23:30:34

Readability of the code or speed of its execution?

Dear Khabrachans, please tell me, when writing a project, what should I pay more attention to, the readability of the code (if other programmers will work with it) or the speed of execution? The question is not only about the choice of recursion and cycles, but also in general, when writing any project.
That's where the question comes from: recursion is slower, but it's more readable than a loop, which is faster than recursion.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2020-07-01
@Luffy1

That's where the question comes from: recursion is slower, but it's more readable than a loop, which is faster than recursion.
Thank you, neighing)
Better - learn the operations of early exit from the "whirlwind" of recursion.
1. Code readability - determined by its architecture.
2. Speed ​​of execution - by a correctly chosen algorithm for a specific task and the number of operations for dynamic work with memory: memory allocation for objects, variables, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question