{"id":231290,"date":"2020-11-25T11:59:21","date_gmt":"2020-11-25T19:59:21","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=231290"},"modified":"2020-12-10T00:47:23","modified_gmt":"2020-12-10T08:47:23","slug":"guest-post-learn-c-with-visual-studio-visual-studio-for-mac-and-unity-and-win-a-free-book","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/guest-post-learn-c-with-visual-studio-visual-studio-for-mac-and-unity-and-win-a-free-book\/","title":{"rendered":"[Guest post] Learn C# with Visual Studio, Visual Studio for Mac, and Unity (and win a free book!)"},"content":{"rendered":"<p><em>This post was authored by guest blogger Andrew Stellman, author of the Head First C# book series, and published by the Visual Studio for Mac team on his behalf.<\/em><\/p>\n<p><strong>UPDATE: The book giveaway challenge is complete. We will be announcing winners on the Visual Studio blog within the next week. Thank you for your submissions!<\/strong><\/p>\n<p>Visual Studio is an amazing development tool. But Visual Studio and Visual Studio for Mac are more than just intuitive, state-of-the-art development environments. They\u2019re also remarkably powerful <strong>learning and exploration tools<\/strong>, with features to help you create and understand your code. I love teaching and learning about C# with Visual Studio. That\u2019s why my co-author, Jenny Greene, and I put Visual Studio and Visual Studio for Mac right at the center of our latest book, <strong><em>Head First C# <\/em><\/strong><em>(4<sup>th<\/sup> edition)<\/em>, published by O\u2019Reilly Media. <em>Head First C# <\/em>incorporates Visual Studio directly in the learning. combining Visual Studio with the unique and innovative \u201cbrain-friendly\u201d Head First approach to teaching helps us make learning C# easier and more fun for our readers.<\/p>\n<p><img decoding=\"async\" width=\"612\" height=\"383\" class=\"wp-image-231291\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/the-sleuth-it-out-elements-throughout-the-book-l.png\" alt=\"The &quot;Sleuth it out&quot; elements throughout the book leverage Visual Studio's powerful debugging features to help you track down and fix bugs.\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/the-sleuth-it-out-elements-throughout-the-book-l.png 612w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/the-sleuth-it-out-elements-throughout-the-book-l-300x188.png 300w\" sizes=\"(max-width: 612px) 100vw, 612px\" \/><\/p>\n<p>Visual Studio is built with modern development in mind, and we take advantage of that to teach you real-world programming techniques and practices. We teach important, practical skills throughout <em>Head First C#<\/em> that developers use every day, from refactoring to debugging to unit testing. For example, in many projects throughout the book, you\u2019ll get practice with debugging techniques for tracking down, \u201csleuthing\u201d out, and fixing bugs in your code\u2014and you\u2019ll use the powerful debugging features of Visual Studio to help you do it. And you\u2019ll use Visual Studio\u2019s powerful code generation tools throughout the book, whether you\u2019re learning core C# building blocks like generating methods or focusing on more advanced concepts like lambda expressions.<\/p>\n<p><em>Head First C#<\/em> is packed with stories, puzzles, and exercises to keep you engaged and give you different ways to learn. The new edition features the visually rich, multisensory Head First format that\u2019s based on the latest in cognitive science and learning theory that engages your mind and emotions. Most of all, you\u2019ll get practice with <em>lots<\/em> of coding projects, complete with sample solutions. You can download the first four chapters of <em>Head First C#<\/em> for free from the <a href=\"https:\/\/github.com\/head-first-csharp\/fourth-edition\">book\u2019s GitHub page.<\/a><\/p>\n<p><div  class=\"d-flex justify-content-center\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/github.com\/head-first-csharp\/fourth-edition\" target=\"_blank\">Download Chapters 1 - 4<\/a><\/div><\/p>\n<p>Interested? Then keep reading, because we\u2019re giving away copies of <em>Head First C#<\/em>. <a href=\"#post-231290-Contest_Rules\">The contest<\/a> ends December 9, 2020, so get started now!<\/p>\n<h2><img decoding=\"async\" width=\"511\" height=\"591\" class=\"wp-image-231292\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/graphical-user-interface-description-automaticall.jpeg\" alt=\"Graphical user interface Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/graphical-user-interface-description-automaticall.jpeg 511w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/graphical-user-interface-description-automaticall-259x300.jpeg 259w\" sizes=\"(max-width: 511px) 100vw, 511px\" \/><\/h2>\n<h2>Why <em>Head First C#<\/em> is right for you<\/h2>\n<p><em>Head First C#<\/em> is a unique, in-depth, and brain-friendly guide to help you learn all about writing code in C#. This is the fourth edition of the book, and we\u2019ve spent over a decade talking to C# learners and finding innovative ways to help you learn C#. We\u2019ve talked to many C# developers over the years, from fledgling programmers to senior engineers, as well as many amazing folks at Microsoft who work on C# and .NET every day. We\u2019ve used those valuable lessons that we\u2019ve learned to create a fun and effective learning experience for you.<\/p>\n<p><strong><em>We want you to learn C#.<\/em><\/strong> But more than that, we want to help you on your journey to becoming a better developer. That\u2019s why <em>Head First C# <\/em>goes beyond teaching the language:<\/p>\n<ul>\n<li>You\u2019ll learn real-world techniques like refactoring and unit testing that professional developers use to create great code.<\/li>\n<li>You\u2019ll sleuth out bugs and get practice debugging code.<\/li>\n<li>You\u2019ll build lots of games\u2014and you\u2019ll use them to learn practical lessons that apply to all kinds of programming, not just game development.<\/li>\n<li>You\u2019ll write a lot of C# code\u2014and have fun doing it!<\/li>\n<\/ul>\n<h2>A unique focus on Windows, Mac, and Unity<\/h2>\n<p>The world of C# and .NET has grown substantially over the last few years. While C# has always been part of the Windows world, it\u2019s increasingly important for Mac development. That\u2019s why all of the projects in <em>Head First C#<\/em> are based on <strong>.NET Core<\/strong>, Microsoft\u2019s free and open-source framework for Windows, Linux, and\u00a0<a href=\"https:\/\/www.bing.com\/search?q=OS+X&amp;filters=sid%3aa0d268ef-80dc-73e4-9ff9-98b3a233218a&amp;form=ENTLNK\">macOS<\/a>.<\/p>\n<p>We worked especially hard to make your Mac a first-class citizen of <em>Head First C#<\/em>. Visual Studio for Mac is a powerful and innovative development environment, and we worked closely with the Visual Studio for Mac team to fully integrate it into <em>Head First C#<\/em>.<\/p>\n<p>Visual Studio also provides a great gateway into game development. Building games is a great way to get practice C#, which is why <em>Head First C#<\/em> features a series of <strong>Unity Labs<\/strong>, in which you\u2019ll reinforce the C# lessons you\u2019ve learned by building 3D games. Whether you\u2019re using Windows or macOS, Visual Studio integrates tightly with Unity, the powerful cross-platform game engine that you can use to create games for many different operating systems and consoles.<\/p>\n<p><img decoding=\"async\" width=\"1428\" height=\"597\" class=\"wp-image-231293\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/youll-get-practice-with-c-by-building-3d-games-w.png\" alt=\"You\u2019ll get practice with C# by building 3D games with Unity. This is part of the Unity Lab about Unity\u2019s powerful AI navigation system.\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/youll-get-practice-with-c-by-building-3d-games-w.png 1428w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/youll-get-practice-with-c-by-building-3d-games-w-300x125.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/youll-get-practice-with-c-by-building-3d-games-w-1024x428.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/youll-get-practice-with-c-by-building-3d-games-w-768x321.png 768w\" sizes=\"(max-width: 1428px) 100vw, 1428px\" \/><\/p>\n<h2>Game design\u2026 and beyond<\/h2>\n<p>We included dozens of coding projects throughout <em>Head First C#<\/em>, and many of those projects are games. We didn\u2019t do this simply because we love games. Games can be effective tools for learning and teaching C#. Here\u2019s why:<\/p>\n<ul>\n<li>Games are <strong>familiar<\/strong>. When you\u2019re learning a new language, you\u2019re immersed in a lot of new concepts and ideas. Giving you something familiar to grab onto can make the learning process go more smoothly.<img decoding=\"async\" width=\"553\" height=\"505\" class=\"wp-image-231294\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/the-game-design-and-beyond-elements-use-moder.png\" alt=\"The \u201cGame design... and beyond\u201d elements use modern game design ideas to teach broader programming concepts that apply to any kind of app (not just games).\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/the-game-design-and-beyond-elements-use-moder.png 553w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/the-game-design-and-beyond-elements-use-moder-300x274.png 300w\" sizes=\"(max-width: 553px) 100vw, 553px\" \/><\/li>\n<li>Games make it easier to <strong>explain projects<\/strong>. When you start one of the projects that we\u2019ve designed for you, the first thing you need to do is understand what we\u2019re asking you to build\u2014and that can be surprisingly difficult. When we use games for our projects, that makes it easier for you to quickly figure out what we\u2019re asking and dive right into the code.<\/li>\n<li>Games are <strong>fun to write<\/strong>! Your brain is much more receptive to new information when you\u2019re having fun, so including coding projects where you\u2019ll build games is, well, a no-brainer (excuse the pun).<\/li>\n<\/ul>\n<h2>Hit the ground running by starting out with an engaging game project<\/h2>\n<p><img decoding=\"async\" width=\"627\" height=\"665\" class=\"wp-image-231295\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/youll-build-a-fun-animal-matching-gameand-get-or.png\" alt=\"You\u2019ll build a fun animal matching game\u2014and get oriented with Visual Studio\u2014in the very first chapter.\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/youll-build-a-fun-animal-matching-gameand-get-or.png 627w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/youll-build-a-fun-animal-matching-gameand-get-or-283x300.png 283w\" sizes=\"(max-width: 627px) 100vw, 627px\" \/><\/p>\n<p>When you use <em>Head First C#<\/em> to learn C#, you\u2019ll dive right in from the very beginning. In the first chapter of the book, you\u2019ll start writing C# code\u2014and get oriented with Visual Studio\u2014by building an animal matching game.<\/p>\n<p>.NET Core console apps are great if you need to input and output text. If you want a visual app that\u2019s displayed on a browser page, you\u2019ll need to use a different technology\u2014and that\u2019s why we included two different versions of this game. There\u2019s a Windows-exclusive version that uses <strong>WPF<\/strong> (Windows Presentation Framework), a technology that you\u2019ll use to build Windows desktop apps. But we don\u2019t want macOS readers to miss out on the fun! That\u2019s why we included a <em>Visual Studio for Mac Learner\u2019s Guide<\/em> that includes an <strong>ASP.NET Blazor<\/strong> version of every WPF project in the book, including a complete replacement for the animal match game in Chapter 1.<\/p>\n<p>With Blazor, you can create rich web applications that can run in any modern browser. The goal of the Blazor animal match game project is to introduce you to Blazor, and to give you tools to build rich web applications as well as console apps. By the time you\u2019re done with the project, you\u2019ll be a lot more familiar with the tools that you\u2019ll rely on throughout the book to learn and explore C#.<\/p>\n<p>The first chapter of <em>Head First C#<\/em> walks you through creating the game just like you would with a professional development project: by building it in a series of parts that lead towards a final goal of a playable, fun game. Here\u2019s what you\u2019ll do:<\/p>\n<ol>\n<li>Create a new Blazor WebAssembly App project in Visual Studio.<\/li>\n<li>Lay out the page and write C# code to shuffle the animals.<\/li>\n<li>The game lets the user click on pairs of emoji to match them.<\/li>\n<li>Write more C# code to detect when the player has won the game.<\/li>\n<li>Make the game more exciting by adding a timer.<\/li>\n<\/ol>\n<p><img decoding=\"async\" width=\"1431\" height=\"343\" class=\"wp-image-231296\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/diagram-description-automatically-generated.png\" alt=\"Diagram Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/diagram-description-automatically-generated.png 1431w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/diagram-description-automatically-generated-300x72.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/diagram-description-automatically-generated-1024x245.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/diagram-description-automatically-generated-768x184.png 768w\" sizes=\"(max-width: 1431px) 100vw, 1431px\" \/><\/p>\n<h2><a id=\"post-231290-Contest_Rules\"><\/a>The Contest \u2013 win a free copy of <em>Head First C#<\/em><\/h2>\n<p>Are you excited yet? We\u2019ve teamed up with the Visual Studio team to give away free copies of <em>Head First C#<\/em>. Here\u2019s how:<\/p>\n<ol>\n<li>Download the <strong>free PDF of the first four chapters of <em>Head First C#<\/em><\/strong> from the <a href=\"https:\/\/github.com\/head-first-csharp\/fourth-edition\">book\u2019s GitHub page.<\/a><\/li>\n<li>Do the animal match game Chapter 1 using Blazor, WPF, or Unity.<\/li>\n<li>Fill out <a href=\"https:\/\/aka.ms\/hfcs-book-challenge\">this form<\/a> to enter the giveaway by 11:59 p.m. PT,\u00a0 December 9, 2020.<\/li>\n<li>We\u2019ll randomly select the winners and announce them on the Visual Studio blog.<\/li>\n<\/ol>\n<p>The <a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/11\/Head-First-C-Book-Giveaway-Sweepstakes-Official-Rules.pdf\">official contest rules<\/a> are available for download in PDF format. Doing a project or puzzle from the book is not required for entry, and if you prefer to submit code from another lab from the book, that&#8217;s okay, too. But if you do a project, we encourage you to <strong>get creative <\/strong>and put your own, unique spin on it! Upload your code to GitHub and paste in a link to it when you submit your entry. After we select randomly choose the contest winners, we\u2019ll pick some of our favorite projects and highlight them in the follow-up blog post where we announce the winners. <em>This could be your chance for <\/em><strong><em>fame<\/em><\/strong><em> and <\/em><strong><em>fortune<\/em><\/strong><em>!<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guest post, Andrew Stellman explains his approach to teaching C# with Visual Studio, Visual Studio for Mac by emphasizing exploration, fun, and games. We&#8217;re announcing a fun coding challenge for beginners, with a chance to win a copy of the new edition of Head First C# book.<\/p>\n","protected":false},"author":470,"featured_media":231295,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[155],"tags":[5,182,3743,452],"class_list":["post-231290","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio","tag-csharp","tag-unity","tag-visual-studio-2019-for-mac","tag-visual-studio-for-mac"],"acf":[],"blog_post_summary":"<p>In this guest post, Andrew Stellman explains his approach to teaching C# with Visual Studio, Visual Studio for Mac by emphasizing exploration, fun, and games. We&#8217;re announcing a fun coding challenge for beginners, with a chance to win a copy of the new edition of Head First C# book.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/231290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/470"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=231290"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/231290\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/231295"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=231290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=231290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=231290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}