Well, the idea of taking a bull by the horns has taken me.
I don’t know if I’ve ever mentioned it, but learning to program things in VB.NET is pretty easy and straightforward. Once you’ve done enough stuff with Visual Basic in its various forms, you get a little familiar with the syntactical requirements and conventions.
But when I started learning VB.NET back in 2004, I really wanted to take on another computer language. It was called C# (pronounced as “C Sharp”, as in a musical note), and was the newest big thing from Microsoft. It was a variety of implementation of Java-esque language. (They had one called J++, which WAS their version of Java, but it died.) I wanted to get into it, and all my books to learn .NET came with both VB and C# code in them. It would be easy, I reasoned; I’ll learn them both, side by side, and have them both bullets in my chamber.
Alas, because I’m a dope, I let someone I didn’t have any reason to listen to convince me it wasn’t a popular language. “No one’s using it,” he told me nine years ago. And here I am, nine years later, not knowing a thing about it because back then, I didn’t bother to focus on C# because…well, no one’s using it. It would probably go the way of Microsoft J++, I further rationalized. I’ll just stick to Visual Basic; it’s not going anywhere.
Flash forward to today. Today, I want to learn how to do things and study different web development technologies, like the Model-View-Controller (MVC) framework implementation of .NET (my buddy Bryce has been working hard to try and get this into my very dense skull), so I can use those cool technologies in my intranet site. You know, stuff like Appmageddon. Or this more recent one which I thought I finished for my boss. He tested it today and has some further requests and clean-up for me to do. (Not an issue, really, but also not as easy as it might’ve been if I could…well, I’ll get to that in a minute.)
So what do I discover? Well, C# is the most in-demand programming language on Earth right now. (Please note: When referring to our planet, rather than to the ground itself or to dirt, the word “earth” is properly capitalized in all style books.) And I don’t know it, because I didn’t bother to learn it back in 2004.
And all the great tutorials I need to help me understand MVC, which will help with rapid web development, and is the most popular web implementation for both intra- and Internet sites right now, are written in…C#.
Now, to be sure, there are a few tutorials out there in VB too, but really, if I want to implement MVC in VB.NET, I’ll need to look over tutorials written in C# and translate them into VB.NET (a very good learning technique, by the bye).
Or, I can learn C#. You know, since it’s raging all over the programming world right now.
I avoided doing it because, frankly, the task seemed daunting. The language is structured differently. The syntax conventions are a bit different. But I don’t have a lot of choice. So, begrudgingly, and with a touch of anger for not being able to stick with my language of choice, I’ve turned my attention to C#.
This isn’t an ideal time. I have Appmageddon due a the end of the month. My boss would like this project he asked for around July 1, too. And I have to transition our customer listing database tables from the disastrous mess they are to a couple of cleaner, nicely normalized tables. Once that’s done, well, hey, far as I can tell I’ve only one more enhancement to my boss’s project to deal with and then I can happily focus on C#.
…unless I’m assigned more projects. What do you think the odds are of that?
But I can’t get anywhere without learning C#. I tried to give up on using the MVC pattern to make Appmageddon work and focus on what I know, what already works. But the fact is, I have data sources all over the network I need to pull together and to save time and produce something decent, I really need to know how it works. Not just for Appmageddon, but for all the other systems I’m going to have to work to bring up to speed. But…
It doesn’t fit right. There are a lot of hurdles to overcome using web forms to do this stuff. Classic ASP, the old technology my predecessor used to build the intranet from scratch, is more flexible in some ways. (He wrote spaghetti code though. And it’s a disaster to maintain. I’ve b!tched about that before, so I’ll drop it there.) But I need something which allows me the flexibility to present data in a concise way without too many restrictions, and which is powerful enough to harness my diverse and dispersed data, and which permits me to reuse a back-end (data access layer, anyone?) so I don’t have to write the same data access code over and over and over on every page which needs it.
Sounds like having reusable models which I can port from one application into another, or more specifically, can direct other applications to, is a primary consideration. And I can present as many views of that data as I’d like.
After a while, it starts to feel like I don’t have any choice. I have to learn MVC to make this happen, and I need to learn C# to have access to the best help in learning C#. So…
C#, here I come.
I cracked it open earlier this week, after throwing my fit about not being able to find any VB.NET material on MVC, and lo! and behold! I LOVE IT.
I suspect having learned some good things in the last year with VB.NET paved a solid road and laid a decent foundation for me to pick up C#. On Tuesday, I wrote a completely trivial C# application which didn’t do anything more than display some text in what’s called a console window (the old DOS window, for those of you who can recall DOS). It’s fine, and it works. And then Wednesday and today, I tweaked an existing program I have to use a code library I built in VB, and wrote the application in C#. Because both are part of the .NET Framework, and because both compile into what’s called the Microsoft Intermediate Language (MSIL), the code written in VB is perfectly accessible and usable in C# programs, and vice versa.
My testing was successful. I could access the database(s) in my C# program using data access code written in my Visual Basic dll. This is a major draw of the development environment Visual Studio and Microsoft have offered, and it’s amazing and wonderful.
You can’t mix code on the same page or in the same code module or class, but I can mix the languages in a project. Which is pretty awesome. I can continue to learn them both, and you know what?
I may have both bullets in my gun’s chamber before long after all.
What’s up for you this weekend?