Click here to Skip to main content
13,451,731 members (33,849 online)
Click here to Skip to main content
Add your own
alternative version


2 bookmarked
Posted 18 May 2012

The Elegant Art of Programming

, 21 May 2012
Rate this:
Please Sign up or sign in to vote.
This is an alternative for "The Elegant Art of Programming"


To resume what's the point, the solution should solve a simple problem in the most "elegant" way by using LINQ.

Check the orginial tip to get the point of this alternative Smile | :)

Using the code 

Well, reading the following code should be straightforward :
List<double> myList = new List<double>();
bool differs = (myList.Distinct().Count() > 1);
Console.WriteLine( "All numbers are " + (differs? "not": "") + " the same.");


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


About the Author

Guillaume Leparmentier
France France
IT consultant and Project Manager in Paris, specialized in software engineering/design.

He spends most of his time in meetings Smile | :)
He would love to have more time to develop all those ideas/concepts he has in mind.

You may also be interested in...

Comments and Discussions

GeneralMy vote of 1 Pin
azweepay21-May-12 3:58
memberazweepay21-May-12 3:58 
GeneralRe: My vote of 1 Pin
Guillaume Leparmentier21-May-12 5:12
memberGuillaume Leparmentier21-May-12 5:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180318.3 | Last Updated 21 May 2012
Article Copyright 2012 by Guillaume Leparmentier
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid