{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/7927","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/7927/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/7927/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/7927/events","html_url":"https://github.com/dotnet/roslyn/issues/7927","id":126359637,"number":7927,"title":"if! syntax for if not","user":{"login":"Thaina","id":1042507,"avatar_url":"https://avatars.githubusercontent.com/u/1042507?v=3","gravatar_id":"","url":"https://api.github.com/users/Thaina","html_url":"https://github.com/Thaina","followers_url":"https://api.github.com/users/Thaina/followers","following_url":"https://api.github.com/users/Thaina/following{/other_user}","gists_url":"https://api.github.com/users/Thaina/gists{/gist_id}","starred_url":"https://api.github.com/users/Thaina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thaina/subscriptions","organizations_url":"https://api.github.com/users/Thaina/orgs","repos_url":"https://api.github.com/users/Thaina/repos","events_url":"https://api.github.com/users/Thaina/events{/privacy}","received_events_url":"https://api.github.com/users/Thaina/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Language%20Design","name":"Area-Language Design","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-01-13T07:29:44Z","updated_at":"2016-01-14T03:23:39Z","closed_at":null,"body":"Most of the times we do any not logic. It very messy\r\n\r\nTo add parentheses just for add ! in front of all logic\r\nOr empty if then else\r\nOr cache a bool\r\n\r\nIt very surprising that there is no easy way to make shorthand easily\r\n\r\nSo I want to propose if! syntax\r\n\r\n```\r\nvar dict = new Dictionary<string,object>();\r\n\r\nobject obj;\r\nif(!dict.TryGetValue(key,out obj) || !(obj is string)) //// normal syntax\r\n    DoSomethingToAddNew(key);\r\n\r\nif(!(dict.TryGetValue(key,out obj) && obj is string)) //// parentheses\r\n    DoSomethingToAddNew(key);\r\n\r\nif!(dict.TryGetValue(key,out obj) && obj is string) //// my proposed\r\n    DoSomethingToAddNew(key);\r\n```"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/171518450","html_url":"https://github.com/dotnet/roslyn/issues/7927#issuecomment-171518450","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/7927","id":171518450,"user":{"login":"HaloFour","id":10102290,"avatar_url":"https://avatars.githubusercontent.com/u/10102290?v=3","gravatar_id":"","url":"https://api.github.com/users/HaloFour","html_url":"https://github.com/HaloFour","followers_url":"https://api.github.com/users/HaloFour/followers","following_url":"https://api.github.com/users/HaloFour/following{/other_user}","gists_url":"https://api.github.com/users/HaloFour/gists{/gist_id}","starred_url":"https://api.github.com/users/HaloFour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaloFour/subscriptions","organizations_url":"https://api.github.com/users/HaloFour/orgs","repos_url":"https://api.github.com/users/HaloFour/repos","events_url":"https://api.github.com/users/HaloFour/events{/privacy}","received_events_url":"https://api.github.com/users/HaloFour/received_events","type":"User","site_admin":false},"created_at":"2016-01-14T03:23:39Z","updated_at":"2016-01-14T03:23:39Z","body":"It's strictly a question of taste.  Most languages, like the c family of languages, don't have a dedicated negated conditional statement.  It's simply not needed.  There's not a single use case here that can't be solved with existing syntax and two additional characters."}}