{"action":"created","issue":{"url":"https://api.github.com/repos/alongubkin/spider/issues/128","labels_url":"https://api.github.com/repos/alongubkin/spider/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/alongubkin/spider/issues/128/comments","events_url":"https://api.github.com/repos/alongubkin/spider/issues/128/events","html_url":"https://github.com/alongubkin/spider/issues/128","id":56746673,"number":128,"title":"suggestion: Null-Coalescing Operator ","user":{"login":"gavinengel","id":523621,"avatar_url":"https://avatars.githubusercontent.com/u/523621?v=3","gravatar_id":"","url":"https://api.github.com/users/gavinengel","html_url":"https://github.com/gavinengel","followers_url":"https://api.github.com/users/gavinengel/followers","following_url":"https://api.github.com/users/gavinengel/following{/other_user}","gists_url":"https://api.github.com/users/gavinengel/gists{/gist_id}","starred_url":"https://api.github.com/users/gavinengel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavinengel/subscriptions","organizations_url":"https://api.github.com/users/gavinengel/orgs","repos_url":"https://api.github.com/users/gavinengel/repos","events_url":"https://api.github.com/users/gavinengel/events{/privacy}","received_events_url":"https://api.github.com/users/gavinengel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-05T23:28:31Z","updated_at":"2015-02-06T19:49:06Z","closed_at":null,"body":"This syntax seems to be a more compact ternary operator, is that right?\r\n\r\n```\r\n// spider syntax:\r\nvar name = somethingElse;\r\nname = name ?? 'default name';\r\n```\r\n\r\nIf so, may I suggest a slightly different form?  Per a suggestion [here](http://stackoverflow.com/questions/6347694/how-can-i-create-a-new-operator-in-php#comment44615884_6347694), I re-write the above which checks a variable and defaults it if the variable is empty/false:\r\n\r\n```\r\n// suggested formats, all of which are the same\r\nvar name = somethingElse;\r\nname = name ? name : 'default name'; // traditional ternary\r\nname = name ?: 'default name'; // shortened ternary <-- this looks better to me\r\nname = name || 'default name'; // just like the one above\r\nname = name ?? 'default name'; // spider syntax\r\nname ?= 'default name'; // really short ternary  <-- I also like this\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/alongubkin/spider/issues/comments/73300790","html_url":"https://github.com/alongubkin/spider/issues/128#issuecomment-73300790","issue_url":"https://api.github.com/repos/alongubkin/spider/issues/128","id":73300790,"user":{"login":"gavinengel","id":523621,"avatar_url":"https://avatars.githubusercontent.com/u/523621?v=3","gravatar_id":"","url":"https://api.github.com/users/gavinengel","html_url":"https://github.com/gavinengel","followers_url":"https://api.github.com/users/gavinengel/followers","following_url":"https://api.github.com/users/gavinengel/following{/other_user}","gists_url":"https://api.github.com/users/gavinengel/gists{/gist_id}","starred_url":"https://api.github.com/users/gavinengel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavinengel/subscriptions","organizations_url":"https://api.github.com/users/gavinengel/orgs","repos_url":"https://api.github.com/users/gavinengel/repos","events_url":"https://api.github.com/users/gavinengel/events{/privacy}","received_events_url":"https://api.github.com/users/gavinengel/received_events","type":"User","site_admin":false},"created_at":"2015-02-06T19:49:06Z","updated_at":"2015-02-06T19:49:06Z","body":"Good points, all.  I only wanted to give some food for thought.  I see this topic has been discussed before.  Thanks for reading my issue."}}