Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Ideally, how many lines of code (max) should be written in a Linq/Lambda expression?



Thanks!
Posted
Updated 13-May-13 22:56pm
v2

In keeping with the warmth and fuzziness of functional programming, your code should be only as large as it needs to be, or in other words your linq expression should be as succinct as possible. If it isn't, split it up into a number of expressions.

ATG
 
Share this answer
 
Comments
Mohammed Hameed 18-May-13 1:34am    
Thanks Andre for your reply. +4 for your solution. But sorry I need some more information if possible.
Andre T.G. 18-May-13 2:09am    
I don't think there is a precisely integral answer to your question... if your linq expression was to be compiled into an external assembly, then theoretically it could be as large as that could fit under the ceiling of addressable memory limit for your platform.... or it could be 42.

ATG
 
Share this answer
 
v2
Comments
Mohammed Hameed 14-May-13 3:43am    
I have asked for best practices in Linq.
[no name] 14-May-13 3:46am    
i have updated the answer...please check the last 3 links...
Mohammed Hameed 14-May-13 3:57am    
Those links also not answer my question.
[no name] 14-May-13 3:58am    
Then elaborate your question to get better solution...
Mohammed Hameed 14-May-13 4:56am    
Question modified slightly, plz check.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900