{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/csharplang/issues/1469","repository_url":"https://api.github.com/repos/dotnet/csharplang","labels_url":"https://api.github.com/repos/dotnet/csharplang/issues/1469/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/csharplang/issues/1469/comments","events_url":"https://api.github.com/repos/dotnet/csharplang/issues/1469/events","html_url":"https://github.com/dotnet/csharplang/issues/1469","id":316483219,"number":1469,"title":"Make C# more beginner friendly","user":{"login":"gulshan","id":751732,"avatar_url":"https://avatars3.githubusercontent.com/u/751732?v=4","gravatar_id":"","url":"https://api.github.com/users/gulshan","html_url":"https://github.com/gulshan","followers_url":"https://api.github.com/users/gulshan/followers","following_url":"https://api.github.com/users/gulshan/following{/other_user}","gists_url":"https://api.github.com/users/gulshan/gists{/gist_id}","starred_url":"https://api.github.com/users/gulshan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gulshan/subscriptions","organizations_url":"https://api.github.com/users/gulshan/orgs","repos_url":"https://api.github.com/users/gulshan/repos","events_url":"https://api.github.com/users/gulshan/events{/privacy}","received_events_url":"https://api.github.com/users/gulshan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-04-21T11:17:48Z","updated_at":"2018-04-24T00:26:58Z","closed_at":null,"author_association":"NONE","body":"As great as the language C# is, currently I don't see it is being used for introduction to programming that much. Beginning programming with some language increses it's mindshare and markertshare in my opinion. So, I would like to raise some points which I think will make C# more \"beginner friendly\". Many of these are found from comparison with Python (which is kind of first choice for beginners nowadays'). And while some of them are language issues, some others are about tooling or library. But I'm keeping all of them together here. \r\n\r\n- **Acquisition**\r\nThe first thing one has to do to get start with C# is to install C#/.net sdk. And the easiest acquisition is no acquisition at all. Some languages like python comes bundled with various OSes. It will be most convenient for a beginner if the dotnet sdk comes bundled with various OSes. I think Microsoft can (and should) bundle it with Windows and talk to Linux distributions to bundle it. And then, .net sdk should be officially available from apt, brew, chocolatey and likes for easier distribution/acquisition/update.\r\n\r\n- **Running in browser**\r\nAnother way to get started is running in browser. This is an important option as this also does not require any installation and run on devices with limited development support like iOS/Android devices. Currently there are various third party services and even 1st-party solutions from Microsoft. But the process should more readily available, adopted and highlighted in various ways where appropriate like documentation and tutorials (both first party and third party). \r\n\r\n- **Run single file**\r\nWhen someone is just starting to learn programming, creating a \"project\", whether visually or through command line `dotnet new` is a hurdle s/he has to overcome. So, it will be helpful for beginners if a single file can be run with a single command. Something like `dotnet run file.cs` will be useful.\r\n\r\n- **Focus on scripts**\r\nEven more convenient for a beginner to start with scripts instead of code files. In hello world is a one liner and what it does is quite obvious from the code itself. While in a source file, a beginner have to use `using`, `class`, `static` and other constructs without knowing what they mean just to start. Also with scripts(and convenient configuration), the file itself is executable, which will be easier for a beginner to run. Current scripting support in .net sdk is almost invisible.\r\n\r\n- **More textual constructs**\r\nProgramming languages resembling more to human language(English to be specific) is easier to begin with. So, `if not(...)` and `while not(...)` will be much more easier to understand than `if(!(...))` and `while(!(...))`. Then again there can be an `until` loop in place of `while not`. Then there can be `do until` like `do while`. There can be a `loop{...}` forever loop. And some textual alternative to conditional `?:` operator will also be easier to catch. even there can be `try when` in the place of `try catch` etc. We can look for some other such constructs.\r\n\r\n- **list and dictionary syntax**\r\nIn the beginner level, before learning custom and complex data types, programmers usually learn and use lists and dictionaries. These are the two most fundamental collections types. But in C# using these two types are not very ergonomic for the beginners IMHO. One has to use `new` and generic angle brackets `<>` for using lists and dictionaries without much or any idea. So, I would suggest to improvise list dictionary syntax, much like what was done for tuples. Currently `(1, \"a\")` is a tuple and the type is `(int, string)`. So simple matching between declaration and type. Same should be done for lists and dictionary- `[1, 2, 3]` should be a list of type `[int]` and `[1:\"a\", 2:\"b\"]` is a dictionary of type `[int:string]`. Or, curly braces can be used in the place of square brackets- `{1, 2, 3}` is a list of type `{int}` and so on.\r\n\r\n- **Immutability**\r\nHow something like `x = x + 1` is a valid statement is one of the most common questions beginners ask. Immutability make things easier to make sense of. Clear distinction between mutable and immutable variables in syntax helps a lot. So, local immutables with `let` will make the life easier for beginners IMO.\r\n\r\n- **Basic graphics and chart/graph library**\r\nIt's very common to use graphics for making programming more interesting for the beginners. So, availability of a cross platform easy to use basic (2D) graphic library in .net/C# will be awesome. So will be a readily available chart/graph library.\r\n\r\nMost of these are already proposed. I am just posing them together with a focus on simplicity for the beginners."},"comment":{"url":"https://api.github.com/repos/dotnet/csharplang/issues/comments/383764071","html_url":"https://github.com/dotnet/csharplang/issues/1469#issuecomment-383764071","issue_url":"https://api.github.com/repos/dotnet/csharplang/issues/1469","id":383764071,"user":{"login":"svick","id":287848,"avatar_url":"https://avatars3.githubusercontent.com/u/287848?v=4","gravatar_id":"","url":"https://api.github.com/users/svick","html_url":"https://github.com/svick","followers_url":"https://api.github.com/users/svick/followers","following_url":"https://api.github.com/users/svick/following{/other_user}","gists_url":"https://api.github.com/users/svick/gists{/gist_id}","starred_url":"https://api.github.com/users/svick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svick/subscriptions","organizations_url":"https://api.github.com/users/svick/orgs","repos_url":"https://api.github.com/users/svick/repos","events_url":"https://api.github.com/users/svick/events{/privacy}","received_events_url":"https://api.github.com/users/svick/received_events","type":"User","site_admin":false},"created_at":"2018-04-24T00:26:58Z","updated_at":"2018-04-24T00:26:58Z","author_association":"CONTRIBUTOR","body":"@KathleenDollard \r\n\r\n> I have watched several beginners struggle with x = x + 1. However, I think this moment of rethinking is a really important first step. I'd like to make the language around it easier to find (maybe Try.dot.net), but I think it's a speed bump folks need to address.\r\n\r\nThis reminds me of SharpLab's recently added [Explain mode](https://sharplab.io/#v2:C4LgpgHgDgNghgSwHYBoAmIDUAfAAgBgAJcBGAbgFgAoXAZmICZCBhQgb0M8Oq+PtwAshALIAKZIWTBCcFIXFJgc0vgCUhAEbq2PXl0GEAMqO269hAL5m913lMIRCAXkJowAMzgBXGMEpVzTgR3eQ1JAGdCADc4ACdo1VsuAEhSAE5RKNUyQNzuAK4rAs5rOklFQgAFZwA+Qlp/CyA==). It takes a piece of C# code, explains all the features used in it and links to their documentation. I think it could be useful for beginners looking at unfamiliar piece of code.\r\n\r\nCurrently, it doesn't explain the basics like `=`, but that's something that could be added."}}
{"actor":{"display_login":"svick"}}