{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/6553","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/6553/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/6553/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/6553/events","html_url":"https://github.com/dotnet/roslyn/issues/6553","id":115050979,"number":6553,"title":"[Proposal] VB-like \"with\" opeartor","user":{"login":"WrongBit","id":15650524,"avatar_url":"https://avatars.githubusercontent.com/u/15650524?v=3","gravatar_id":"","url":"https://api.github.com/users/WrongBit","html_url":"https://github.com/WrongBit","followers_url":"https://api.github.com/users/WrongBit/followers","following_url":"https://api.github.com/users/WrongBit/following{/other_user}","gists_url":"https://api.github.com/users/WrongBit/gists{/gist_id}","starred_url":"https://api.github.com/users/WrongBit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WrongBit/subscriptions","organizations_url":"https://api.github.com/users/WrongBit/orgs","repos_url":"https://api.github.com/users/WrongBit/repos","events_url":"https://api.github.com/users/WrongBit/events{/privacy}","received_events_url":"https://api.github.com/users/WrongBit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-04T13:24:17Z","updated_at":"2015-11-04T17:10:49Z","closed_at":null,"body":"We all boring of code like this:\r\n\r\n    var MyVeryDescriptiveVariable = new SomeClass();\r\n    MyVeryDescriptiveVariable.Field = 1;// OK, can be done in initializer\r\n    MyVeryDescriptiveVariable.Event += meth();// why THIS cannot be done in initializer??\r\n    MyVeryDescriptiveVariable.Fun();\r\n\r\nAnd languages like VB & Delphi many years enjoy with \"WITH\" operator:\r\n\r\n    with(var MyVeryDescriptiveVariable = new SomeClass(), OtherVar) {\r\n        .Field1 = .Field2;// it was MyVeryDescriptiveVariable.Field1 = OtherVar.Field2\r\n        .Event += meth();// meth() w/o dot means method from outer scope\r\n        MyVeryDescriptiveVariable.Fun();// ambiguous methods are called with full name\r\n    }\r\n\r\nI think this is useful operator, which simpify code and takes not so much efforts to realise."},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/153795089","html_url":"https://github.com/dotnet/roslyn/issues/6553#issuecomment-153795089","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/6553","id":153795089,"user":{"login":"WrongBit","id":15650524,"avatar_url":"https://avatars.githubusercontent.com/u/15650524?v=3","gravatar_id":"","url":"https://api.github.com/users/WrongBit","html_url":"https://github.com/WrongBit","followers_url":"https://api.github.com/users/WrongBit/followers","following_url":"https://api.github.com/users/WrongBit/following{/other_user}","gists_url":"https://api.github.com/users/WrongBit/gists{/gist_id}","starred_url":"https://api.github.com/users/WrongBit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WrongBit/subscriptions","organizations_url":"https://api.github.com/users/WrongBit/orgs","repos_url":"https://api.github.com/users/WrongBit/repos","events_url":"https://api.github.com/users/WrongBit/events{/privacy}","received_events_url":"https://api.github.com/users/WrongBit/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T17:10:49Z","updated_at":"2015-11-04T17:10:49Z","body":"It's not a \"dupe\", you got it wrong. My \"with\" assume you can use operator everywhere, not only in initialization. And my \"with\" supports multiple objects to shortcut.\r\nSecond, by your link I read only this:\r\n\r\n\"Many people, including the C# language designers, *believe that*...\"\r\n\r\nSorry, but \"beliefs\" they can leave for wife - I need technical explanation what is wrong when you need to type less code (what in most cases INCREASES readability - one of reasons why C uses {} instead of \"begin-end\").\r\n\r\n>  You can get the same semantics by assigning an expression to a simple short-name variable\r\n\r\nPartly I agree, but you talk about just piece of code in curlies - what about external code? Why I should waste my lines just to say \"var z = MyVeryDescriptiveVariable\"? Code is not a dustbin, it should be short, clear and express only algorithm related stuff. May be those \"c# language designers\" first should talk to Niclaus Wirth? Sure he has enough reasons why his language contains \"with\" which still not understandable by \"modern designers\". ;]"}}