![]() Am I way off base on this? Or am I headed in the right direction? ![]() Until then, feel free to let me know your opinions in the comments. Once I get a better handle on what's going on, I'll put out some of my own samples for getting started. I'm still working through some of oddities of the environment. NET Core a bit more now that it's hit a fairly stable point. The "Getting Started" tutorials need to be designed for developers who are really "getting started", not developers who "already know most of the things about the environment but need to learn this one new thing". Quite honestly, if the macOS sample was my first look at Visual Studio Code with C#, I'd probably go back to my regular programming environment (whatever that is). Anything that makes the code harder to understand (such as naming and too much work in interpolated strings) gets in the way of understanding how the environment works. In fact, I'd make the opposite assumption: that this person is probably not familiar with C#. NET programmer who understands C#.īut if someone is using Visual Studio Code on macOS, I wouldn't make that same assumption. That's because if someone has Visual Studio installed, they're probably already a. Having this example in the Visual Studio 2017 tutorial doesn't bother me too much. For tutorial purposes, I'd probably break this up into 3 lines: If we set a breakpoint on the "WriteLine" and then choose "Step Into" where do we end up? That's not immediately obvious, particularly to someone who is new to the environment. This would be pretty difficult to debug into. I've written about this before in relation to reflection code: I Can Write That Method with 1 Line of Code. The thing that bothers me here is that it looks like someone is playing code golf. There is another section where I was a bit put off by the sample code, and that is in the console application that consumes this library (code here: Program.cs): That change alone would make this class much more understandable. It's right up there with "Foo" and "Bar" in my world, and I've written many times about how much I hate those in samples.Īnd "Get" is completely the wrong name for the method. Again, I understand that a big point (actually, the entire point) of this class is to show how to import a NuGet package (Newtonsoft.Json) and use that, but my big concern is that someone who is new to this (and maybe hasn't worked with JSON deserialization) will just be completely lost.Īnother thing I would like to change with this class is the naming. Let's say that we use the values 19 and 23 for "left" and "right", respectively:Īnd the resulting integer is turned into a string:Īnd "deserializing" the string takes the string "42" and turns it back into the integer 42. Here's the code for that library file (also here: Thing.cs): ![]() But the code made me "huh?" quite a bit.Īfter creating a solution, the first step is to create a library project. I won't go into the details of configuring the environment and using Visual Studio Code. Note: I've copied this sample to my own GitHub repository since the Microsoft sample will (hopefully) change: GitHub - jeremybytes/microsoft-core20-samples. "Getting Started" tutorials need to be designed for developers who are really "getting started", not developers who "already know most of the things about the environment but need to learn this one new thing". (And a few things I'd like your opinion on.) I understand that the goal of this particular tutorial is to show how to create a library, consume a library, set up a unit test, and use a NuGet package, but there are a few things that I thought needed some explanation. NET Core on macOS - the same code is also used in the Visual Studio 2017 sample). Where I ran into a bit of frustration was with the macOS sample ( Getting started with. NET Core 2.0), I got environments successfully set up in Windows 10 with Visual Studio 2017 (15.3), Windows 10 with Visual Studio Code, and Mac macOS (10.12.6) with Visual Studio Code. NET Core 2.0.įrom the resources on the announcement article ( Announcing. NET Core 2.0 Articles are collected here: Getting Started with. I tend to concentrate on things that are a bit more established so that I can get stuff done rather than try to figure out what's broken. ![]() I've shied away from Core because both the environment and the tools have been in flux.
0 Comments
Leave a Reply. |