Friday 25 April 2014

Why I love C#

C# pronounced See-Sharp, a play on the musical note C-Sharp is a strongly typed object oriented programming language developed by Microsoft and is integrated with the .Net framework. Its chief language designer is Anders Hejlsberg but more on C# and Anders Hejlsberg later.

My first introduction to programming was Basic back in high school and it was fascinating. You type a bit of instruction, and something happens on screen, that was the basics of it, no pun intended. Later in the same high school I was introduced to Turbo Pascal and while I do not remember the version, I suspect it might have been version 5.5. Turbo Pascal was love at first sight for me because it was so simple yet seemed so powerful. I was able to do more things in a structured manner and why not, it is a procedural language but did have some object oriented features such as classes and this was called Object Pascal. Later when I studied Engineering at MIT (Manukau Institute of Technology, New Zealand) I bought a package of Borlands Turbo Pascal version 7.0 and it ran on the first computer I ever had, a 486 DX2 66 MHz with 4 MB of ram, WOW!.

I still have my copy of Turbo Pascal and C++ Builder Professional. Turbo Pascal purchased in 1995/1996 and C++ Builder professional Purchased in 2002/2003.
 I did a lot of programming on Turbo Pascal because it was very easy to develop in, to understand, and I became very good at it. I was able to remember most of its standard library units such as CRT, DOS, GRAPH etc and it wasn't case sensitive so a variable: var something : integer; was the same as var Something: Integer;. I wrote a lot of programs in it including one that connected to bulletin boards and displayed the result in ANSI colour, lots of utilities, 3D engine that was a modification of some existing code where the rasterizer etc was already done. There was even a level editor for the 3D engine, a file transfer program, and an attempt to pack data using the 400% text compression with no flow control using the dial-up modems V.42 bis and MNP 5 protocols. Of course that caused data errors because with no flow control there was no way to control the data. A friend and I used this Turbo Pascal program I developed to send a sample test mp3 file. When he received it, he telephoned me and said "I received it but it sounds like turkeys!" and we have been joking about it ever since!

Regardless of what I developed, the point is that it was a lovely language to work with and program in. It wasn't as fast as C or C++ but it was lovely, and it even included the ability to directly inject assembly code. Something I used when developing a sound playing application which played MIDI files on the opl3 FM chip on the Sound Blaster as well as output to MIDI port. It was absolutely a joy to work with Turbo Pascal, however when Delphi came out based off Object Pascal but a fully object oriented language, I unfortunately did not pursue developing in pascal code until many years later when I developed a CD cataloging system in Delphi. I reached a point in my engineering study where I was working with C code and I was beginning to enjoy C code. You see, after developing on the sound blaster using the assembly capability of Turbo Pascal I was beginning to already enjoy assembly language. I was beginning to enjoy the power it was giving me with direct access to hardware registers opening an era of optimization in my programming life. C code was fast and close to assembly language and it was powerful because it felt like I could do absolutely anything with it. A lecturer at MIT best described C code back in that time as "C code looks like pascal printed with incorrect baud rate". Later and in no chronological order I started using and loving C++. To this day I love programming in C++ because it provides the power of C with Object orientation and with the new C++11 standards it now has threading capability. My current 3D engine being developed so I can develop a 3D game for windows phone is using C++ however it is a C++/CX flavor from Microsoft. Later of course Java and C# but I am coming to why I love C# soon.

Developing in these varieties of languages helped me understand conceptual programming languages better and has helped me acquire a skill where I can pickup new development languages fairly quickly, and for those languages which I have not used in a while such as Turbo Pascal, I am able to refresh them extremely fast. However all of these have come to pass but I still loved Turbo Pascal until one day I used C#.

Why do I love C#? It combines the best parts of C++, Delphi, and Java into one beautiful language that is music to me and C# is very well played. It is built for the CLI/CLR and makes it seamless and easy to use the .NET framework. Its later iterations have included LINQ and functional programing that has opened up some amazing capabilities in C#. It is so much easier to implement enumerators, function caching, and functors. The language is absolutely beautiful but the main reason I love C# is because of Anders Hejlsberg. He is my favorite language designer, he was the chief language architect for Turbo Pascal when he worked for Borland, and he is the chief language designer for C# at Microsoft. I love C# because it is influenced by the person I consider the best language designer ever. Infact I do not know why the keyword for auto pointer in C# is "var" but i'll venture a guess that it is his trademark perhaps? If you know why, leave a comment. C++ uses the keyword auto for the auto pointer or smart pointer.

C# is a beautiful language to learn on, to develop on, it has amazing and powerful features, it is a higher level language and these are alone the reasons to love it. 

I will leave you with a youtube video of Anders Hejlsberg I found and I strongly encourage viewing this one hour video titled Behind The Code - Anders Hejlsberg, C# Language Creator


 

No comments :

Post a Comment