Record · corpus.blog/posts/01a087a2-c2da-7319-afde-94b6cd6d134f

Code Smell 321 - Getter Piggybacking

maximilianocontieri.com · published 20 August 2026

A record is what was published and who pointed at it. The text of the post is not held here: read it at the source, or at its Wayback capture.

0blogs citing
First cited
—
Most recent
—
Rank this month
not ranked
Links from this post
37
Words captured
1,053

Cited by

No blog we hold has cited this post yet.

Links from this post

Link
Host
chat.openai.com
https://chat.openai.com/?q=Move+the+comparison+logic+from+external+functions+into+a+real+method+on+the+object+so+callers+stop+reimplementing+it+from+the+getter%3A+%60%60%60javascript%0D%0A%2F%2F+Food+needs+to+show+its+use-by+date+on+the+shelf%0D%0A%2F%2F+label%2C+so+useByDate%28%29+exists+for+that+one+reason.%0D%0A%2F%2F%0D%0A%2F%2F+Later%2C+removeExpiredFood%28%29+needs+to+pull+expired%0D%0A%2F%2F+products%2C+so+it+reuses+useByDate%28%29+and+compares+the%0D%0A%2F%2F+result+to+today+itself%2C+outside+Food.%0D%0A%2F%2F%0D%0A%2F%2F+flagNearExpiryFood%28%29+needs+almost+the+same+check%2C+so%0D%0A%2F%2F+it+also+calls+useByDate%28%29+and+writes+its+own+slightly%0D%0A%2F%2F+different+comparison.%0D%0A%2F%2F%0D%0A%2F%2F+Now+two+functions+decide+what+%22expired%22+means%2C+and%0D%0A%2F%2F+neither+of+them+is+Food.%0D%0Aclass+Food+%7B%0D%0A++constructor%28name%2C+useByDate%29+%7B%0D%0A++++this.name+%3D+name%3B%0D%0A++++this.useByDateValue+%3D+useByDate%3B%0D%0A++%7D%0D%0A%0D%0A++useByDate%28%29+%7B%0D%0A++++return+this.useByDateValue%3B%0D%0A++%7D%0D%0A%7D%0D%0A%0D%0Afunction+removeExpiredFood%28shelf%2C+today%29+%7B%0D%0A++return+shelf.filter%28%0D%0A++++food+%3D%3E+food.useByDate%28%29+%3E%3D+today%0D%0A++%29%3B%0D%0A%7D%0D%0A%0D%0Afunction+flagNearExpiryFood%28%0D%0A++shelf%2C+today%2C+warningDays%0D%0A%29+%7B%0D%0A++return+shelf.filter%28food+%3D%3E+%7B%0D%0A++++const+daysLeft+%3D+daysBetween%28%0D%0A++++++food.useByDate%28%29%2C+today%0D%0A++++%29%3B%0D%0A++++return+daysLeft+%3E%3D+0+%26%26%0D%0A++++++daysLeft+%3C%3D+warningDays%3B%0D%0A++%7D%29%3B%0D%0A%7D%0D%0A%60%60%60
chat.openai.com
https://claude.ai/new?q=Move+the+comparison+logic+from+external+functions+into+a+real+method+on+the+object+so+callers+stop+reimplementing+it+from+the+getter%3A+%60%60%60javascript%0D%0A%2F%2F+Food+needs+to+show+its+use-by+date+on+the+shelf%0D%0A%2F%2F+label%2C+so+useByDate%28%29+exists+for+that+one+reason.%0D%0A%2F%2F%0D%0A%2F%2F+Later%2C+removeExpiredFood%28%29+needs+to+pull+expired%0D%0A%2F%2F+products%2C+so+it+reuses+useByDate%28%29+and+compares+the%0D%0A%2F%2F+result+to+today+itself%2C+outside+Food.%0D%0A%2F%2F%0D%0A%2F%2F+flagNearExpiryFood%28%29+needs+almost+the+same+check%2C+so%0D%0A%2F%2F+it+also+calls+useByDate%28%29+and+writes+its+own+slightly%0D%0A%2F%2F+different+comparison.%0D%0A%2F%2F%0D%0A%2F%2F+Now+two+functions+decide+what+%22expired%22+means%2C+and%0D%0A%2F%2F+neither+of+them+is+Food.%0D%0Aclass+Food+%7B%0D%0A++constructor%28name%2C+useByDate%29+%7B%0D%0A++++this.name+%3D+name%3B%0D%0A++++this.useByDateValue+%3D+useByDate%3B%0D%0A++%7D%0D%0A%0D%0A++useByDate%28%29+%7B%0D%0A++++return+this.useByDateValue%3B%0D%0A++%7D%0D%0A%7D%0D%0A%0D%0Afunction+removeExpiredFood%28shelf%2C+today%29+%7B%0D%0A++return+shelf.filter%28%0D%0A++++food+%3D%3E+food.useByDate%28%29+%3E%3D+today%0D%0A++%29%3B%0D%0A%7D%0D%0A%0D%0Afunction+flagNearExpiryFood%28%0D%0A++shelf%2C+today%2C+warningDays%0D%0A%29+%7B%0D%0A++return+shelf.filter%28food+%3D%3E+%7B%0D%0A++++const+daysLeft+%3D+daysBetween%28%0D%0A++++++food.useByDate%28%29%2C+today%0D%0A++++%29%3B%0D%0A++++return+daysLeft+%3E%3D+0+%26%26%0D%0A++++++daysLeft+%3C%3D+warningDays%3B%0D%0A++%7D%29%3B%0D%0A%7D%0D%0A%60%60%60
claude.ai
perplexity.ai
https://www.perplexity.ai/?q=Move+the+comparison+logic+from+external+functions+into+a+real+method+on+the+object+so+callers+stop+reimplementing+it+from+the+getter%3A+%60%60%60javascript%0D%0A%2F%2F+Food+needs+to+show+its+use-by+date+on+the+shelf%0D%0A%2F%2F+label%2C+so+useByDate%28%29+exists+for+that+one+reason.%0D%0A%2F%2F%0D%0A%2F%2F+Later%2C+removeExpiredFood%28%29+needs+to+pull+expired%0D%0A%2F%2F+products%2C+so+it+reuses+useByDate%28%29+and+compares+the%0D%0A%2F%2F+result+to+today+itself%2C+outside+Food.%0D%0A%2F%2F%0D%0A%2F%2F+flagNearExpiryFood%28%29+needs+almost+the+same+check%2C+so%0D%0A%2F%2F+it+also+calls+useByDate%28%29+and+writes+its+own+slightly%0D%0A%2F%2F+different+comparison.%0D%0A%2F%2F%0D%0A%2F%2F+Now+two+functions+decide+what+%22expired%22+means%2C+and%0D%0A%2F%2F+neither+of+them+is+Food.%0D%0Aclass+Food+%7B%0D%0A++constructor%28name%2C+useByDate%29+%7B%0D%0A++++this.name+%3D+name%3B%0D%0A++++this.useByDateValue+%3D+useByDate%3B%0D%0A++%7D%0D%0A%0D%0A++useByDate%28%29+%7B%0D%0A++++return+this.useByDateValue%3B%0D%0A++%7D%0D%0A%7D%0D%0A%0D%0Afunction+removeExpiredFood%28shelf%2C+today%29+%7B%0D%0A++return+shelf.filter%28%0D%0A++++food+%3D%3E+food.useByDate%28%29+%3E%3D+today%0D%0A++%29%3B%0D%0A%7D%0D%0A%0D%0Afunction+flagNearExpiryFood%28%0D%0A++shelf%2C+today%2C+warningDays%0D%0A%29+%7B%0D%0A++return+shelf.filter%28food+%3D%3E+%7B%0D%0A++++const+daysLeft+%3D+daysBetween%28%0D%0A++++++food.useByDate%28%29%2C+today%0D%0A++++%29%3B%0D%0A++++return+daysLeft+%3E%3D+0+%26%26%0D%0A++++++daysLeft+%3C%3D+warningDays%3B%0D%0A++%7D%29%3B%0D%0A%7D%0D%0A%60%60%60
perplexity.ai
https://www.bing.com/chat?showconv=1&sendquery=1&q=Correct+and+explain+this+code%3A+%60%60%60javascript%0D%0A%2F%2F+Food+needs+to+show+its+use-by+date+on+the+shelf%0D%0A%2F%2F+label%2C+so+useByDate%28%29+exists+for+that+one+reason.%0D%0A%2F%2F%0D%0A%2F%2F+Later%2C+removeExpiredFood%28%29+needs+to+pull+expired%0D%0A%2F%2F+products%2C+so+it+reuses+useByDate%28%29+and+compares+the%0D%0A%2F%2F+result+to+today+itself%2C+outside+Food.%0D%0A%2F%2F%0D%0A%2F%2F+flagNearExpiryFood%28%29+needs+almost+the+same+check%2C+so%0D%0A%2F%2F+it+also+calls+useByDate%28%29+and+writes+its+own+slightly%0D%0A%2F%2F+different+comparison.%0D%0A%2F%2F%0D%0A%2F%2F+Now+two+functions+decide+what+%22expired%22+means%2C+and%0D%0A%2F%2F+neither+of+them+is+Food.%0D%0Aclass+Food+%7B%0D%0A++constructor%28name%2C+useByDate%29+%7B%0D%0A++++this.name+%3D+name%3B%0D%0A++++this.useByDateValue+%3D+useByDate%3B%0D%0A++%7D%0D%0A%0D%0A++useByDate%28%29+%7B%0D%0A++++return+this.useByDateValue%3B%0D%0A++%7D%0D%0A%7D%0D%0A%0D%0Afunction+removeExpiredFood%28shelf%2C+today%29+%7B%0D%0A++return+shelf.filter%28%0D%0A++++food+%3D%3E+food.useByDate%28%29+%3E%3D+today%0D%0A++%29%3B%0D%0A%7D%0D%0A%0D%0Afunction+flagNearExpiryFood%28%0D%0A++shelf%2C+today%2C+warningDays%0D%0A%29+%7B%0D%0A++return+shelf.filter%28food+%3D%3E+%7B%0D%0A++++const+daysLeft+%3D+daysBetween%28%0D%0A++++++food.useByDate%28%29%2C+today%0D%0A++++%29%3B%0D%0A++++return+daysLeft+%3E%3D+0+%26%26%0D%0A++++++daysLeft+%3C%3D+warningDays%3B%0D%0A++%7D%29%3B%0D%0A%7D%0D%0A%60%60%60
bing.com
https://www.bing.com/chat?showconv=1&sendquery=1&q=Move+the+comparison+logic+from+external+functions+into+a+real+method+on+the+object+so+callers+stop+reimplementing+it+from+the+getter%3A+%60%60%60javascript%0D%0A%2F%2F+Food+needs+to+show+its+use-by+date+on+the+shelf%0D%0A%2F%2F+label%2C+so+useByDate%28%29+exists+for+that+one+reason.%0D%0A%2F%2F%0D%0A%2F%2F+Later%2C+removeExpiredFood%28%29+needs+to+pull+expired%0D%0A%2F%2F+products%2C+so+it+reuses+useByDate%28%29+and+compares+the%0D%0A%2F%2F+result+to+today+itself%2C+outside+Food.%0D%0A%2F%2F%0D%0A%2F%2F+flagNearExpiryFood%28%29+needs+almost+the+same+check%2C+so%0D%0A%2F%2F+it+also+calls+useByDate%28%29+and+writes+its+own+slightly%0D%0A%2F%2F+different+comparison.%0D%0A%2F%2F%0D%0A%2F%2F+Now+two+functions+decide+what+%22expired%22+means%2C+and%0D%0A%2F%2F+neither+of+them+is+Food.%0D%0Aclass+Food+%7B%0D%0A++constructor%28name%2C+useByDate%29+%7B%0D%0A++++this.name+%3D+name%3B%0D%0A++++this.useByDateValue+%3D+useByDate%3B%0D%0A++%7D%0D%0A%0D%0A++useByDate%28%29+%7B%0D%0A++++return+this.useByDateValue%3B%0D%0A++%7D%0D%0A%7D%0D%0A%0D%0Afunction+removeExpiredFood%28shelf%2C+today%29+%7B%0D%0A++return+shelf.filter%28%0D%0A++++food+%3D%3E+food.useByDate%28%29+%3E%3D+today%0D%0A++%29%3B%0D%0A%7D%0D%0A%0D%0Afunction+flagNearExpiryFood%28%0D%0A++shelf%2C+today%2C+warningDays%0D%0A%29+%7B%0D%0A++return+shelf.filter%28food+%3D%3E+%7B%0D%0A++++const+daysLeft+%3D+daysBetween%28%0D%0A++++++food.useByDate%28%29%2C+today%0D%0A++++%29%3B%0D%0A++++return+daysLeft+%3E%3D+0+%26%26%0D%0A++++++daysLeft+%3C%3D+warningDays%3B%0D%0A++%7D%29%3B%0D%0A%7D%0D%0A%60%60%60
bing.com
https://you.com/search?q=Move+the+comparison+logic+from+external+functions+into+a+real+method+on+the+object+so+callers+stop+reimplementing+it+from+the+getter%3A+%60%60%60javascript%0D%0A%2F%2F+Food+needs+to+show+its+use-by+date+on+the+shelf%0D%0A%2F%2F+label%2C+so+useByDate%28%29+exists+for+that+one+reason.%0D%0A%2F%2F%0D%0A%2F%2F+Later%2C+removeExpiredFood%28%29+needs+to+pull+expired%0D%0A%2F%2F+products%2C+so+it+reuses+useByDate%28%29+and+compares+the%0D%0A%2F%2F+result+to+today+itself%2C+outside+Food.%0D%0A%2F%2F%0D%0A%2F%2F+flagNearExpiryFood%28%29+needs+almost+the+same+check%2C+so%0D%0A%2F%2F+it+also+calls+useByDate%28%29+and+writes+its+own+slightly%0D%0A%2F%2F+different+comparison.%0D%0A%2F%2F%0D%0A%2F%2F+Now+two+functions+decide+what+%22expired%22+means%2C+and%0D%0A%2F%2F+neither+of+them+is+Food.%0D%0Aclass+Food+%7B%0D%0A++constructor%28name%2C+useByDate%29+%7B%0D%0A++++this.name+%3D+name%3B%0D%0A++++this.useByDateValue+%3D+useByDate%3B%0D%0A++%7D%0D%0A%0D%0A++useByDate%28%29+%7B%0D%0A++++return+this.useByDateValue%3B%0D%0A++%7D%0D%0A%7D%0D%0A%0D%0Afunction+removeExpiredFood%28shelf%2C+today%29+%7B%0D%0A++return+shelf.filter%28%0D%0A++++food+%3D%3E+food.useByDate%28%29+%3E%3D+today%0D%0A++%29%3B%0D%0A%7D%0D%0A%0D%0Afunction+flagNearExpiryFood%28%0D%0A++shelf%2C+today%2C+warningDays%0D%0A%29+%7B%0D%0A++return+shelf.filter%28food+%3D%3E+%7B%0D%0A++++const+daysLeft+%3D+daysBetween%28%0D%0A++++++food.useByDate%28%29%2C+today%0D%0A++++%29%3B%0D%0A++++return+daysLeft+%3E%3D+0+%26%26%0D%0A++++++daysLeft+%3C%3D+warningDays%3B%0D%0A++%7D%29%3B%0D%0A%7D%0D%0A%60%60%60
you.com