Method Syntax - functional programm !?

Public forum to share code snippets, screen shorts, experiences, etc.
Post Reply
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

Method Syntax - functional programm !?

Post by Phil Hepburn »

Hi Nick, (and all)

When you use Method Syntax (with Lambda Expressions) in your big app, do you think it is like Functional Programming ?

Does each successive method take as input the exact output from the previous method ?

It would seem to me that some of the formats of the 'Query Syntax' although it uses Method Syntax under the hood, it may also reorder the sugary query syntax to suit some unstated criteria.

I think the above may be more true / likely for "LINQ to SQL" and "LINQ to 'Entity'". Where the Order By clause always needs to be last in the SQL query statement, but can by other places in the LINQ query code line statement.

What do you do and what are your thoughts on this / these ideas ?

Regards,
Phil.
NickFriend
Posts: 248
Joined: Fri Oct 14, 2016 7:09 am

Method Syntax - functional programm !?

Post by NickFriend »

Hi Phil,

Not sure about how query syntax works internally, but with method syntax it's as you say, each method takes as it's input the output of the previous method (to the left) in the chain... so you start from the left and work to the right, and the last thing to occur on the right is the return value.

So you literally chain methods together to refine your data until you get to the result you want.

HTH

Nick
Post Reply