{"action":"opened","issue":{"url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/246","labels_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/246/labels{/name}","comments_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/246/comments","events_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/246/events","html_url":"https://github.com/isocpp/CppCoreGuidelines/issues/246","id":109252386,"number":246,"title":"Suggestion: Non-rule 10: Raw for-loops should use the minimal required conditional","user":{"login":"richelbilderbeek","id":2098230,"avatar_url":"https://avatars.githubusercontent.com/u/2098230?v=3","gravatar_id":"","url":"https://api.github.com/users/richelbilderbeek","html_url":"https://github.com/richelbilderbeek","followers_url":"https://api.github.com/users/richelbilderbeek/followers","following_url":"https://api.github.com/users/richelbilderbeek/following{/other_user}","gists_url":"https://api.github.com/users/richelbilderbeek/gists{/gist_id}","starred_url":"https://api.github.com/users/richelbilderbeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richelbilderbeek/subscriptions","organizations_url":"https://api.github.com/users/richelbilderbeek/orgs","repos_url":"https://api.github.com/users/richelbilderbeek/repos","events_url":"https://api.github.com/users/richelbilderbeek/events{/privacy}","received_events_url":"https://api.github.com/users/richelbilderbeek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-01T08:29:50Z","updated_at":"2015-10-01T08:29:50Z","closed_at":null,"body":"# NR.10: Raw for-loops should use the minimal required conditional\r\n\r\n**Reason**: \r\n\r\nSuppose a simple for-loop counting from 0 to 10 without changing the for-loop counter. One could argue that `operator!=` is all that is needed to end that loop and allows one to reason about what happens in the for loop. However, using `operator<` is just as good and commonly used.\r\n\r\n**Example**s:\r\n\r\n```\r\nfor (int i=0; i!=10; ++i) {} //Good\r\nfor (int i=0; i<10; ++i) {} //Just as good: i has expected simple behavior\r\n```\r\n\r\n**Alternative**s: none\r\n\r\n**Exception**s: none\r\n\r\n**Enforcement**: not possible\r\n\r\n**See also**s: none\r\n\r\n**Note**s: The non-rule is proposed at #187\r\n\r\n**Discussion**: "}}