background preloader

Functional Programming

Facebook Twitter

Why Scala? Before answering the question of "Why Scala?

Why Scala?

", we first need to answer the question "what is Scala? " From the Scala website, the following overview can be found: Scala is a modern multi-paradigm programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It smoothly integrates features of object-oriented and functional languages. Scala is object-oriented: Scala is a pure object-oriented language in the sense that every value is an object.

For some developers, these incentives will be enough to lure you away from Java into the Scala world. Roundup: Scala for Java Refugees. 13 Feb 2008 To be honest, I’m somewhat kicking myself for writing this post.

Roundup: Scala for Java Refugees

As I’ve said many times: roundup posts are for people who are too lazy to write real content. I can’t tell you how many blogs I’ve come across which have a roundup-to-post ratio of easily 3:1. You know it’s a bad sign when sites start having roundups of their roundups… Meta-roundups aside, I decided (after much deliberation) that a single post linking to all six parts of the series would be useful to one or two people. Of course it’s always possible that you subscribe to my way of looking at things. Part 1: main(String[]) Introductory article giving motivation for learning Scala and some first steps to “get your feet wet” in the language. The Scala Programming Language. Erlang Programming Language. Can Your Programming Language Do This? By Joel Spolsky Tuesday, August 01, 2006 One day, you're browsing through your code, and you notice two big blocks that look almost exactly the same.

Can Your Programming Language Do This?

In fact, they're exactly the same, except that one block refers to "Spaghetti" and one block refers to "Chocolate Moose. " // A trivial example: alert("I'd like some Spaghetti! "); alert("I'd like some Chocolate Moose! ") These examples happen to be in JavaScript, but even if you don't know JavaScript, you should be able to follow along. The repeated code looks wrong, of course, so you create a function: function SwedishChef( food ) { alert("I'd like some " + food + "! ") OK, it's a trivial example, but you can imagine a more substantial example.

Now you notice two other blocks of code which look almost the same, except that one of them keeps calling this function called BoomBoom and the other one keeps calling this function called PutInPot. Now you need a way to pass an argument to the function which itself is a function. Look! Lemme repeat that. Excellent Overview of Functional Programming. 14 Feb 2008 I just ran into an article on DZone that totally threw me off my chair in terms of content.

Excellent Overview of Functional Programming

It’s titled (ambitiously enough) “Functional Programming For the Rest of Us“. Basically the article attempts to explain many of the common FP techniques in terms that imperative programmers can understand. More importantly, it motivates these explanations with a long and rambling set of real-world reasons. It’s extremely long, extremely involved and well worth the read. It’s worth noting that the author claims to be presenting his explanations in Java, but is in fact devising an extension of Java to represent FP constructs more concisely. The really interesting bit is how the author motivates FP through a combination of real-world examples and lengthy reasoning. So grab yourself a cup of coffee and a box of donuts (it’ll take you about that long to finish the article), and slog your way through. Introduction. Haskell is a computer programming language.


In particular, it is a polymorphically statically typed, lazy, purely functional language, quite different from most other programming languages. The language is named for Haskell Brooks Curry, whose work in mathematical logic serves as a foundation for functional languages. Haskell is based on the lambda calculus, hence the lambda we use as a logo. 1 Why use Haskell? Writing large software systems that work is difficult and expensive.

WOW! Even if you are not in a position to use Haskell in your programming projects, learning Haskell can make you a better programmer in any language. Functional Programming For The Rest of Us. Monday, June 19, 2006 Introduction Programmers are procrastinators.

Functional Programming For The Rest of Us

Get in, get some coffee, check the mailbox, read the RSS feeds, read the news, check out latest articles on techie websites, browse through political discussions on the designated sections of the programming forums. Rinse and repeat to make sure nothing is missed. Go to lunch. The only thing, every once in a while challenging articles actually do pop up.

I don't know about your list, but a large chunk of the articles in mine are about functional programming. It's true that FP articles and papers are hard to understand, but they don't have to be. So what is FP? A Walk In The Park Fire up the time machine. "Look at these two students", said Plato carefully picking words to make the question educational. Plato smiled.