fbpx
Welcome, Guest
Username: Password: Remember me
Share your code snippets, screen shots etc. here
  • Page:
  • 1

TOPIC: Method Syntax - functional programm !?

Method Syntax - functional programm !? 2 years 7 months ago #550

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
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.

Please Log in or Create an account to join the conversation.

Method Syntax - functional programm !? 2 years 7 months ago #551

  NickFriend's Avatar NickFriend Offline Posts: 184
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

Please Log in or Create an account to join the conversation.

  • Page:
  • 1