Anti-Patterns

Justin Tulk
2 min readOct 7, 2016

--

I’ve been thinking about anti-patterns in React, and that got me thinking about the concept of ‘anti-patterns’.

From Wikipedia:

1. A commonly used process, structure or pattern of action that despite initially appearing to be an appropriate and effective response to a problem, typically has more bad consequences than good ones

2. Another solution exists that is documented, repeatable and proven to be effective.

Most readily available software documentation (especially in the inchoate world of Javascript libraries and frameworks) seems to get stuck on the first part of the definition. A good example would be the whole ‘props in state’ anti-pattern I talk about in my other post. I’ve read the React documentation around that issue multiple times, I’ve watched/read/done a number of React tutorials, and I still ended up in a situation where the easiest course of action seemed to be setting state with the initial props.

And even now that I’m spending time thinking and researching this nearly every day, I still don’t have a solution worth blogging about yet. Furthermore, another Facebook library just sort of throws the towel in on this as well. I don’t mean to bash Draft.js unfairly here (rich content editing seems more complex the more I think about)- what I mean to say is that very quickly in building anything of value with inputs you run into cases where things become more complicated than just controlled vs. uncontrolled components.

I wish there was some way that people experimenting and blogging about code (especially specific framework and library issues) could be discoverable through meta-content associated with documentation. What if behind every page of software documentation there was some community-driven and community-editable Wiki-style page that information could be organized in? Something that would exist between the official documentation, Github issues pages, StackOverflow’s smoldering tire-fire, and the fragmentary ecosystem of individual blogs and Medium posts.

I would use the crap out of that.

— — — — — — — — — —

Aside: I never tire of the clever names people create. From Wikipedia’s list of ‘anti-patterns’:

  • Seagull management: Management in which managers only interact with employees when a problem arises, when they “fly in, make a lot of noise, dump on everyone, do not solve problem, then fly out”
  • Death march: A project whose staff, while expecting it to fail, are compelled to continue, often with much overwork, by management which is in denial

and my personal favorite:

  • Poltergeists: Objects whose sole purpose is to pass information to another object

--

--

Justin Tulk

Staff Software Engineer. Making computers do stuff since 2011.