{"action":"created","comment":{"url":"https://api.github.com/repos/Zuehlke/fifty-shades/pulls/comments/235550621","pull_request_review_id":177443497,"id":235550621,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTU1MDYyMQ==","diff_hunk":"@@ -0,0 +1,46 @@\n+---\n+authorName: Rolf Bruderer\n+authorGithubUsername: bruderol\n+issue: 31\n+title: Rules are Dangerous\n+---\n+# {{page.title}}\n+\n+Rules followed blindly in a dogmatic way do a lot of harm. This is an uncomfortable truth especially for us as engineers. As such we are used to see the world in rigid rules, true and false, if and else. We like to have crystal clear and exact definitions, guidelines or best practices on how to do something. This is not bad in the first place. But we all must be very careful that we do not fall into the trap of just following such rules blindly without thinking well about consequences. \n+\n+## Examples of Rules from Software Projects\n+\n+Here are some examples of rules in Software Engineering that I have seen to cause troubles in projects:\n+* The famous rule “working software over comprehensive documentation\" from the agile manifesto is often used as an excuse not to write any documentation and deny putting any effort into it. In the long run this is not very helpful in the context of a complex software system where a minimal and helpful documentation is needed to efficiently maintain, extend or operate these systems. Not to write any documentation at all was probably not the intention of the authors of the agile manifesto. \n+* The dependency inversion principle says “Abstractions should not depend on details. Details should depend on abstractions\". I have seen projects that tried to follow this principle very strictly and everywhere in their software. They therefore totally avoided to use any concrete class directly as much as possible. As a result, there were a lot of interfaces with only one implementation class each and many factories to create instances of those classes. This resulted in a code base that is much more complex than needed. It makes the software difficult to understand and maintain without bringing any benefit of really needed flexibility into that software.\n+* People read the book about “Clean Code” that says that many code comments can be avoided by writing self-explaining code instead. While this is true for many cases the rule is often miss-used by developers for arguing not to write any comments at all in the source code. But there are many things that you cannot explain by using good method or variable names only. E.g. why you had to implement something like that. For this purpose, good comments are still very valuable and should not be denied. I would say that a well put comment can explain much more than hundred good variable names.\n+* The article by Martin Fowler about the “Page Object Pattern” once said to never put assertions into page objects. Someone read that article and wanted to convince the whole project team that it is very important to follow this rule very strictly. The arguments for the rule in the blog post were not very convincing to me. I brought up many examples where breaking that rule caused much more benefit than sticking to it. Nevertheless I was not taken serious. Since Martin Fowler wrote it, it counts as if it was written in the bible. Nobody wanted to constructively argue about it anymore. Fun fact: In the meantime Martin Fowler changed his article to mention both opinions on this topic. This at least let’s the option open to the reader to decide what fits best in his concrete context. Unfortunately, not all famous technical opinion makers are so wise as Mr. Fowler.\n+\n+Please, do not get me wrong: I like the Agile Manifesto, the SOLID Principles, Clean Code, Martin Fowler in general and even his article about the Page Object Pattern. Those are all practices I appreciate a lot and that influenced my way of thinking and working. But still all these things also come with the danger of undesired side-effects, if just following them blindly in a dogmatic way.\n+\n+## The Problems with Rules\n+\n+The problems I often see in projects with such rules:\n+* Applying rules in the wrong context might not have the desired effect at all\n+* Using rules stricter than meant to be, causes adverse effects","path":"articles/rules-are-dangerous.md","position":25,"original_position":25,"commit_id":"149b41604fc1c7b53e262113d4e98a8b3c617b46","original_commit_id":"9a46115e50afafacbf18fe9515613d855addcb68","user":{"login":"bruderol","id":755721,"node_id":"MDQ6VXNlcjc1NTcyMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/755721?v=4","gravatar_id":"","url":"https://api.github.com/users/bruderol","html_url":"https://github.com/bruderol","followers_url":"https://api.github.com/users/bruderol/followers","following_url":"https://api.github.com/users/bruderol/following{/other_user}","gists_url":"https://api.github.com/users/bruderol/gists{/gist_id}","starred_url":"https://api.github.com/users/bruderol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bruderol/subscriptions","organizations_url":"https://api.github.com/users/bruderol/orgs","repos_url":"https://api.github.com/users/bruderol/repos","events_url":"https://api.github.com/users/bruderol/events{/privacy}","received_events_url":"https://api.github.com/users/bruderol/received_events","type":"User","site_admin":false},"body":"Agree. Can be one of many possible problems. Think this is kind of implicitly given, see also “discussin culture” mentioned later. \r\n\r\nNo time / space to squeeze that in. Sorry, too late.","created_at":"2018-11-21T22:01:39Z","updated_at":"2018-11-21T22:01:39Z","html_url":"https://github.com/Zuehlke/fifty-shades/pull/154#discussion_r235550621","pull_request_url":"https://api.github.com/repos/Zuehlke/fifty-shades/pulls/154","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Zuehlke/fifty-shades/pulls/comments/235550621"},"html":{"href":"https://github.com/Zuehlke/fifty-shades/pull/154#discussion_r235550621"},"pull_request":{"href":"https://api.github.com/repos/Zuehlke/fifty-shades/pulls/154"}},"in_reply_to_id":235020889},"pull_request":{"url":"https://api.github.com/repos/Zuehlke/fifty-shades/pulls/154","id":228195314,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4MTk1MzE0","html_url":"https://github.com/Zuehlke/fifty-shades/pull/154","diff_url":"https://github.com/Zuehlke/fifty-shades/pull/154.diff","patch_url":"https://github.com/Zuehlke/fifty-shades/pull/154.patch","issue_url":"https://api.github.com/repos/Zuehlke/fifty-shades/issues/154","number":154,"state":"open","locked":false,"title":"#31 Article \"Rules are Dangerous\"","user":{"login":"bruderol","id":755721,"node_id":"MDQ6VXNlcjc1NTcyMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/755721?v=4","gravatar_id":"","url":"https://api.github.com/users/bruderol","html_url":"https://github.com/bruderol","followers_url":"https://api.github.com/users/bruderol/followers","following_url":"https://api.github.com/users/bruderol/following{/other_user}","gists_url":"https://api.github.com/users/bruderol/gists{/gist_id}","starred_url":"https://api.github.com/users/bruderol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bruderol/subscriptions","organizations_url":"https://api.github.com/users/bruderol/orgs","repos_url":"https://api.github.com/users/bruderol/repos","events_url":"https://api.github.com/users/bruderol/events{/privacy}","received_events_url":"https://api.github.com/users/bruderol/received_events","type":"User","site_admin":false},"body":"Ready for review.\r\n\r\nFixes #31 ","created_at":"2018-11-04T18:56:39Z","updated_at":"2018-11-21T22:01:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55cda6f5e29ebdcf99dfe5ad814d96bab39f4bd8","assignee":null,"assignees":[],"requested_reviewers":[{"login":"peitor","id":197122,"node_id":"MDQ6VXNlcjE5NzEyMg==","avatar_url":"https://avatars0.githubusercontent.com/u/197122?v=4","gravatar_id":"","url":"https://api.github.com/users/peitor","html_url":"https://github.com/peitor","followers_url":"https://api.github.com/users/peitor/followers","following_url":"https://api.github.com/users/peitor/following{/other_user}","gists_url":"https://api.github.com/users/peitor/gists{/gist_id}","starred_url":"https://api.github.com/users/peitor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peitor/subscriptions","organizations_url":"https://api.github.com/users/peitor/orgs","repos_url":"https://api.github.com/users/peitor/repos","events_url":"https://api.github.com/users/peitor/events{/privacy}","received_events_url":"https://api.github.com/users/peitor/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Zuehlke/fifty-shades/pulls/154/commits","review_comments_url":"https://api.github.com/repos/Zuehlke/fifty-shades/pulls/154/comments","review_comment_url":"https://api.github.com/repos/Zuehlke/fifty-shades/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Zuehlke/fifty-shades/issues/154/comments","statuses_url":"https://api.github.com/repos/Zuehlke/fifty-shades/statuses/149b41604fc1c7b53e262113d4e98a8b3c617b46","head":{"label":"Zuehlke:feature/#31-article-rules-are-dangerous","ref":"feature/#31-article-rules-are-dangerous","sha":"149b41604fc1c7b53e262113d4e98a8b3c617b46","user":{"login":"Zuehlke","id":10219568,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMjE5NTY4","avatar_url":"https://avatars1.githubusercontent.com/u/10219568?v=4","gravatar_id":"","url":"https://api.github.com/users/Zuehlke","html_url":"https://github.com/Zuehlke","followers_url":"https://api.github.com/users/Zuehlke/followers","following_url":"https://api.github.com/users/Zuehlke/following{/other_user}","gists_url":"https://api.github.com/users/Zuehlke/gists{/gist_id}","starred_url":"https://api.github.com/users/Zuehlke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zuehlke/subscriptions","organizations_url":"https://api.github.com/users/Zuehlke/orgs","repos_url":"https://api.github.com/users/Zuehlke/repos","events_url":"https://api.github.com/users/Zuehlke/events{/privacy}","received_events_url":"https://api.github.com/users/Zuehlke/received_events","type":"Organization","site_admin":false},"repo":{"id":78009920,"node_id":"MDEwOlJlcG9zaXRvcnk3ODAwOTkyMA==","name":"fifty-shades","full_name":"Zuehlke/fifty-shades","private":false,"owner":{"login":"Zuehlke","id":10219568,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMjE5NTY4","avatar_url":"https://avatars1.githubusercontent.com/u/10219568?v=4","gravatar_id":"","url":"https://api.github.com/users/Zuehlke","html_url":"https://github.com/Zuehlke","followers_url":"https://api.github.com/users/Zuehlke/followers","following_url":"https://api.github.com/users/Zuehlke/following{/other_user}","gists_url":"https://api.github.com/users/Zuehlke/gists{/gist_id}","starred_url":"https://api.github.com/users/Zuehlke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zuehlke/subscriptions","organizations_url":"https://api.github.com/users/Zuehlke/orgs","repos_url":"https://api.github.com/users/Zuehlke/repos","events_url":"https://api.github.com/users/Zuehlke/events{/privacy}","received_events_url":"https://api.github.com/users/Zuehlke/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Zuehlke/fifty-shades","description":"Open Source Book about practicaly proven concepts, best practices, cultural philosophies and great ideas that we use in our daily work in projects at Zühlke","fork":false,"url":"https://api.github.com/repos/Zuehlke/fifty-shades","forks_url":"https://api.github.com/repos/Zuehlke/fifty-shades/forks","keys_url":"https://api.github.com/repos/Zuehlke/fifty-shades/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Zuehlke/fifty-shades/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Zuehlke/fifty-shades/teams","hooks_url":"https://api.github.com/repos/Zuehlke/fifty-shades/hooks","issue_events_url":"https://api.github.com/repos/Zuehlke/fifty-shades/issues/events{/number}","events_url":"https://api.github.com/repos/Zuehlke/fifty-shades/events","assignees_url":"https://api.github.com/repos/Zuehlke/fifty-shades/assignees{/user}","branches_url":"https://api.github.com/repos/Zuehlke/fifty-shades/branches{/branch}","tags_url":"https://api.github.com/repos/Zuehlke/fifty-shades/tags","blobs_url":"https://api.github.com/repos/Zuehlke/fifty-shades/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Zuehlke/fifty-shades/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Zuehlke/fifty-shades/git/refs{/sha}","trees_url":"https://api.github.com/repos/Zuehlke/fifty-shades/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Zuehlke/fifty-shades/statuses/{sha}","languages_url":"https://api.github.com/repos/Zuehlke/fifty-shades/languages","stargazers_url":"https://api.github.com/repos/Zuehlke/fifty-shades/stargazers","contributors_url":"https://api.github.com/repos/Zuehlke/fifty-shades/contributors","subscribers_url":"https://api.github.com/repos/Zuehlke/fifty-shades/subscribers","subscription_url":"https://api.github.com/repos/Zuehlke/fifty-shades/subscription","commits_url":"https://api.github.com/repos/Zuehlke/fifty-shades/commits{/sha}","git_commits_url":"https://api.github.com/repos/Zuehlke/fifty-shades/git/commits{/sha}","comments_url":"https://api.github.com/repos/Zuehlke/fifty-shades/comments{/number}","issue_comment_url":"https://api.github.com/repos/Zuehlke/fifty-shades/issues/comments{/number}","contents_url":"https://api.github.com/repos/Zuehlke/fifty-shades/contents/{+path}","compare_url":"https://api.github.com/repos/Zuehlke/fifty-shades/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Zuehlke/fifty-shades/merges","archive_url":"https://api.github.com/repos/Zuehlke/fifty-shades/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Zuehlke/fifty-shades/downloads","issues_url":"https://api.github.com/repos/Zuehlke/fifty-shades/issues{/number}","pulls_url":"https://api.github.com/repos/Zuehlke/fifty-shades/pulls{/number}","milestones_url":"https://api.github.com/repos/Zuehlke/fifty-shades/milestones{/number}","notifications_url":"https://api.github.com/repos/Zuehlke/fifty-shades/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Zuehlke/fifty-shades/labels{/name}","releases_url":"https://api.github.com/repos/Zuehlke/fifty-shades/releases{/id}","deployments_url":"https://api.github.com/repos/Zuehlke/fifty-shades/deployments","created_at":"2017-01-04T11:30:47Z","updated_at":"2018-11-21T16:11:24Z","pushed_at":"2018-11-21T21:47:43Z","git_url":"git://github.com/Zuehlke/fifty-shades.git","ssh_url":"git@github.com:Zuehlke/fifty-shades.git","clone_url":"https://github.com/Zuehlke/fifty-shades.git","svn_url":"https://github.com/Zuehlke/fifty-shades","homepage":"","size":15678,"stargazers_count":21,"watchers_count":21,"language":"HTML","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":39,"mirror_url":null,"archived":false,"open_issues_count":78,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":39,"open_issues":78,"watchers":21,"default_branch":"develop"}},"base":{"label":"Zuehlke:develop","ref":"develop","sha":"6add282fd22174df9257a2cb00bba9f72ee6e2cf","user":{"login":"Zuehlke","id":10219568,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMjE5NTY4","avatar_url":"https://avatars1.githubusercontent.com/u/10219568?v=4","gravatar_id":"","url":"https://api.github.com/users/Zuehlke","html_url":"https://github.com/Zuehlke","followers_url":"https://api.github.com/users/Zuehlke/followers","following_url":"https://api.github.com/users/Zuehlke/following{/other_user}","gists_url":"https://api.github.com/users/Zuehlke/gists{/gist_id}","starred_url":"https://api.github.com/users/Zuehlke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zuehlke/subscriptions","organizations_url":"https://api.github.com/users/Zuehlke/orgs","repos_url":"https://api.github.com/users/Zuehlke/repos","events_url":"https://api.github.com/users/Zuehlke/events{/privacy}","received_events_url":"https://api.github.com/users/Zuehlke/received_events","type":"Organization","site_admin":false},"repo":{"id":78009920,"node_id":"MDEwOlJlcG9zaXRvcnk3ODAwOTkyMA==","name":"fifty-shades","full_name":"Zuehlke/fifty-shades","private":false,"owner":{"login":"Zuehlke","id":10219568,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMjE5NTY4","avatar_url":"https://avatars1.githubusercontent.com/u/10219568?v=4","gravatar_id":"","url":"https://api.github.com/users/Zuehlke","html_url":"https://github.com/Zuehlke","followers_url":"https://api.github.com/users/Zuehlke/followers","following_url":"https://api.github.com/users/Zuehlke/following{/other_user}","gists_url":"https://api.github.com/users/Zuehlke/gists{/gist_id}","starred_url":"https://api.github.com/users/Zuehlke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zuehlke/subscriptions","organizations_url":"https://api.github.com/users/Zuehlke/orgs","repos_url":"https://api.github.com/users/Zuehlke/repos","events_url":"https://api.github.com/users/Zuehlke/events{/privacy}","received_events_url":"https://api.github.com/users/Zuehlke/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Zuehlke/fifty-shades","description":"Open Source Book about practicaly proven concepts, best practices, cultural philosophies and great ideas that we use in our daily work in projects at Zühlke","fork":false,"url":"https://api.github.com/repos/Zuehlke/fifty-shades","forks_url":"https://api.github.com/repos/Zuehlke/fifty-shades/forks","keys_url":"https://api.github.com/repos/Zuehlke/fifty-shades/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Zuehlke/fifty-shades/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Zuehlke/fifty-shades/teams","hooks_url":"https://api.github.com/repos/Zuehlke/fifty-shades/hooks","issue_events_url":"https://api.github.com/repos/Zuehlke/fifty-shades/issues/events{/number}","events_url":"https://api.github.com/repos/Zuehlke/fifty-shades/events","assignees_url":"https://api.github.com/repos/Zuehlke/fifty-shades/assignees{/user}","branches_url":"https://api.github.com/repos/Zuehlke/fifty-shades/branches{/branch}","tags_url":"https://api.github.com/repos/Zuehlke/fifty-shades/tags","blobs_url":"https://api.github.com/repos/Zuehlke/fifty-shades/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Zuehlke/fifty-shades/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Zuehlke/fifty-shades/git/refs{/sha}","trees_url":"https://api.github.com/repos/Zuehlke/fifty-shades/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Zuehlke/fifty-shades/statuses/{sha}","languages_url":"https://api.github.com/repos/Zuehlke/fifty-shades/languages","stargazers_url":"https://api.github.com/repos/Zuehlke/fifty-shades/stargazers","contributors_url":"https://api.github.com/repos/Zuehlke/fifty-shades/contributors","subscribers_url":"https://api.github.com/repos/Zuehlke/fifty-shades/subscribers","subscription_url":"https://api.github.com/repos/Zuehlke/fifty-shades/subscription","commits_url":"https://api.github.com/repos/Zuehlke/fifty-shades/commits{/sha}","git_commits_url":"https://api.github.com/repos/Zuehlke/fifty-shades/git/commits{/sha}","comments_url":"https://api.github.com/repos/Zuehlke/fifty-shades/comments{/number}","issue_comment_url":"https://api.github.com/repos/Zuehlke/fifty-shades/issues/comments{/number}","contents_url":"https://api.github.com/repos/Zuehlke/fifty-shades/contents/{+path}","compare_url":"https://api.github.com/repos/Zuehlke/fifty-shades/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Zuehlke/fifty-shades/merges","archive_url":"https://api.github.com/repos/Zuehlke/fifty-shades/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Zuehlke/fifty-shades/downloads","issues_url":"https://api.github.com/repos/Zuehlke/fifty-shades/issues{/number}","pulls_url":"https://api.github.com/repos/Zuehlke/fifty-shades/pulls{/number}","milestones_url":"https://api.github.com/repos/Zuehlke/fifty-shades/milestones{/number}","notifications_url":"https://api.github.com/repos/Zuehlke/fifty-shades/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Zuehlke/fifty-shades/labels{/name}","releases_url":"https://api.github.com/repos/Zuehlke/fifty-shades/releases{/id}","deployments_url":"https://api.github.com/repos/Zuehlke/fifty-shades/deployments","created_at":"2017-01-04T11:30:47Z","updated_at":"2018-11-21T16:11:24Z","pushed_at":"2018-11-21T21:47:43Z","git_url":"git://github.com/Zuehlke/fifty-shades.git","ssh_url":"git@github.com:Zuehlke/fifty-shades.git","clone_url":"https://github.com/Zuehlke/fifty-shades.git","svn_url":"https://github.com/Zuehlke/fifty-shades","homepage":"","size":15678,"stargazers_count":21,"watchers_count":21,"language":"HTML","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":39,"mirror_url":null,"archived":false,"open_issues_count":78,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":39,"open_issues":78,"watchers":21,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Zuehlke/fifty-shades/pulls/154"},"html":{"href":"https://github.com/Zuehlke/fifty-shades/pull/154"},"issue":{"href":"https://api.github.com/repos/Zuehlke/fifty-shades/issues/154"},"comments":{"href":"https://api.github.com/repos/Zuehlke/fifty-shades/issues/154/comments"},"review_comments":{"href":"https://api.github.com/repos/Zuehlke/fifty-shades/pulls/154/comments"},"review_comment":{"href":"https://api.github.com/repos/Zuehlke/fifty-shades/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Zuehlke/fifty-shades/pulls/154/commits"},"statuses":{"href":"https://api.github.com/repos/Zuehlke/fifty-shades/statuses/149b41604fc1c7b53e262113d4e98a8b3c617b46"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"bruderol"}}