“I…have made fire!”
By this I mean to say that I’ve connected to a Postgresql database with C# and printed some content to the console, marking the third time I have used the connected layer of ADO to retrieve database information.
You have to realize, at my last job, all of this was abstracted from us. ADO is the beast I’ve been learning on my own for the past several weeks. I took a guided, 200-page tour, and now I’ve been doing more hands-on, which is so important. Most tutorials use Sql Server, but last week I had some down time to connect to one of our development Oracle databases, and now I’ve connected to my Postgres database. So that’s the power of using interfaces to achieve similar functionality across providers.
To be fair, I’ve had to reference my C# book for each occasion, as I keep forgetting that damn DataReader object, but I’m pretty stoked I got this to work. It’s scary to think how much more there still is to learn about ADO and Entity Framework, which leads me to my next thought.
Entity Framework still confuses me. I was thinking about doing the Egret database code-first, but I’m so new to EF that my brain starts to freak out when I think about the database structure in C# code. I’ve done so much with SQL over the years, it just feels better. Not having had experience on the job to teach me which is better, I may just build out the rest of the database in Postgres for expediency and peace of mind, then pull in the classes from the database. Unbeknownst to me at the time, the original data I received for the database was not the complete copy, and I only received the complete copy last month, which changes everything in my models, but I am desperate for visible progress. I can’t take the tutorials anymore: it’s sink or swim now, and some good people are relying on me to swim.
This is probably the most study I ever done over these past 6 months. The pace feels painfully slow, but 700 pages of brute C# is not to be dismissed, and I’ve dramatically surpassed the knowledge I had last year. But I’m going to count this victory and call it a night. I’ll push onward tomorrow.
Oh, the horror! C# uses a lot of boilerplate. I reached the section where a connection through Entity Framework gets setup, and everything has fallen apart there.
I kinda feel like an idiot. There is so much to learn here. Not having had to write much OOP on the job, I sometimes find myself reeling from all the unexplained object references, but my brain is finally started to wrap itself around how to really use interfaces. There are so many rote configurations to memorize, it’s a very different beast from “understand what this program is doing” when it is written in the raw. What’s a DbContext? “Oh, don’t pay attention to that! We’re programmers, we just rely on abstraction!” I die a little inside every time I have to forgo the full explanation, but I suspect this is just inexperience. After all, Python hides most of the details, it just doesn’t feel that way.
I am learning! I feel much more at home in Visual Studio and with the files. I generally get what MVC is doing. And I would probably be surprised just how much progress I’ve made. I got a simple list to output in html using Razor, building the values off of a subset of the Product Categories for my inventory system. Sometimes I still feel tempted to switch to Django, but there are things I really enjoy about C# and it’s far more common. Never give up, never surrender!
First off, one more thing I hate about Linux: when you need to copy some web files and all of your USB drives are somehow being mounted read-only, and you can’t format the USB you used to install the OS in the first place. It’s running dd right now, but even on a “tiny” 16GB drive, it’s taking forever.
Anyway, more MVC adventures. I’m really happy that the book I am reading, “Pro ASP.NET Core MVC”, actually dives into what all of the various extra folders mean in an MVC project. I haven’t covered everything yet, but I can skip NuGet altogether and just edit the project.json file manually. I actually figured out that a weird error I had occasionally seen was due to a mismatch in the versions of some of the dependencies. Sweet!
It’s a bit of slog right now. I’m frustrated I’m not learning MVC faster, but the combination of mild busyness and major laziness has produced a mediocre study ethic. I remember one of my past supervisors advising me to schedule my time not with some rigid pass/fail criteria but with a “here is my goal” criteria. So my goal is to put in 30 minutes every day. I don’t hit every day, but I have learned a lot more lately because of this. Tonight I decided to bite into the design of this new website I’m building because I used to love doing that. I would fight html and css for hours on end, and it’s why they are so second nature to me today. I need to be doing this with C# if I really want to get good at it.
Anyway, I set up bootstrap using Bower. It’s not hard by any means, but you haven’t done it until you’ve done it. Currently battling bootstrap trying to figure out why my easy sample is not working. I always want to read without writing any code, but that never works well. I hauled ass on that Lottery WPF application I built, learned a ton.
For what it’s worth, I bought “C Programming: A Modern Approach”. I’m worried I’m going to spread myself thin, but it’s my personal conviction that I can’t say I’m too serious about my profession until I know some C. I wouldn’t dare apply to that others, but I am curious to learn and am rather hard on myself. At the same time I need to know my current tools, I also need to expand my understanding of computers. It took me far too long to realize that logging into a database is basically interacting with an OS process/daemon, and I’m sad I don’t know exactly how those work.