Language Primer

You have a few language choices available to you as a .NET programmer: Visual Basic, C#, C++, or F# are at the core. There are also user interface (UI)-specific languages and markup syntax, such as JavaScript, HTML, and XAML. Which core language you choose is typically a result of your history, style, and intent. Developers who have worked with past incarnations of Visual Basic or another basic language will find they are at home inside Visual Basic. The language (including templates, tools, wizards, and so on) is all about developer productivity. Developers whose roots are in a C-based language (C++, Java, and so on) and who want similar productivity in a straightforward way gravitate toward C#. Of course, some developers will just want to stay in C++ even for their .NET applications.

Visual Studio 2010 saw the introduction of the F# language. Now part of the full Visual Studio product line, F# 4.0 targets enterprise developers. Similar to other .NET languages, F# supports object-oriented programming. What makes it different is that it is also a functional programming language. Functional programming elevates functions to first-class values. (The F in F# is for functional.) For example, a functional language allows you to easily pass functions as parameters, return functions as the result of a function, chain functions together to create new functions, create recursive functions, and more. These powerful features in F# allow you to more easily tackle complex algorithms with less code (and often less pain) than it would take with the standard object-oriented (OO)-only languages of Visual Basic and C#. Having F# inside of Visual Studio also means that you can leverage the .NET Framework, get the benefits of the Common Language Runtime (CLR) (including calling to and from other .NET code), and have debugging and other related tools support.


Note

F# is both a new language and a new way of programming. You need to spend time to be able to “think” in F#. There is not room in this book to present the language. In addition, most .NET developers still write nearly all their code in Visual Basic or C#. Therefore, we focus on those two languages throughout this book.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset