4 ms·
> How does that add value? Imagine 'x' is '(int)(aRec[RecIndex(p->handle)]->itemCountRef)' That's a gnarly code smell and a Law of Demeter[1] violation. I susp
by bonzoesc 14y ago
> How does that add value? Imagine 'x' is '(int)(aRec[RecIndex(p->handle)]->itemCountRef)'
That's a gnarly code smell and a Law of Demeter[1] violation. I suspect you could find a better way to express that operation without requiring that a single line of your code know so much about so many different things (aRec, aRec members, the return value of RecIndex, p, aRec member -> itemCountRef).
1: http://c2.com/cgi/wiki?LawOfDemeter http://c2.com/cgi/wiki?LawOfDemeter
- njs12345 14y agoI guess it still adds value (potentially? Maybe less so with IDEs and maybe not worth the language complexity tradeoff) if you use very long variable names, which do help somewhat with readability.
- Munksgaard 14y agoI think you're missing the point.
- bonzoesc 14y agoAm I? The language doesn't need to make affordances for bad code, bad code needs to be refactored into better code.
- JoeAltmaier 14y agoOh for heaven's sake, use some other complex reference then.