Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convoluted code of the week award.
Message
De
20/02/2010 09:20:07
 
 
À
20/02/2010 07:48:49
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01449951
Message ID:
01450041
Vues:
34
>>>>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 ?
>>>
>>>All looks very maintainable. (head in hands)
>>
>>That code won't need maintenance! Solid as a brick s**thouse! Of course that may also say something about the output :-{
>
>The output.
>
>Reminds me many years ago maintaining a batch Cobol application that produced a very large paper report on BT (then post office) pay
>
>I'd been looking after it for about a year when the user/customer called up and asked what we wanted them to do with all this printout that we kept sending them.

ROFL. I assume you told them that it was essential to store it carefully......
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform