Most of the time during coding, i found that whether i can write code in less number of line.
I don’t know when we write some login in less number of line in c# then whether we achive good performance or not? whether dotnet compiler compile code faster or not?
Is there any source of tutorial/ book/ guideline so that we will make checklist before writing code.
What we should consider is writing better codes that other people can understand, declaring better variable names, maintain structure and design.
Of course we can write a login in 3 lines of code. Does that means compiler can compile/run it faster? Well, we should keep in mind that now-a-days compilers are extremely smart. Writing small number of lines of code doesn’t prove that we’re smart. And it also doesn’t make sense compiler will compile faster.
Compilers optimizes our code to bytecodes very well and hence we should consider writing code considering designs and principles and of course human can understand the code as self code documented.
Here I quote what Martin Fowler said:
Hope this helps!
With Regards,
Munim