Anti Patterns - sgml/signature GitHub Wiki

Caching

  • Event based cache invalidation that fails silently

  • Time based cached invalidation that is not based on UTC

Unit Tests

  • Testing for specific strings rather than making sure key/value pairs are not undefined

  • Testing for numbers rather than boolean values

  • Testing for a specific date rather than an object that can be used by the date constructor

Annotations

https://blog.softwaremill.com/the-case-against-annotations-4b2fb170ed67

https://dzone.com/articles/java-annotations-are-a-big-mistake

https://www.oracle.com/technetwork/java/javase/9-notes-3745703.html

Components

https://mithril.js.org/components.html#avoid-anti-patterns

Partial Emulation

https://pythonrants.wordpress.com/2013/12/06/why-i-hate-virtualenv-and-pip/

https://cordova.apache.org/howto/2018/02/02/cordova-simulate.html

Lifecycle Callbacks

https://reactjs.org/blog/2015/12/16/ismounted-antipattern.html

https://americanexpress.io/faccs-are-an-antipattern/

https://cdb.reacttraining.com/use-a-render-prop-50de598f11ce

https://github.com/facebook/react/blob/master/packages/react-dom/src/__tests__/ReactDOM-test.js

Promises

https://www.w3.org/2001/tag/doc/promises-guide#when-not-to-use

https://www.w3.org/2011/04/webrtc/wiki/images/9/97/ModernWebRTC.pdf

String formatting

http://www.cse.psu.edu/~trj1/cse544-f15/docs/aeg-current.pdf

Object-Relational Mappers

https://www.tonymarston.net/php-mysql/object-relational-mappers-are-evil.html

http://www.scielo.org.co/pdf/rfiua/n80/0120-6230-rfiua-80-00097.pdf

Middleware

https://blog.jooq.org/2014/09/12/why-you-should-not-implement-layered-architecture/

Code Generation

https://blog.rapid7.com/2016/06/23/r7-2016-06-remote-code-execution-via-swagger-parameter-injection-cve-2016-5641/

Recovery from Exceptions

https://en.wikipedia.org/wiki/Coding_by_exception

https://softwareengineering.stackexchange.com/questions/118788/is-using-nested-try-catch-blocks-an-anti-pattern

SQL Antipatterns

https://doc.lagout.org/programmation/Pragmatic%20Programmers/SQL%20Antipatterns.pdf

Dependency Injection

Dependency injection is not effective if:

  • You will never need a different implementation.

  • You will never need a different configuration.

If you know you will never change the implementation or configuration of some dependency, there is no benefit in using dependency injection.

https://r.je/oop-courier-anti-pattern

Templating

Decouple computations from conditional logic. For example, instead of:

<xsl:if test="name() = 'foo'"> 

Do:

<xsl:variable name="cname" select="name() = 'foo'"/>
<xsl:if test="$cname">

Domain Driven Design

I do not have to spend time in writing code to validate user input before its gets written to the database as that is handled by a standard framework component which matches each column's value with its data type which was exported from the Data Dictionary.

I do not have to spend time in designing mechanisms to handle domain-specific logic as the methods inherited from the abstract table class already implement the Template Method Pattern by providing a series of invariant methods with concrete implementations interspersed with empty hook methods into which the developer can insert custom logic.

I do not have to spend time in designing custom Controllers which call methods which are specific to individual Model classes as the framework provides a series of reusable Controllers each of which calls generic public methods which are defined in the abstract table class. There is a different Controller provided for each Transaction Pattern. This design allows me to pair any Controller with any Model/Table class.

Each event/task within the application performs a series of operations on a database table, and as there are different tasks which perform identical operations on different database tables I have managed to encapsulate the common code into a series of reusable Transaction Patterns. A facility within my Data Dictionary allows tasks to be generated by linking a particular table class with a particular pattern.

References

https://www.xml.com/pub/a/2003/07/02/xslt2.html

https://courses.ischool.berkeley.edu/i290-14/s05/lecture-5/allslides.html

http://www.microhowto.info/howto/refer_to_the_value_of_a_stylesheet_parameter_in_xslt.html

http://rcpconsulting.biz/whwItKb.html

Cargo Culting

https://www.slideshare.net/BarryOSullivan18/design-patterns-the-good-the-bad-and-the-antipattern

https://news.ycombinator.com/item?id=4549544

https://blog.frankel.ch/are-you-guilty-of-overengineering/

UX

Infinite Scroll

https://www.smashingmagazine.com/2016/03/pagination-infinite-scrolling-load-more-buttons/

https://logrocket.com/blog/infinite-scroll/

https://www.justinmind.com/blog/4-ux-friendly-alternatives-to-infinite-scroll/

https://uxplanet.org/ux-infinite-scrolling-vs-pagination-1030d29376f1

https://ux.stackexchange.com/questions/106514/should-i-use-regular-pagination-or-infinite-scroll-in-this-case

https://ux.stackexchange.com/questions/33406/infinite-scroll-vs-pagination-in-e-commerce-websites

https://news.ycombinator.com/item?id=7048474

https://www.reddit.com/r/userexperience/comments/8d1ajo/why_doesnt_google_implement_infinite_scroll_to/

ACID

Decouple operations into separate mutations to mitigate timeout issues