Click here to Skip to main content

The Weird and The Wonderful


The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrasing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

GeneralRe: Over-documentation PinprofessionalPIEBALDconsult17-Nov-13 6:26 
GeneralRe: Over-documentation PinprotectorOriginalGriff17-Nov-13 6:42 
GeneralRe: Over-documentation PinmemberMax Methot28-Nov-13 6:01 
GeneralRe: Over-documentation PinprofessionalPIEBALDconsult28-Nov-13 6:45 
GeneralRe: Over-documentation PinmemberSander Rossel17-Nov-13 1:09 
GeneralRe: Over-documentation PinprofessionalRon Beyer17-Nov-13 6:21 
GeneralRe: Over-documentation PinmemberSander Rossel17-Nov-13 7:54 
GeneralRe: Over-documentation [modified] PinmemberENOTTY18-Nov-13 6:24 
In general, I agree with you, the exception being concise^Wtoo clever for their own good LINQ expressions like these:
' enumerate Future Queries (go to DB in one request), put resulting KatalogIds into HashSets
Dim katalogErrorResults As Dictionary(Of KatalogErrorType, HashSet(Of Int32?))
katalogErrorResults = katalogErrorFutures _
	.AsEnumerable() _
	.Select(Function(katErr) _
	New KeyValuePair(Of KatalogErrorType, HashSet(Of Int32?)) _
		 (katErr.Key, katErr.Value.ToHashSet)) _
		  .ToDictionary(Of KatalogErrorType, HashSet(Of Int32?)) _
		 (Function(kvp) kvp.Key, Function(kvp) kvp.Value, katalogErrorTypeComparer)
' transform results to Dictionary(Of Int32?, KatalogErrorDTO)
Return katalogeIds.ToDictionary(
	Function(sourceKatId) sourceKatId,
	Function(sourceKatId) New KatalogErrorDTO() With { _
	.ArtikelNummerPrefix = artikelNummerPrefix,
	.SearchQuery = searchquery,
	.Errors = [Enum].GetValues(GetType(KatalogErrorType)) _
		  .Cast(Of KatalogErrorType) _
		  .ToDictionary(Function(kErrorType) kErrorType, _
                                Function(kErrorType) katalogErrorResults(kErrorType) _
                                                         .Contains(sourceKatId)) _

modified 18-Nov-13 11:32am.

GeneralRe: Over-documentation PinprofessionalRon Beyer18-Nov-13 6:41 
GeneralRe: Over-documentation Pinmember d@nish 17-Nov-13 7:20 
GeneralRe: Over-documentation PinprofessionalRon Beyer17-Nov-13 7:55 
GeneralRe: Over-documentation PinprofessionalBernhard Hiller18-Nov-13 0:01 
GeneralRe: Over-documentation PinmemberENOTTY18-Nov-13 6:05 
GeneralRe: Over-documentation PinmvpCPallini18-Nov-13 8:39 
GeneralRe: Over-documentation PinprotectorMarc Clifton19-Nov-13 9:24 
GeneralRe: Over-documentation PinmemberStewart Judson20-Nov-13 1:49 
GeneralRe: Over-documentation PinprofessionalRon Beyer20-Nov-13 4:08 
GeneralRe: Over-documentation Pinmembers_mon25-Nov-13 10:56 
GeneralRe: Over-documentation PinmemberRob Grainger28-Nov-13 23:26 
GeneralRe: Over-documentation PinmemberVasudevan Deepak Kumar29-Nov-13 2:54 
GeneralAbsolutely necessary Pinmemberimagiro16-Dec-13 0:00 
GeneralRe: Over-documentation PinmemberJacek Gajek27-Dec-13 2:05 
GeneralVS Go BOOM! PinprofessionalBrisingr Aerowing15-Nov-13 13:54 
GeneralRe: VS Go BOOM! PinprotectorDaveAuld15-Nov-13 21:38 
GeneralRe: VS Go BOOM! Pinmemberdevvvy16-Nov-13 23:51 

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

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

Advertise | Privacy | Mobile
Web02 | 2.8.150327.1 | Last Updated 31 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid