iOS app Android app

Featuring fresh takes and real-time analysis from HuffPost's signature lineup of contributors
Aaron Contorer

GET UPDATES FROM Aaron Contorer
 

Haskell, the Language Most Likely to Change the Way you Think About Programming

Posted: 11/08/2013 4:28 pm

When asked to rank programming languages based on their strengths and weaknesses, developers ranked Haskell number one for the following statements:

Haskell is highly regarded for its ability to transform the way developers think about programming. Many developers have told us they never really saw the holes in the imperative languages they were using until they started using Haskell. After learning Haskell, they feel more confident their code will work correctly and will have longevity. No other language provides the same perspective altering experience learners of Haskell espouse. Recently the Editor-and-Chief of Dr. Dobb's Journal, Andrew Binstock tweeted "I've noticed several times when someone says 'X really changed the way I think about programming,' frequently X=Haskell."

What is Haskell?

Haskell is the purest functional programming language. Haskell programs are a series of high-level generalizable functions that define what the program is intended to do, letting lower layers (compiler, runtime, and libraries) handle mundane low-level details such as iteration. Its foundation is a strong static type safety and inference system. The compiler enforces the type check and produces clean, concise and correct code with little side effects from the outset. The programmer focuses on results vs. steps. Imperative languages (Java, C family, Python, PHP, Ruby etc.) are based on low-level commands and highly mutable variables that result in spaghetti code with countless interacting side effects. This jumbled code leads to software that isn't reliable, breaks easily, and filled with bugs.

A simple example shows how concise and articulate Haskell code is:

2013-11-08-arronctonrcode118.jpg

Create a list of all even numbers up to 100, and another list omitting the first five of them.

You don't have to be an experienced developer to see how much cleaner and more direct the Haskell code is, and what benefits that might generate. The improvements seen in this trivial example only increase with more complex problems and under maintenance and reuse.

Who Uses Haskell?

Adoption of Haskell is increasing in multiple industries. While Haskell is a general purpose language that can be used in any domain and use case, it is ideally suited for proprietary business logic and data analysis, fast prototyping and enhancing existing software environments with correct code, performance and scalability.

Data-intensive industries such as financial services, Big Pharma and biotech, oil and gas, and online consumer companies are adopting Haskell rapidly. Barclays' "Functional Payout Framework" is written in Haskell. Amgen, a well-known Haskell adoptee, is using Haskell to develop new innovative software services for both doctors and patients. There are also internal Haskell R&D projects at Google, Microsoft, Twitter and Facebook.

Janrain, a user management platform developer, credits Haskell for enabling them to save 75% of the time they spent on bug fixes. They switched their backend from Ruby to an entirely Haskell-based platform. For Bump (recently purchased by Google), Haskell easily enabled them to grow their application from one based on 6-8 cores to more than 250 cores over 70-100 machines. Bump started out on Python, but switched to Haskell after experiencing high errors and spaghetti code that they couldn't reign in. Jamie Turner, lead developer: "The Haskell compiler provides multiyear life of the code other solutions like Python couldn't offer, while scaling up to support millions of users."

Why isn't Haskell More Popular?

To date, Haskell's commercial adoption has been held back by its reputation for being hard to learn, an open-source toolchain that is time consuming to assemble, and lack of a commercial vendor to push for its adoption. This is changing thanks to many success stories like the ones just highlighted. FP Complete, the main commercial Haskell tools and services vendor, is providing several products and services (some free) to bring Haskell to the mainstream market and championing Haskell in general. Its FP Haskell Center is the easiest Haskell IDE and deployment platform as a web service. To reward developers for their work and to spur new tutorials, FP Complete has been running a coding competition with monthly cash prizes. With more and more examples of Haskell success stories coming to light, Haskell's popularity will increase.

Why Should Anyone Learn Haskell?

Of the 51 programming languages listed in the Hammer Principle Programming Languages survey, Haskell was ranked first by 1,821 programmers for this statement, "I would recommend most programmers learn this language, regardless of whether they have a specific need for it." There are a multitude of reasons for developers to learn Haskell. Haskell helps you create better quality software that requires less bug fixes and overall maintenance. If you're a business manager or startup executive, you would benefit greatly from Haskell's rapid prototyping, accelerated time to market and scalability. If you want to write code that is elegant, reusable, that you know works and will continue to work, you should learn Haskell.

How Do I Learn Haskell?

There are many free resources available for people interested in learning Haskell. Haskell.org is an excellent resource as is FP Complete's School of Haskell, which is a free online sandbox full of tutorials where anyone can read, create, edit and compile sample Haskell code. I would also suggest the book Learn You Haskell for Great Good as well as the tutorial Learn Haskell Fast and Hard. YouTube has around 6,810 videos dedicated to Haskell. If learning from peers is easier for you, there are a multitude of functional programming meet-up groups popping up around the world. If you are looking to bring Haskell in-house, FP Complete has a Jumpstart package that includes its software tools, consulting, training and custom development.

Haskell is the future of Software Development

Not everyone will admit or even be aware the current way we develop software is broken. Arguably, billions of dollars could be saved by avoiding excess project failures, bug fixes and maintenance issues. When 50-75% of software projects are consumed by bug fixes and maintenance concerns, can we not agree it is important to see if we can change that? The payoff is huge, and a game changer! It's time to stop believing this is just the way things are and it's time to stop wasting time and money using the wrong tools. Poorly designed code due to the inherent nature of a language is the problem. Haskell is a proven alternative. It is the " language most likely to have a strong influence on future languages," and we believe it is the future of software development.

 
FOLLOW HUFFPOST CODE