Tuesday, August 24, 2010

The World of Windows (C#, F#, VB, .NET)

I haven't been blogging much lately because i've found a new job that requires me to learn new stuff - and this time its not exactly the LAMP stack ;)

So what is it exactly? well its the mysterious world of windows. Like all things, its mysterious because quite simply i have not worked with it previously. But these past few weeks opened my eyes to another platform that i have never considered before. My new employer is receptive to the idea that i lack experience in Windows development but that didn't deter me so i guess its probably why it doesn't deter them :) yay

One of the questions i asked myself is how do i get to speed with C# and the likes? Kachink! I read the ebook Head First C# (i was used to their layout and presentation format, so it works much better for me) and that took me where i wanted to pretty quickly enough. And i thought a very well written book on that subject was Essential C# 4.0 That was done. How about Visual Basic? I looked to Microsoft's MSDN (which is a great resource btw)

For a guy whose done Java,J2EE - you'll probably find C# pretty easy to follow since it was created *supposedly* to be Java's rival :) though the Visual Studio 2010 was packed with lots of goodies that the developer can take advantage of. One cool thing from VS2010 was the fact that it reduce the amount of boilerplate code for accessor/mutator methods so much easier.
Here's an example in VB
Public Class SimpleTest
    ' --- replace the string "newPropertyValue" consistently
    Private newPropertyValue As String
    Public Property NewProperty() As String
        Get
            Return newPropertyValue
        End Get
        Set(ByVal value As String)
            newPropertyValue = value
        End Set
    End Property

End Class
Another example in C#
namespace SimpleHelloWorld
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }
    }
    //
    // Accessor/Mutator methods to hide 'backing' value
    class SimpleTest
    {
        private int state;
        public int GetState
        {
            get { return this.state; }
            set { this.state = value; }
        }
    }
}  
From a learner's point of view, the language's syntax does help make a lot of concepts stick much better and faster since i can quickly identify the commonalities these 2 languages share. Btw, i thought the idea of a 'partial' class was quite nice :) and the idea of namespaces pretty collide with what i understood from C++'s concept of 'namespace'. Of course this is not exhaustive.

From a guy whose done Erlang,Python,Ruby i wonder what F# holds for me? I guess i'll find out soon...

I cannot possibly end this post without mention two Scotts: Scott Gu's Blog and Scott Cate's blog.

My bias is possibly gone as i embrace the new technologies (at least to me)

0 comments: