Adventures in Programming

Getting Started – Adventures in Programming

As I’m getting started with developing in C# there’s a few things I have already noticed. First off, Microsoft seems to be really serious about covering as much ground as possible. Their Visual Studio IDE covers a lot of programming languages, and allows you to program for virtually any platform.

There’s also a Visual Studio for Mac version. Since I use both Mac and Windows I had to take some time to consider where I’d be programming on. However, there wasn’t really much of a choice as I looked at which platforms you can develop for.

Apparently, the only “edge” Visual Studio for Mac’s got over the Windows version is that you can build MacOS apps that use Coco. I am guessing it is Apple’s platform like .net is for Windows?

The downside of using the Mac version of Visual Studio? I can’t program for any Windows platform. Can’t develop UWP or Windows centric apps, which was half of what I was aiming for. There is .net Core integration for “cross-platform” development, but I’ve yet to figure out what that is or why I would use it over the windows .net platform.

Additionally, cross-platform apps can’t target Windows, whereas cross-platform apps you build in the Windows IDE can target Android, iOS and Windows platforms all at once.

Models, Views and Controllers(?)

Today,  I had a realization about the thing all C# apps have in common, regardless of the platform you are developing for. There’s always a view, and a separate controller (or model?) which is where your actual C# code goes.

E.G in the ASP.net template, you create the View as HTML pages. You then write actual C# code in pages that are linked to the HTML views. In the HTML pages, you can load classes and functions you’ve written easily.

The same applies to Windows Forms / UWP. When you create a form or an UWP app, you are generating XAML code. I don’t really know what it is, but I’m guessing it’s the presentation layer of your app. It’s your Views all over again.

You can then create C# code which operates behind the View (by clicking on the form). So the same principle applies, but the execution is different.

I am already familiar with the principle of MVC (Model, View and Controller) where each is separated. The one thing I am not a 100% sure about is if the code I’ve written so far qualifies as a “Controller” or a “Model”. I am leaning towards the former as it’s actual code which does things as opposed to code which shapes data and how it’s read or stored.

Intellisense is a bro

Intellisense, Visual Studio’s intelligent “auto-completion” feature, is super useful. Not only can it help me by suggesting functions and the likes of which I have no idea why I’d ever need them (not useful right now), but it can also find and suggest classes and code I’ve created in separate files (super useful right now).

Advertisements