9 ms·
Anti Patterns Catalog
- ThePhysicist 10y agoWe published a small collection of Python-related anti-patterns a while ago under a creative commons license, feel free to check it out: http://docs.quantifiedcode.com/python-code-patterns/ http://docs.quantifiedcode.com/python-code-patterns/
- cakebrewery 10y agoAre those also considered anti-patterns, or simply "bad practices"? The examples in the article seem to have a wider scale than the ones mentioned in your collection. My question is, where is the line the line between an anti-pattern or simply a "bad practice", or if they are the same?
- drivers99 10y agoanti-pattern would be: "commonly reinvented bad solution to a recurring problem" (paraphrasing wikipedia)
- webmaven 10y agoAnti-patterns can be copied as well as reinvented. Also, some can manifest simply through developers' inattention rather than being a deliberate reinvention, such as: * Big Ball of Mud * Creeping featuritis * Copy Pasta
- deleted 10y ago[deleted]
- paulddraper 10y agoThere's patterns and then there's design patterns. The latter is more high-level, as you're thinking.
- ThePhysicist 10y agoProbably more bad practice by that definition, though for me the two concepts are very similar. I think the original article aimed more at process and large scale patterns, where our book aims more at small scale patterns.
- lvs 10y agoAt the risk of significant downvoting, it's important for HNers to realize that all their little named terms for the Blah-Blah Effect and so forth are a lot like the early days of psychology and related fields. More often than not, these named effects and "patterns" are data-free and mechanism-free attempts model human behavior into a science arising from little more than lay observation and anecdote. These attempts should be considered no more intellectually authoritative and citable than what a guy tells you from an airport bar stool.
- beat 10y agoWell, actually... Antipatterns are on rather firmer academic ground than the guy at the airport barstool. Antipatterns are simply a negative version of design patterns. Design patterns in software started with the book Design Patterns: Elements of Reusable Object Oriented Software (aka Gang of Four or GoF), one of the greatest classic works in software engineering. GoF was itself based on the book A Pattern Language, by Christopher Alexander, a classic of the architectural field. Alexander came up with the idea of a "pattern language" to describe patterns in architecture, a formal structure for observable phenomena. The GoF reused pattern language in a formal way to describe software patterns. Part of the pattern language describes how to implement the pattern. Antipatterns first appeared in the book Antipatterns: Refactoring Software, Architectures, and Projects in Crisis. Again, pattern language was used, including patterns for solving the problems caused by the antipattern. So yes, this is rigorous. Not math-rigorous, but rigorous.
- qwertyuiop924 10y agoHowever, it should be noted that Design Patterns as we know them have very little to do with those described by Alexander: They are the same in name only.
- beat 10y agoThe structure for describing patterns is the same.
- lvs 10y ago
- janwillemb 10y agoThe wiki is very slow since the upgrade.
- al2o3cr 10y agoAt least it works now. There was a hot minute there where they'd decided that the `fetch` API was a required feature and didn't polyfill it, totally breaking the site in browsers that lacked the feature.
- paulddraper 10y agoAnti-pattern: GasolinePoweredFlySwatter Reaching for heavy and complex tools when a straightforward solution would have sufficed. Example: Requiring JavaScript for a simple static site. Making a wiki as an SPA.
- deleted 10y ago[deleted]
- joncp 10y agoCame here to say this. Does anyone know whether there's an effort to port this to a sane wiki system?
- mmwtsn 10y agoIt sounds like the wiki was rewritten recently as a single page app which is what is causing the slowdown. See https://github.com/WardCunningham/remodeling#remodeling https://github.com/WardCunningham/remodeling#remodeling which is linked from the footer of the wiki.
- webmaven 10y agoPart of Ward Cunningham's roadmap is to make mirroring (even to other wiki implementations) much easier. That said, given that he's the original inventor of the wiki, I'd say he's earned a bit of patience on our part. Let's wait and see where he's going with these ideas (some of which are: federation, bi-directional linking between wikis, forking & merging, transclusion, etc.), a bit longer before contemplating setting up a "classic" wiki with this content.
- imode 10y agohttp://imode.gitlab.io/projects/c2/index.html http://imode.gitlab.io/projects/c2/index.html here's a dump of the entire wiki in WikiWikiWeb markup. if you can do anything with it, let me know.
- vmorgulis 10y agoWhat do you think of Pandoc? http://pandoc.org/ http://pandoc.org/ The two supported wiki markups: - MediaWiki https://www.mediawiki.org/wiki/Help:Formatting https://www.mediawiki.org/wiki/Help:Formatting - TWiki http://twiki.org/cgi-bin/view/TWiki/TextFormattingRules http://twiki.org/cgi-bin/view/TWiki/TextFormattingRules I wonder which one is the closest to WikiWikiWeb syntax. Another cool stuff would be to put that in the gopherspace.
- tedunangst 10y agohttp://wiki.c2.com/?PassingNullsToConstructors http://wiki.c2.com/?PassingNullsToConstructors Is it even worth having such pages in a wiki? Is this a catalog of antipatterns or empty templates?
- ccvannorman 10y agoI don't know which is funnier, the inaccessibility of the "anti-pattern" website in general which is bitching about inaccessibility of applications, or the fact that the 'constructor' (loosely) for serving you that page is clearly 'null'~
- twistedpair 10y agoWhat's NULL? Switch to the pure FP world. Haven't had a NPE in years, because we never create/pass/consume NULL.
- justicezyx 10y agoMy experience shows that almost all GoF design patterns, except singleton, are not useful at all in writing modern C++ software. The singleton is really just about a language trick, it hardly means anything more than a global variable fit into C++'s class hierarchy. I've been writing C++ in the past 1.5 years. All I have saw is design patterns being used forcefully and awkwardly. And there has not been a single instance where a pattern is used and improves the overall quality. Such practices result into closely coupled class webs, which is hostile to testing, extremely difficult to understand and change; the worst, they easily causes circular dependency, which was once considered a norm in C++ code. They also result into overengineerred interfaces, which gradually morphed into a "DoEverything" interface, like DoEverything(ActionOptions, RuntimeEnvironment). ActionOptions literally captures every options you can have on anything; and RuntimeEnvironment includes all data for the action to happen. IMHO, C++ code is about as good as it can be, when it manages to achieve 2 things: 1. DAG in translation unit dependency. 2. Predominantly prefer composition to inheritance. Plus, class access control (private/protected), and anonymous namespace should not be used to hide your implementation. That makes writing tests way too troublesome. And TBH, no one wants to abuse implementation details, unless the interface is bad or no comprehensive tests.
- novembermike 10y agoI never really got the whole public/private thing. If you want to only expose certain functionalities, that's what the interface does. Making things private just hides things that are potentially nice hooks for testing or whatever.
- khedoros1 10y agoThe assumption is that your public members are your interface. Anything private is an internal implementation detail, possibly subject to future change or replacement. Thorough testing of the public methods should end up calling all of the private methods. Of course, that's a best case scenario. In C++ at least, it'd be an option to make a testing class that's a friend of the class it tests. Then you could test the private members individually.
- badumpTissss 10y agoI feel like this list has been designed in such a way that it is not possible to create any code, without implementing an example from the list. When you make a list this long, you're attempting to cast a wide net over most conditions, if not trying for total coverage by including catch-all buckets. Meanwhile, it feels slightly impossible to ask anyone to write code at all, without having them complain about something. The only lesson I can glean from this is that every project requires a compromise of combining abominations with idealized perfection, and that transitory human moods and emotions have more effect on programming tastes, than actual practicality.
- cookiecaper 10y agoThis is the case with most such lists of verboten practices. It's good to know the general rules, but it's also important to know when your situation justifies breaking them. Competency is all about good judgment.
- hasbot 10y agoWhat a mess of a list. Management, coding, architectural, and uncategorized "anti-patterns" lumped together. I bet many of them are just from somebody blowing off steam.
- imode 10y agoshameless plug: there is an entire dump of the c2 wiki at http://imode.gitlab.io/projects/c2/index.html http://imode.gitlab.io/projects/c2/index.html it's still in plaintext, i.e WikiWikiWeb markup format, and I haven't touched it in a while. if anybody knows how to convert this to HTML, let me know and I'll batch-convert it. ward, your site is taking a down-hill turn. stop with this remodeling and go back to the static site, please.
- jpalomaki 10y agohttp://wiki.c2.com/?ReinventTheWheel http://wiki.c2.com/?ReinventTheWheel http://wiki.c2.com/?ReinventingTheWheel http://wiki.c2.com/?ReinventingTheWheel http://wiki.c2.com/?NotInventedHere http://wiki.c2.com/?NotInventedHere
- jyriand 10y agoI guess there can be an antipattern opposite to NotInventedHere, where developers don't want to solve small problems, only reuse existing libraries that already address the problem in hand. I guess this is most noticeable in the javascript world.
- andreareina 10y agoI've seen it called "Never Invent Here"