MVC Adventures Part 3

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!

PL/SQL Varray

For the first time since beginning my career in Software Development nearly 4 years ago, I have used a PL/SQL varray on the job.

You laugh! At my previous job, almost every data structure was abstracted from us, and we all know why. PL/SQL data structures are ugly, obtuse, and non-intuitive. I’ve been writing some database cleanup scripts and needed a way to store the values from a particular list that aren’t referenced by another table, and the varray fit the bill. Too bad I couldn’t write it in Python, which would have saved half the effort.

You know what’s even more insane? I built a PL/SQL table of records and it took me nearly half an hour to figure out that when you “index by” a variable of type ‘table’, you can’t use the extend() method on it, you simply assign values to any given table subscript.

It’s the small things in life.

Update 4/20/2017:

Fail. I actually was not able to use the Varray because you cannot use local collections in SQL statements in a PL/SQL block. Oracle architecture confuses me. I could have looped through the varray and inserted each item individually into a SQL statement, but I ended up using the PL/SQL table datatype instead. Maybe one day I’ll get to use the varray. I have, however, been able to learn a lot about associative arrays. It feels good to know about these things.

MVC Adventures Part 2

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.