DEV Community

Tim Purdum
Tim Purdum

Posted on

Using .Net Core Console Apps as a Baseline for Teaching Programming

Many self-taught programmers, myself included, become easily overwhelmed by modern app and web development tutorials. My thought is that this is caused by the combination of UI, Database, and logic layers. So I decided to make ToCode.Software as a new type of tutorial.

I am a .Net developer, and I also love cross-platform code. There is a wonderful web tool, DotNetFiddle, that can help anyone from beginner to professional try out some simple C# code. I used DotNetFiddle as an embedded, interactive template for the beginning lessons of ToCode.Software, so users can try out code without ever leaving the site.

As the second step, I introduce Visual Studio Code, .Net Core, and the bash shell, so learners can start making their own simple console apps with file-based, object-oriented classes.

After going over many of the basics of the C# language and coding logic, there are two projects, a simple ChatBot, and a more complicated Go Fish Game. I hope to expand this series to include many of the following concepts:

  1. Adding an app UI with Xamarin.Forms
  2. Adding a web UI with HTML and CSS
  3. Connecting to a SQL database to store and retrieve data

I'd love some feedback on this project. Feel free to comment here, or on the site, and share!

Top comments (3)

stefandorresteijn profile image
Stefan Dorresteijn • Edited

I don't hate the idea of teaching in C# but I think there are other languages that fit the bill a lot better. C# has an entire framework around it and isn't going to be most web developer's long-term language. A couple languages I think would work better as "firsts" would be:

1. Ruby
super simple, can get started with TryRuby and will be useful if you want to write server software, web applications or desktop applications. Ruby also comes so close to magic, it's just really fun to learn.
2. JavaScript
everyone writes JS, it's super easy to find answers to your questions and you can be a full stack developer with 1 language.
3. Python
syntax is relatively easy to learn and with very little knowledge, you can actually do quite a lot. Also useful for CLI apps and web apps (and AI related functionality but that's not for beginners)

I personally took the longest way 'round, going from PHP (with a little HTML/CSS/JS) -> C# -> Ruby -> (Node)JS -> Elixir, picking up a couple other languages here and there. Ruby to me is still the simplest language to write, and the language that took me from "someone who writes code" to "a developer". Starting with that might allow the student to learn how to be a developer before they start writing applications. (If that makes any sense at all)

timpurdum profile image
Tim Purdum

Hi Stefan, thanks for the feedback!

My goal, right or wrong, when I was learning to code was to search for that "one" language that would do everything I wanted. This has until recently been a futile effort. However, in recent years and months, we really can achieve this with several different languages. As you mentioned, Javascript fits this bill. However, with Mono on Web Assembly and projects like Blazor and Ooui, it is now also possible to achieve this with C#.

Of course, everyone will have their favorite languages. I have had some experience with Javascript, Typescript, Java, Swift, PHP, and VB, in addition to C#. I have done one project in Python, and I wouldn't say I know it well, and none in Ruby. But here are my reasons for liking C#.

  1. Static Typing: I like having variables that must be declared, and the type can be viewed in the IDE just by hovering over it. When I do need to work in Javascript for web development, I prefer to transpile Typescript. Of course, as IDE's get smarter, this may become less of an issue.
  2. Brackets and Semicolons: Most languages I have worked with would be considered in the C family, and I really prefer being able to see where a line and a closure both end, and wrap the text and indent any way I feel. This is definitely an aesthetic issue, but I get confused by code that is only separated by indents.
  3. Huge support. Like Javascript, there is a very large support community around C#, including Microsoft, of course.

Regardless of the language you choose, I wonder what you think of my console-first approach? I think you could take your favorite language, say Ruby, and write a similar guide. Heck, I wouldn't mind if you basically copied my examples!

stefandorresteijn profile image
Stefan Dorresteijn

I love your console-first approach. Programming is not about being able to set up a web server, it's about learning how to solve problems, using a code. All in all, I love your idea and the time/effort you've put into it. Once I can figure out for myself what I think are core development skills every beginner should learn, I might turn it into a similar guide!