.NET at 9.400 ft above sea level
Programming in Quito, 2.860 m above sea level
-
Project Euler and functional C#
I think I already talked (a long time ago) about Project Euler: a set of problems, mainly math oriented, keen to be solved with a computer program. To be sure, it's not particularly deep math, but the problems posed go fairly quickly from really easy, to hmm, to challenging. In this sense, they are good programming calisthenics, and may also be a good way of learning a new language. For example, Chris Smith has solved some Project Euler problems using F#, I find the idea intriguing, so I'll try to do the same thing, only that I'll be using C#, but not your plain old C# mind you, as I'll do my best to use in as much as possible the functional facilities of C# 3.0. Let's see for example Problem 1:
-
Eight Silverlight training sessions
A little bit of cross-posting but I find this interesting enough as not to risk you miss it...
-
Tuples: an F# lightweight data structure
Maybe the best thing to do is to start by showing a few examples of tuples:
-
F# doesn't need parenthesis in functions, or does it?
In a previous posting I mentioned that when you define a function in F# you don't need parenthesis surrounding the parameters, or commas separating them. So, this simple definitions are all valid:
-
Word 2007 and Microsoft Math
Reading Alfred Thompson blog, who focus on computer science teaching at K-12 schools (what we call in Ecuador basic high school), I found this nice entry: Microsoft released a few days ago the Word 2007 Math Add-in. After installing and playing with it for just 2 minutes, I was able to create this document:
-
ParallelFX: multi-processing extensions for .NET Framework
It is interesting how new solutions bring new problems: when Intel noticed that Moore's Law was loosing steam, it had to look for a new way of producing ever more powerful computers ¿their solution? Put more CPU's on every chip (the famous multi-core), they started shyly (2 with Core Duo) then they got up to speed (4, 8 CPU's) and now nobody's laughing when someone says that in 10 years home computers will have 32 or 64 CPU's.
-
F# basic function definition syntax
In the comments to this post, Anon and Josh complain about the syntax of F#. On one hand, they've got a point: most programmers are used to notations similar to those of Visual Basic, C# or Java, and for them many of the syntactic details of F# will look weird (or just plainly annoying ;-) ). On the other hand, it's not the case -as Josh suggests- that Microsoft is creating a new language with a purposedly cryptic syntax :-D; actually, F# was designed to follow as much as possible the syntax -and semantics- of OCaml (1996), a popular language in the functional world. OCaml in turn basically offers object-oriented extensions to Caml (1985), which inherits most of its syntax -and semantics- from ML (circa 1973). So, as much as I would like to say that Microsoft has created a whole new language, its more like it is moving the spotlight to a tradition as old (LISP anyone?) as imperative languages themselves, by providing an implementation nicely integrated into .NET Framework.
-
A better way of getting the average salary
Related to my post yesterday in which I tried to show an appealing business sample in F#, David Taylor commented that this:
-
Visual Studio 2008 and F#
Once I downloaded and installed Visual Studio 2008 Team System in this laptop, one of the first things I did was to install F# to see how well it worked in the shiny new IDE. It worked without any hassle and to celebrate I wrote a typical business example: get the average salary of a group of employees.
-
F#: Going from academia and research to the commercial world