10 tips on how to prevent business value risk
One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.
The content has been bookmarked!
There was an error bookmarking this content! Please retry.
Posted by Sadek Drobi on Jan 25, 2009
Around 750 people commented on the online preview of the Real World Haskell book. As described by one of its co-authors, John Goerzen, in a recent interview to O’Reilly, the book introduces Haskell with real code, real examples and tips to exploit in a business environment. In his interview, Goerzen explains why, in his opinion, this language is worth learning; he provides insights into its specificities and addresses some issues that may be a source of reluctance.
John Goerzen admits that Haskell requires a lot of re-learning of basics and identifies purity and laziness as the biggest mind-shifts for people coming from imperative and/or object oriented programming.
He highlights that in Haskell, “the things that can possibly change the state of the world are tightly isolated” and “marked with the type system”. This helps avoiding an important number of implementation bugs since impure elements of code are statically typed and errors can be indentified at a compile time, which differentiates Haskell from languages like Python. Purity also facilitates testing, for instance through QuickCheck, especially if the program is structured around a lot of small functions combined together.
Another central notion in Haskell is laziness. While asked as to “where does laziness help real world programs?” John Goerzen stresses how it relates to I/O:
If I write a little filter or parser program in Haskell, I don't have to really worry about the details of reading the input line-by-line or block-by-block because I can just use getContents and then I can string together a whole bunch of functions. I like writing Unix filters in Haskell.
[…]Once you have the laziness on the input, you have the laziness on the output because printing something doesn't require it all to be evaluated all at once. […]
You wind up with a program that is a very simple design because you're not having to deal with buffering or iterating over lines or what not and yet, runs in constant space.
John Goerzen also talks about benefits of Haskell in terms of expressiveness, achieved by pattern matching and the fact that functions can express things in succinct but readable way making it easier to state a problem and, then, “to reason about the logic” that is clearly identifiable. Moreover, as highlighted by the interviewer, one can “build a vocabulary of functions or words and then you write your solution in the language of that vocabulary”. Haskell, indeed, manipulates “functions as easily as Perl manipulates strings”, says Goerzen.
However, some features of this language may be a source of reluctance for people coming from OO or/and imperative programming. The recursive approach, for example, “can be a little bit scary” since “incrementing a variable is a pretty cheap operation” in languages like C. Nevertheless, Goerzen asserts that, even though “higher level languages tend to not be quite as fast as C”, GHC compiler that rewrites from recursion into iteration, “is pretty efficient at optimizing what you express in recursive terms into a format that's fairly efficient for the CPU.”
One can also believe that laziness trades “the ability to reason about types and purity and such for the inability to reason about time and space complexity”. John Goerzen prefers to put it into perspective:
[It is] just like if I'm looking at a program in whatever other language […]that tries to read in an entire file all at once and then process it. […] You'd open a file; you could call read, and it could read an entire file for you into memory if you like. Some people would do this expecting that maybe they're only dealing with files that are 100K or something. You try to give them a file that's 2 gig and that approach doesn't quite work anymore.
Based on his experience, John also refutes the belief that that Haskell IO system is poor and difficult to learn. According to him, the thing that scares probably most in Haskell are monads but he stresses that one “can write a perfectly good Haskell program that deals with IO without having to be terribly bothered by what monads are or what they do”. To use the IO monad, one does not have to understand monads but can simply consider it as “this kind of box that separates out the pure from the impure code”.
More generally speaking, John Goerzen believes that even though there is “a little bit of a learning curve on what are things called in Haskell”, learning is facilitated because “the types of functions tell you an awful lot about what they do”. Discovering Haskell is, according to him, a “mind-opening experience” and even if this language is not going to become the next big thing, “it's something that's different and interesting and worth learning some about anyhow.”
SOA All-In-One Guide: KPIs & Best Practices, ESB Report
A practical guide to choosing the right agile tools
Mobile and the New Two-Tiered Web Architecture
Improve Java Garbage Collection, Runtime Execution, and JVM visibility with Zing
One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.
InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.
Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.
John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.
Sean Comerford unveils ESPN.com’s architecture, what components are used and why, and the current changes the website goes through.
Are there repeated patterns of failure on Enterprise Agile Enablement efforts? Sanjiv and Arlen discuss Seven Deadly Sins to avoid when adopting Agile in an enterprise.
Erik Dörnenburg answers: What is Enterprise and Evolutionary Architecture?, discussing 4 issues: Turning strategy into execution, Ensuring conformance, Where do the architects sit? Buying or building?
Sean Cribbs explains what Map-Reduce and Riak are, why and how to use Map-Reduce with Riak, and how to convert SQL queries into their Map-Reduce equivalents.
2 comments
Watch Thread Reply