«« Next » « Previous
«« Next » « Previous

Link Details

Announcement

iPhone DZone: Fresh Links On Your iPhone by matt at Sat Jul 05 14:09:51 EDT 2008

Reading DZone on your iPhone just got a little bit easier. Visit http://dzone.com/iphone from your iPhone to try out our beta iPhone support. You can view stories, filter by tags, and login. We'd appreciate your feedback at feedback@dzone.com.

If you want it done right, do it yourself! Login and vote now.
Link 77635 thumbnail

By ksh2dzone
via hcoding.blogspot.com
Submitted: Apr 25 2008 / 07:45

It has happened in coding C#, for sure, that we wanted to return more than just a value from a method. Simplest way is to define a new type that contains necessary information and return one instance of it from our method. Also we can use out (or ref) arguments which provides us a mechanism for observing some result more than just returning value of a method. Another more clean way is to use tuples. In F# we have them naturally in language level but in C# we must have an implementation of them and the implementation will be uglier than what it looks like in F#. This way in C# is very like the first one except we use a type with specific names for it's properties...
  • 1
  • 1
  • 141
  • 26

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (1)



Voters Against This Link (1)