+ 12
How can i choose the best code, between comparing two codes?????
9 Réponses
+ 6
There are a lot of factors you could compare them for.
Performance would be one. Readability. Efficiency. Maintainability. Safety. Quickwritability (I made that one up.)
Countless books have been written about it.
You probably have to decide that on a case-by-case basis, comparing two specific programs, and even then it would be a long discussion with differing opinions.
+ 5
You can compare them on the basis of time and space complexities of the programs.
+ 4
Thank u
+ 2
U have to consider the time , style and your soul's favouracy
0
The best answer would be on two cases.
1.
Based on whether the code has flexibility or not.
What I mean is, if you want to edit or other wants to access it later, will it be easier for them to access it ?
And if yes, then go for that.
2.
This is important as your code should be DRY principle based. Meaning:
Don't repeat yourself.
So the choice you made must be short and non-repeating.
Thanks.
0
It depends on the outcome you expect in my view.
Do you want fast, easy-to-read code or high quality? And so on..
There are many factors, and each code has its advantages and disadvantages, and it has something that distinguishes it from other codes.
So, before you do the comparison essentially, you have to choose the feature you want and make it a basis for comparison :)
0
The best code for any problem statement is - DRY
Don't Repeat Yourself.
Voila ! Yr code is a masterpiece.
- 2
You can compare them on the basis of time and space complexities of the programs.
- 7
Mohammad Yahya Azhar Please do not copy paste existing answers.