Hacker News new | past | comments | ask | show | jobs | submit login
The Little ASP.NET Core Book (recaffeinate.co)
212 points by rdegges on Sept 19, 2017 | hide | past | favorite | 49 comments

Just wanted to say: congrats on the book launch Nate! I haven't read through it yet, but skimming through it seems really great. I'm looking forward to reading it all this weekend.

If any of you are on the fence about reading this: please give it a go! Nate is one of the best people I know (both personally and professionally). He's an incredibly hard worker, really great developer, and awesome human. I'm sure you'll learn a lot from him.

Thanks man!

Thanks for the book! I really like your style and I think this is another great resource I'll get a lot out of.

One of my concerns about .NET core is it seems that there are a handful of ways to do things compared to Java. But I'm starting to like the fact that there are fewer options that work really well. Plus there are things like LINQ that I haven't seen used much elsewhere that blow my mind.

LINQ and the async/await pattern are my two all-time favorite things about C#.

Isn't LINQ quite slow?

Enjoying the book, I'm new to to asp and razor although I have done a little .net wep api before.

I have an issue with the first view, when running I get the error below on all references in the cshtml. I'm using a stock install of VS 2017. Any ideas?

/Views/Todo/Index.cshtml(4,5): error CS0103: The name 'ViewData' does not exist in the current context /Views/Todo/Index.cshtml(8,33): error CS0103: The name 'ViewData' does not exist in the current context /Views/Todo/Index.cshtml(8,27): error CS0103: The name 'Write' does not exist in the current context /Views/Todo/Index.cshtml(19,31): error CS0103: The name 'Model' does not exist in the current context /Views/Todo/Index.cshtml(23,1): error CS0103: The name 'WriteAttributeValue' does not exist in the current context /Views/Todo/Index.cshtml(25,16): error CS0103: The name 'Write' does not exist in the current context /Views/Todo/Index.cshtml(26,16): error CS0103: The name 'Write' does not exist in the current context

Did you also install the .Net Core 2.0 SDK?

Not yet, and I was thinking that this might be the issue - would you expect this to be required?

dotnet --version shows 1.1.0, I think I assumed that the latest VS2017 would have the latest dotnet core but this doesn't seem to be the case.

This is a common misconception, VS2017 doesn't ship with the .Net Core SDK, you need to manually install it seperatly. This is also described in the Book: https://nbarbettini.gitbooks.io/little-asp-net-core-book/con...

Thanks for pointing this out, this did indeed fix the problem. Somewhere in the installation I had ended up with 1.1 but it works fine now.

The "little" part is appreciated, as I recall all too vividly learning ASP.NET by slogging through "Beginning ASP.NET" by Imar Spaanjaars. It's a good book, don't get me wrong, but its two biggest strengths (thoroughness and being good for beginners) result in its being 800 pages long!

I have fond memories of learning VB3 from Teach Yourself Visual Basic in 21 Days, which had to be 500+ pages. It turns out it's tough to have a good introduction to a topic without going really long.

C++ has John Carmack, PHP has Zuckerberg, Lisp has Paul Graham. Does anyone know of any good role models to look up to in the ASP.NET world? As childish as it might sound, that has honestly been a sticking point preventing me to be able to really get into all this.

Not sure about ASP.NET but Jon Skeet is pretty much the C#/.NET guru in the internet: https://meta.stackexchange.com/questions/9134/jon-skeet-fact...

+1 for Jon Skeet, he's the Chuck Norris from dot net. https://stackoverflow.com/users/22656/jon-skeet .

Then you have also Scott Hanselman, a known .net evangelist: https://www.hanselman.com/ and Scott Guthrie

Anders Hejlsberg for C# I guess? ASP.NET as a framework doesn't have any 'celebrity personalities' that I am aware of, but then it doesn't really need any. Its a good framework, especially with the dotnet core rewrite; you should try it! Put it on Docker and run it on Linux for fun :)

Hejlsberg is a great inspiration for Delphi as well. A person is rarely this influential in multiple domains.

Has Hejlsberg ever written a book? He must have a lot of valuable insight to share. I think part of the success of C++ and C was that their developers are good writers. K&R is phenomenal and Stoustroup's book are excellent too.

Not sure, aside from his books on the C# language. But the great thing about Hejlsberg and his team is that the evolution of the language is really transparent, and rapid: proposals for C# 8 (possibly 2019/2020): https://github.com/dotnet/csharplang/milestone/8

Not a book, some great insights here.


For ASP.NET - Scott Hanselman

I second that and would add Damien Edwards and David Fowler (who would be notable if just for SignalR but have done so much more)

That's not an exact match with what you are looking for, but try the ASP NET Community Standup which covers lots of "people doing stuff with (ASP) Core":


Jon Skeet Phil Haack Scotts Hanselman, Guthrie, and Allen

Zuckerberg for hack.

Jeffrey Way, Tyler Otwell are the stars of the php world thrse days.

Jeff Atwood of coding horror is also an asp.net advocate. Stack Overflow, written in asp.net, was designed by Jeff. https://nickcraver.com/blog/2016/02/17/stack-overflow-the-ar...

That StackOverflow runs on .NET is one of my favorite little-known facts.

Sad to disappoint you but Carmack, while obviously one of the best engineers out there, has nothing to do with C++.

Anders Hejlsberg Scott Hanselman

But some interesting people to follow are Jimmy bogard, greg young, David Fowler.

Good list. I'd also add Marc Gravell and Stephen Cleary.

I've found that I rarely read Hanselman's stuff any more... he's great if you're playing around with bleeding-edge ASP.NET Core on Linux on Azure, but not if you're trying to dig into the guts of C#. (I was so burned by the so-called "release candidates" of ASP.NET Core that I stopped following that vein of blogger.)

the guys at stackoverflow are great. ben adams also.

This Twitter list was advertised a few days ago. https://twitter.com/spboyer/lists/cloud-developer-advocates

There are some really good talks on a wide variety of .net things at https://dotnetrocks.com/

For ASP, David Fowler without a doubt, also recommend Barry Dorans and Scott Sauber

Anders Hejlsberg is basically the living legend of programming language design.

Jon Skeet?

First off, you picked a great time to ask this question because this week there's a free, online conference going on at https://www.dotnetconf.net/. There's a lot of good ASP.NET Core content, so you can see for yourself.

One of my favorite things about the ASP.NET team is that a lot of them were community leaders - speakers, writers, open source library authors, etc. - before being hired at Microsoft. So it's hard to pick just one or two community leaders on the team, as pretty much everyone regularly speaks at conferences, publishes open source code, blogs, etc. So it's really hard to make a short list! Hopefully this is still useful to someone.

As several others have mentioned, you really should start with Scott Hanselman (https://www.hanselman.com/ and @shanselman). [Disclaimer: he's my boss, but I joined his team because I was a big fan long before either of us worked at Microsoft]

The ASP.NET Weekly Community Standup is a great place to connect both with the team and with the leading members of the developer community. It's at https://live.asp.net/ with Damian Edwards, Scott Hanselman and me. Damian Edwards (https://twitter.com/damianedwards) is the program manager for the ASP.NET team. During the show, I usually share 10ish links to top posts, open source projects, etc. by the community. We feel like the ASP.NET Community is made up of developers both inside and out of Microsoft, so you'll see a mix. The links are usually in the show notes, and we also tweet the links out daily at @aspnet. I'm not going to risk making a list because I don't want to leave anyone off - there are too many for me to even try to pick favorites!

Next, check out the "official" Web Dev blog: https://blogs.msdn.microsoft.com/webdev/. We have a general rule that all posts are signed by actual people, not "the ___ team", so you can see who's working directly on specific topics. You'll definitely see a lot of posts by Jeff Fritz (my team mate), who (in addition to program managing several features) does a ton of work to write up release posts, organize content for conferences, etc.

I think of David Fowler (https://twitter.com/davidfowl) as the "crazy genius" on the team. He and Damian wrote SignalR, he worked on prototyping some of the very early work that became ASP.NET Core (and .NET Core all up), etc. Check out this video to see what I mean: https://channel9.msdn.com/Events/NDC/NDC-Oslo-2017/BRK06

For front end dev, make sure you follow Mads Kristensen (https://twitter.com/mkristensen) and Steve Sanderson (https://twitter.com/StevenSanderson). Mads is a program manager for web developer tools in Visual Studio, and also writes a ton of open source Visual Studio extensions for web developers (https://github.com/madskristensen) and builds things like http://webdevchecklist.com/. Steve is always pushing the boundaries of front end development, both with things like JavaScriptServices (https://github.com/aspnet/JavaScriptServices, now shipping in the Visual Studio 2017 Angular / React project templates) and more recently with Blazor (https://github.com/SteveSanderson/Blazor - .NET code running in the browser via Web Assembly).

You'll also see Glenn Condron (https://twitter.com/condrong) listed on several of the recent Web Dev blog posts. He covers a lot of deep back end tech, including a lot of stuff with ASP.NET Core on Docker.

You can see quick (5-10 minute) interviews with most of those people, as well as a lot of other people on the .NET team, on a show that Maria Naggaga (https://twitter.com/ladynaggaga) and I started up recently called Code Conversations (https://channel9.msdn.com/Shows/Code-Conversations). These are short, code focused interviews you can watch while your code is compiling and hopefully put to work right away.

Finally, please ping me at @jongalloway if I can help connect you with anyone or if you're having trouble finding information, code samples, etc. I'm happy to help!

I have been following along and so far filed a couple of minor issues on github. This is a very very good book and does well to explain the various mechanics. Thanks!

Thanks for filing the issues. And thanks for reading!

great starter book! Any plans of expanding it to a more advanced level? I would like to see elaboration on the async/await patterns and more on http verb support techniques and routing. I like your holistic but bare bones approach and I would pay for an advanced version of this book, especially if it included short exercises with answers after each chapter.

Thanks for the feedback! I don't have anything in the works right now, but will definitely consider it.

Are new to programming Already code in a backend stack like Node, Python, Ruby, Go, or Java Are an ASP.NET MVC developer

Consider me sold!. Have been watching .NET Core from the sidelines while I have been "teaching myself" Python. But being constantly on a Windoze systems there is so much more that one could with .net core. Thanks for putting this together.

I think it's a great time to jump into .NET Core if you've been on the sidelines. There was a lot of version pain early on, but it's way better now. Being able to write C# code on my Windows box that runs natively on my MacBook Pro feels awesome.

This looks great. I've been learning ASP.NET Core with scattered resources around the web, and your book seems to explain everything in a simple way. Adding to my list of resources...

I would like to see a version for REST and SPAs as well

Agreed! It's great that the book is published under an open license - my first thought was that it'd be fun to port this to f# - and my second thought was to restructure it a bit, focusing on REST/SPA.

Having read through it, it is indeed nice and concise - but I'm of two minds of the content - is it really good to introduce server side rendering with jquery and ajax - today?

I think, that showing server side rendering is good, for a beginner (how do I go from a form, to db, and back to a simple html table?) - but I'm not sure how useful the "half-way to smart client"-approach of jquery is. I'm almost convinced throwing out most of the server side rendering in favour of returning json and rendering everything client side would be better, than the "in between" approach.

Now you have rendering and interaction spread over server side views and client side javascript - and I'm not sure I like the path it sets up for new developers.

But for someone that "grew up" with the html to html+ajax it made the book very accessible, and manages to show off a remarkably broad and (apparently) useful section of asp.net core to someone not well versed in asp.net core.

Very good points, thanks. I struggled with this myself as I was trying to plan out the structure of the book. I ultimately went with the "path of least resistance" (ASP.NET Core MVC ships with Bootstrap, jQuery, etc) but I agree that it could be better in future versions. :)

Great intro to ASP.NET Core, it will help me cover the gaps in knowledge. Congrats on your work!

Thanks for making and sharing this!

Thanks for reading it!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact