Back in the old days, if you want to look at some sample code, you have to do a search > go to MSDN page > download sample code as .zip > extract the zip > open the .sln file to view.
Now, Microsoft is cool again. All of the sample code for Windows 10 is now available on Github, and they ARE UPDATING every day. So you will always have the latest piece of code you need, with all the improvement and coding convention from Microsoft engineer who wrote that code.
Sounds good? Here’s how
A really good Git Source Control software
Because all the codes are on GitHub, so you might need a source control software in order to:
- Faster download all the sample codes
- Get the codes updated in one click
- Get the code’s version and name
If you decided to not using a git source control software, you can always download all of them as .zip file, then extract the zip, then do all the things in the old days.
The real question is, which is a good source control?
Of course it’s your choice. Use whatever you’re familiar with. Don’t let me tell you what to do. But if you insisted, here they are
GitHub Desktop – Not that good
GitHub Desktop, developed by GitHub, is not good at all. Why? It’s too simple, and lack off basic button as Pull, Push, Fetch, Sync, blah blah blah you name it.
The goal of GitHub Desktop is make things as simple as possible. But they break familiar words in Git Source Control.
SourceTree – More complex, have all the functions
My favorite: https://www.sourcetreeapp.com/
SourceTree, developed by Atlassian, is a really good git source control (in my point of view). You can do almost everything with it. It even have command line for hardcore users.
Now you have heard that Microsoft is now open its source of .NET. Actually, not only .NET, but also a lot of things. I’ve told you, Microsoft is cool again.
To set up, you will need “clone link”, which is one of below. I would choose HTTPS to make it simple
Fire up SourceTree (or you favorite git software) > Click on Clone/New
Copy and Paste the HTTPS link to “Source Path / URL”, and SourceTree will fill in everything else. You can customize them though
Finally, click Clone and voila, all the Microsoft Sample Code is now on your hard drive.
Keep the code up-to-date
So you have the latest sample code. Now what?
To keep them up to date, simple open SourceTree (or your Git software), then either fetch > pull or sync.
In SourceTree, click Fetch
See that little red number above Pull? That the number of version (commit, if you insist) that available on GitHub server, but not on your local machine. Click Pull the get them.
And then, again, you have the latest version.
Tips: You can click on Pull directly to fetch AND pull.
Happy exploring the good and complicated sample :3