{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/13731","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/13731/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/13731/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/13731/events","html_url":"https://github.com/dotnet/roslyn/issues/13731","id":176250876,"number":13731,"title":"Proposal: Radical simplification of the C# syntax","user":{"login":"OJacot-Descombes","id":12754787,"avatar_url":"https://avatars.githubusercontent.com/u/12754787?v=3","gravatar_id":"","url":"https://api.github.com/users/OJacot-Descombes","html_url":"https://github.com/OJacot-Descombes","followers_url":"https://api.github.com/users/OJacot-Descombes/followers","following_url":"https://api.github.com/users/OJacot-Descombes/following{/other_user}","gists_url":"https://api.github.com/users/OJacot-Descombes/gists{/gist_id}","starred_url":"https://api.github.com/users/OJacot-Descombes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OJacot-Descombes/subscriptions","organizations_url":"https://api.github.com/users/OJacot-Descombes/orgs","repos_url":"https://api.github.com/users/OJacot-Descombes/repos","events_url":"https://api.github.com/users/OJacot-Descombes/events{/privacy}","received_events_url":"https://api.github.com/users/OJacot-Descombes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-11T16:05:40Z","updated_at":"2016-09-11T17:38:00Z","closed_at":null,"body":"Well, that would be a new language of course. But a language with essentially the same semantics as C#. Let's call it D# (D-Sharp). Why: save typing, remove visual noise.\r\n\r\nInstead of writing (C#):\r\n\r\n    using static System.Console;\r\n\r\n    namespace Example.CSharp // Namespace is nesting\r\n    {\r\n        class Program\r\n        {\r\n            static void Main(string[] args)\r\n            {\r\n                int a = 10;\r\n                int b = 20;\r\n\r\n                if (a == 10) {\r\n                    if (b == 20) {\r\n                        WriteLine(\"Value of a is 10 and b is 20\");\r\n                    } else if (b > 50) {\r\n                        WriteLine(\"Value of a is 10 and b greater than 50\");\r\n                    } else {\r\n                        WriteLine(\"Value of a is 10\");\r\n                    }\r\n                }\r\n\r\n                switch (a)\r\n                {\r\n                    case 0:\r\n                    case 1:\r\n                    case 2:\r\n                        WriteLine(\"Low number\");\r\n                        break;\r\n                    case 3:\r\n                    case 4:\r\n                    case 5:\r\n                        WriteLine(\"Medium number\");\r\n                        break;\r\n                    default:\r\n                        WriteLine(\"Other number\");\r\n                        break;\r\n                }\r\n\r\n                while (a < 1000) {\r\n                    WriteLine(a);\r\n                    a *= 2;\r\n                }\r\n\r\n                do {\r\n                    WriteLine(b);\r\n                    b *= 2;\r\n                } while (b < 1000)\r\n\r\n                ReadLine();\r\n            }\r\n        }\r\n    }\r\n\r\nwe would write (D#):\r\n\r\n    using static System.Console\r\n\r\n    namespace Example.DSharp // Namespace is a not nesting, thus saving one indentation level.\r\n\r\n    class Program\r\n\r\n        static void Main(string[] args)\r\n\r\n            int a = 10\r\n            int b = 20\r\n\r\n            if a == 10\r\n                if b == 20\r\n                    WriteLine(\"Value of a is 10 and b is 20\")\r\n                elsif b > 50\r\n                    WriteLine(\"Value of a is 10 and b greater than 50\")\r\n                else\r\n                    WriteLine(\"Value of a is 10\")\r\n\r\n            switch a\r\n                case 0, 1, 2\r\n                    WriteLine(\"Low number\")\r\n                case 3, 4, 5\r\n                    WriteLine(\"Medium number\")\r\n                default\r\n                    WriteLine(\"Other number\")\r\n\r\n            while a < 1000\r\n                WriteLine(a)\r\n                a *= 2\r\n\r\n            do\r\n                WriteLine(b)\r\n                b *= 2\r\n            until b >= 1000 // Since while would be ambiguous, we use until instead.\r\n\r\n            ReadLine()\r\n\r\nThe syntax would be line-oriented with smart line continuation. Blocks would solely be defined by indentation (as in python).\r\n\r\nOf course there is a lot more to be nailed down, but this is only the starting point for a discussion. What do you think of it?"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/246192847","html_url":"https://github.com/dotnet/roslyn/issues/13731#issuecomment-246192847","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/13731","id":246192847,"user":{"login":"OJacot-Descombes","id":12754787,"avatar_url":"https://avatars.githubusercontent.com/u/12754787?v=3","gravatar_id":"","url":"https://api.github.com/users/OJacot-Descombes","html_url":"https://github.com/OJacot-Descombes","followers_url":"https://api.github.com/users/OJacot-Descombes/followers","following_url":"https://api.github.com/users/OJacot-Descombes/following{/other_user}","gists_url":"https://api.github.com/users/OJacot-Descombes/gists{/gist_id}","starred_url":"https://api.github.com/users/OJacot-Descombes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OJacot-Descombes/subscriptions","organizations_url":"https://api.github.com/users/OJacot-Descombes/orgs","repos_url":"https://api.github.com/users/OJacot-Descombes/repos","events_url":"https://api.github.com/users/OJacot-Descombes/events{/privacy}","received_events_url":"https://api.github.com/users/OJacot-Descombes/received_events","type":"User","site_admin":false},"created_at":"2016-09-11T17:38:00Z","updated_at":"2016-09-11T17:38:00Z","body":"Of course C# will never be a whitespace sensitive language! The C# compiler remains as is. There would be a **new** D# compiler. This is a proposal for a new language called D# with similar semantics as C# (you can reuse all your C# knowledge!). Is it really silly to provide the same power, but with a much simpler syntax?"}}
{"actor":{"display_login":"OJacot-Descombes"}}