Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convoluted code of the week award.
Message
 
 
À
19/02/2010 13:41:27
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01449951
Message ID:
01450000
Vues:
58
>Just doing an end of week code review and trying to decide which of these two lines of code should get the 'most obscure line of the week' award'?
int? i = (int?)(from LLLabel s in sheetCanvas.Children where s.Id == l.Id select s)
>                .Max(x => x.GetValue(CMProp.StampIndexProperty));
or
var v = s.Split(new Char[] { ' ' }).Select(x => x).Where(x => x.Length > 0);
I sort of like the first one - nullable type, a bit of Linq, an extension method using a lambda expression with an attached dependency property - but the last bit is WPF specfic so perhaps shouldn't count.
>
>Actually this doesn't have to be an 'in house' award - anyone else want to enter ?

Great stuff!

One of the C magazines (C++ Journal?) used to have a monthly column near the back called Obfuscated C. Stuff like this every month. The challenge was to figure out what the heck the code did.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform