73
How to boost your OOP with FP Uberto Barbini @ramtop Saturday, November 19, 11

Boost your-oop-with-fp

Embed Size (px)

Citation preview

Page 1: Boost your-oop-with-fp

How to boost your OOP with FP

Uberto Barbini@ramtop

Saturday, November 19, 11

Page 2: Boost your-oop-with-fp

About me

Uberto Barbini

Software artisan

Agile enthusiast.

Hobby: photography and the game of Go.

http://www.flickr.com/photos/uberto

Team leader and Architect for Vodafone editorial and backend products.

Saturday, November 19, 11

Page 3: Boost your-oop-with-fp

What if OOP was wrong?

http://www.flickr.com/photos/mbshane

Saturday, November 19, 11

Page 4: Boost your-oop-with-fp

What if OOP was wrong?

http://www.flickr.com/photos/mbshane

OOP is only a tool, we need to keep it sharp we need to learn other tools

Saturday, November 19, 11

Page 5: Boost your-oop-with-fp

What if OOP was wrong?

http://www.flickr.com/photos/mbshane

OOP is only a tool, we need to keep it sharp we need to learn other tools

Caution, this presentation can contain trace of Philosophy

Saturday, November 19, 11

Page 6: Boost your-oop-with-fp

[email protected]

I would like topay my tribute to

for their contribution toSoftware Engineering

Saturday, November 19, 11

Page 7: Boost your-oop-with-fp

Bugs

http://www.flickr.com/photos/staflo/

Saturday, November 19, 11

Page 8: Boost your-oop-with-fp

Bugs

• cause of delays and frustration

• many are easy to fix

• some cause big problems

• the worst ones are caused by...

http://www.flickr.com/photos/staflo/

Saturday, November 19, 11

Page 9: Boost your-oop-with-fp

State

• Foundation of behavior

• Hidden from outside

• Should be defended like a castle

Saturday, November 19, 11

Page 10: Boost your-oop-with-fp

Where is the state?

http://fractalforge.cvs.sourceforge.net/viewvc/fractalforge/fractalforge/Mandelbrot.pas?view=markup

Easy to understand what it does.Hard to understand why it does it.

Saturday, November 19, 11

Page 11: Boost your-oop-with-fp

public class NameAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String target = new String("success"); if (form != null) { // Use the NameForm to get the request parameters NameForm nameForm = (NameForm) form; String name = nameForm.getName(); } // if no mane supplied Set the target to failure if (name == null) { target = new String("failure"); } else { request.setAttribute("NAME", name); } return (mapping.findForward(target)); }}

The new procedural

Saturday, November 19, 11

Page 12: Boost your-oop-with-fp

public class NameAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String target = new String("success"); if (form != null) { // Use the NameForm to get the request parameters NameForm nameForm = (NameForm) form; String name = nameForm.getName(); } // if no mane supplied Set the target to failure if (name == null) { target = new String("failure"); } else { request.setAttribute("NAME", name); } return (mapping.findForward(target)); }}

Frameworks make easy to keep writing procedural code in OO fashion

The new procedural

Saturday, November 19, 11

Page 13: Boost your-oop-with-fp

Procedural paradigm

Saturday, November 19, 11

Page 14: Boost your-oop-with-fp

Procedural paradigm

Saturday, November 19, 11

Page 15: Boost your-oop-with-fp

• Easy to write

• Hard to understand

• Global state

Procedural paradigm

Saturday, November 19, 11

Page 16: Boost your-oop-with-fp

http://www.flickr.com/photos/hatm

Saturday, November 19, 11

Page 17: Boost your-oop-with-fp

Recipe:“We are pragmatic about code quality”

http://www.flickr.com/photos/hatm

Saturday, November 19, 11

Page 18: Boost your-oop-with-fp

Saturday, November 19, 11

Page 19: Boost your-oop-with-fp

John McCarthy

Saturday, November 19, 11

Page 20: Boost your-oop-with-fp

John McCarthy

• LISt ProcessingakaLots of Irritating Superfluous Parenthesis

• S-Expressions func(x,y) => (func, x, y)

• Homoiconic (metaprogramming++)

• Laziness parameter evaluation

Saturday, November 19, 11

Page 21: Boost your-oop-with-fp

John McCarthy

• LISt ProcessingakaLots of Irritating Superfluous Parenthesis

• S-Expressions func(x,y) => (func, x, y)

• Homoiconic (metaprogramming++)

• Laziness parameter evaluation

Homoiconic“Clojure macro example: AND”(defmacro and ([] true) ([x] x) ([x & rest] `(let [and# ~x] (if and# (and ~@rest) and#))))

Saturday, November 19, 11

Page 22: Boost your-oop-with-fp

(ns bowling-game (:use clojure.contrib.seq-utils))

(defn strike? [rolls] (= 10 (first rolls)))

(defn spare? [rolls] (= 10 (apply + (take 2 rolls))))

(defn balls-to-score "How many balls contribute to this frame's score?" [rolls] (cond (strike? rolls) 3 (spare? rolls) 3 :else 2))

(defn frame-advance "How many rolls should be consumed to advance to the next frame?" [rolls] (if (strike? rolls) 1 2))

(defn frames "Converts a sequence of rolls to a sequence of frames" [rolls] (when-let [rolls (seq rolls)] (lazy-seq (cons (take (balls-to-score rolls) rolls) (frames (drop (frame-advance rolls) rolls))))))

(defn score-frame [frame] (reduce + frame))

(defn score-game "Score a bowling game, passed as a sequence of rolls." [rolls] (reduce + (map score-frame (take 10 (frames rolls)))))

Clojure the modern Lisp

Saturday, November 19, 11

Page 23: Boost your-oop-with-fp

Saturday, November 19, 11

Page 24: Boost your-oop-with-fp

Alan Kay

Saturday, November 19, 11

Page 25: Boost your-oop-with-fp

Alan Kay

• The best way to predict the future is to invent it.

• Possibly the only real object-oriented system in working order. (About Internet)

• The greatest single programming language ever designed. (About Lisp programming language)

Saturday, November 19, 11

Page 26: Boost your-oop-with-fp

bonusFrame ^self spare or: [self strike]

strike ^self roll1 = 10

spare ^self roll1 < 10 and: [ self roll1 + self roll2 = 10].

roll1 ^rolls at: frameStart

roll2 ^rolls at: frameStart + 1

roll3 ^rolls at: frameStart + 2

frameScore | frameScore | frameScore := self roll1 + self roll2. self bonusFrame ifTrue: [ frameScore := frameScore + self roll3 ]. ^frameScore

updateFrameStart self strike ifTrue: [ frameStart := frameStart + 1] ifFalse: [ frameStart := frameStart + 2]

score 10 timesRepeat: [score := score + self frameScore. self updateFrameStart]. ^score

initialize rolls := OrderedCollection new. score := 0. frameStart := 1. ^self

Smalltalk

an elegant weapon

for a more civilized

age

Saturday, November 19, 11

Page 27: Boost your-oop-with-fp

bonusFrame ^self spare or: [self strike]

strike ^self roll1 = 10

spare ^self roll1 < 10 and: [ self roll1 + self roll2 = 10].

roll1 ^rolls at: frameStart

roll2 ^rolls at: frameStart + 1

roll3 ^rolls at: frameStart + 2

frameScore | frameScore | frameScore := self roll1 + self roll2. self bonusFrame ifTrue: [ frameScore := frameScore + self roll3 ]. ^frameScore

updateFrameStart self strike ifTrue: [ frameStart := frameStart + 1] ifFalse: [ frameStart := frameStart + 2]

score 10 timesRepeat: [score := score + self frameScore. self updateFrameStart]. ^score

initialize rolls := OrderedCollection new. score := 0. frameStart := 1. ^self

Smalltalk

an elegant weapon

for a more civilized

age

Saturday, November 19, 11

Page 28: Boost your-oop-with-fp

Basically, an object type looks like a record type with additional fields including procedure fields and also optional keywords which indicate the scope of the fields.

What is OOP?

Saturday, November 19, 11

Page 29: Boost your-oop-with-fp

Basically, an object type looks like a record type with additional fields including procedure fields and also optional keywords which indicate the scope of the fields.

Lazarus (Object Pascal) wiki

What is OOP?

Saturday, November 19, 11

Page 30: Boost your-oop-with-fp

Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction, encapsulation, messaging, modularity, polymorphism, and inheritance.

What is OOP?

Saturday, November 19, 11

Page 31: Boost your-oop-with-fp

Edsger W. Dijkstra

Saturday, November 19, 11

Page 32: Boost your-oop-with-fp

Edsger W. Dijkstra

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. - 1975

Saturday, November 19, 11

Page 33: Boost your-oop-with-fp

Edsger W. Dijkstra

Saturday, November 19, 11

Page 34: Boost your-oop-with-fp

Edsger W. Dijkstra

Object-oriented programming is an exceptionally bad idea which could only have originated in California.

Saturday, November 19, 11

Page 35: Boost your-oop-with-fp

Edsger W. Dijkstra

I don't know how many of you have ever met Dijkstra, but you probably know that arrogance in computer science is measured in nano-Dijkstras. Alan Kay.

Object-oriented programming is an exceptionally bad idea which could only have originated in California.

Saturday, November 19, 11

Page 36: Boost your-oop-with-fp

OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I'm not aware of them. (email 23/07/2003)

Alan Kay

http://www.flickr.com/photos/marcospiller

Saturday, November 19, 11

Page 37: Boost your-oop-with-fp

OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I'm not aware of them. (email 23/07/2003)

Alan Kay

I thought of objects being like biological cells and/or individual computers on a network, only able to communicate with messages (so messaging came at the very beginning -- it took a while to see how to do messaging in a programming language efficiently enough to be useful).

http://www.flickr.com/photos/marcospiller

Saturday, November 19, 11

Page 38: Boost your-oop-with-fp

  The venerable master Qc Na was walking with his student, Anton.  Hoping toprompt the master into a discussion, Anton said "Master, I have heard thatobjects are a very good thing - is this true?"  Qc Na looked pityingly athis student and replied, "Foolish pupil - objects are merely a poor man'sclosures."

  Chastised, Anton took his leave from his master and returned to his cell,intent on studying closures.  He carefully read the entire "Lambda: TheUltimate..." series of papers and its cousins, and implemented a smallScheme interpreter with a closure-based object system.  He learned much, andlooked forward to informing his master of his progress.

  On his next walk with Qc Na, Anton attempted to impress his master bysaying "Master, I have diligently studied the matter, and now understandthat objects are truly a poor man's closures."  Qc Na responded by hittingAnton with his stick, saying "When will you learn? Closures are a poor man's object."  At that moment, Anton became enlightened.

Saturday, November 19, 11

Page 39: Boost your-oop-with-fp

  The venerable master Qc Na was walking with his student, Anton.  Hoping toprompt the master into a discussion, Anton said "Master, I have heard thatobjects are a very good thing - is this true?"  Qc Na looked pityingly athis student and replied, "Foolish pupil - objects are merely a poor man'sclosures."

  Chastised, Anton took his leave from his master and returned to his cell,intent on studying closures.  He carefully read the entire "Lambda: TheUltimate..." series of papers and its cousins, and implemented a smallScheme interpreter with a closure-based object system.  He learned much, andlooked forward to informing his master of his progress.

  On his next walk with Qc Na, Anton attempted to impress his master bysaying "Master, I have diligently studied the matter, and now understandthat objects are truly a poor man's closures."  Qc Na responded by hittingAnton with his stick, saying "When will you learn? Closures are a poor man's object."  At that moment, Anton became enlightened.

Anton van Straaten 4 June 2003

Saturday, November 19, 11

Page 40: Boost your-oop-with-fp

Saturday, November 19, 11

Page 41: Boost your-oop-with-fp

Yun Tung Lao - The Art of Objects - Addison Wesley

Saturday, November 19, 11

Page 42: Boost your-oop-with-fp

Bruce Eckel - Thinking in Java

The object-oriented approach goes a step further by providing tools for the programmer to represent elements in the problem space. This representation is general enough that the programmer is not constrained to any particular type of problem. We refer to the elements in the problem space and their representations in the solution space as “objects.” (You will also need other objects that don’t have problem-space analogs.) The idea is that the program is allowed to adapt itself to the lingo of the problem by adding new types of objects, so when you read the code describing the solution, you’re reading words that also express the problem. This is a more flexible and powerful language abstraction than what we’ve had before. Thus, OOP allows you to describe the problem in terms of the problem, rather than in terms of the computer where the solution will run.

Saturday, November 19, 11

Page 43: Boost your-oop-with-fp

An object has state, behavior, and identity - Grady Booch

Saturday, November 19, 11

Page 44: Boost your-oop-with-fp

An object has state, behavior, and identity - Grady Booch

OOP fundamentals: Ignorance Apathy Selfishness Kevlin Henney (Will The Real Oop Please Stand Up)

Saturday, November 19, 11

Page 45: Boost your-oop-with-fp

Half presentation check

Summary so far:

1. The worst bugs are related to state

2. Procedural paradigm doesn’t care much

3. Functional paradigm expel state from functions

4. OOP (the real one) encapsule state in Objects

Saturday, November 19, 11

Page 46: Boost your-oop-with-fp

Do I smell spaghetti?

Saturday, November 19, 11

Page 47: Boost your-oop-with-fp

Saturday, November 19, 11

Page 48: Boost your-oop-with-fp

Why singleton?

Saturday, November 19, 11

Page 49: Boost your-oop-with-fp

Why singleton?Strategy without DI

is pointless

Saturday, November 19, 11

Page 50: Boost your-oop-with-fp

Why singleton?Strategy without DI

is pointless

This is worse than procedural!Saturday, November 19, 11

Page 51: Boost your-oop-with-fp

Why singleton?Strategy without DI

is pointless

the real problem is that many

people believe this is good OOP

because there are

many objects,

interfaces, patterns.

This is worse than procedural!Saturday, November 19, 11

Page 52: Boost your-oop-with-fp

DDDEric Evans

• Many objects are not fundamentally defined by their attributes but rather by a thread of continuity and identity An object defined primarily by its identity is called an ENTITY. p.91

• When you care only about the attributes of an element of the model, classify it as a value object. Threat the VALUE OBJECT as immutable. Don’t give it any identity and avoid the design complexities necessary to maintain ENTITIES. p.97

• Place as much of the logic of the program as possible in functions, operation that returns results with no observable side effects. p. 251

Saturday, November 19, 11

Page 53: Boost your-oop-with-fp

197 7 A C M T u r i n g A w a r d L e c t u r e

The 1977 ACM Turing Award was presented to John Backus at the ACM Annual Conference in Seattle, October 17. In intro- ducing the recipient, Jean E. Sammet, Chairman of the Awards Committee, made the following comments and read a portion of the final citation. The full announcement is in the September 1977 issue of Communications, page 681.

"Probably there is nobody in the room who has not heard of For t ran and most of you have probably used it at least once, or at least looked over the shoulder of someone who was writing a For. t ran program. There are probably almost as many people who have heard the letters BNF but don' t necessarily know what they stand for. Well, the B is for Backus, and the other letters are explained in the formal citation. These two contributions, in my opinion, are among the half dozen most important technical contributions to the computer field and both were made by John Backus (which in the For t ran case also involved some col- leagues). It is for these contributions that he is receiving this year's Turing award.

The short form of his citation is for 'profound, influential, and lasting contributions to the design of practical high-level programming systems, notably through his work on Fortran, and for seminal publication of formal procedures for the specifica- tions of programming languages.'

The most significant part of the full citation is as follows: ' . . . Backus headed a small IBM group in New York City

during the early 1950s. The earliest product of this group's efforts was a high-level language for scientific and technical corn-

putations called Fortran. This same group designed the first system to translate For t ran programs into machine language. They employed novel optimizing techniques to generate fast machine-language programs. Many other compilers for the lan- guage were developed, first on IBM machines, and later on virtu- ally every make of computer. For t ran was adopted as a U.S. national standard in 1966.

During the latter part of the 1950s, Backus served on the international committees which developed Algol 58 and a later version, Algol 60. The language Algol, and its derivative com- pilers, received broad acceptance in Europe as a means for de- veloping programs and as a formal means of publishing the algorithms on which the programs are based.

In 1959, Backus presented a paper at the UNESCO confer- ence in Paris on the syntax and semantics of a proposed inter- national algebraic language. In this paper, he was the first to employ a formal technique for specifying the syntax of program- ming languages. The formal notation became known as B N F - standing for "Backus Normal Form," or "Backus Naur Form" to recognize the further contributions by Peter Naur of Denmark.

Thus, Backus has contributed strongly both to the pragmatic world of problem-solving on computers and to the theoretical world existing at the interface between artificial languages and computational linguistics. For t ran remains one of the most widely used programming languages in the world. Almost all programming languages are now described with some type of formal syntactic definition.' "

Can Programming Be Liberated from the von Neumann Style? A Functional Style and Its Algebra of Programs John Backus IBM Research Laboratory, San Jose

General permission to make fair use in teaching or research of all or part of this material is granted to individual readers and to nonprofit libraries acting for them provided that ACM's copyright notice is given and that reference is made to the publication, to its date of issue, and to the fact that reprinting privileges were granted by permission of the Association for Computing Machinery. To otherwise reprint a figure, table, other substantial excerpt, or the entire work requires specific permission as does republication, or systematic or multiple reproduc- tion.

Author's address: 91 Saint Germain Ave., San Francisco, CA 94114. © 1978 ACM 0001-0782/78/0800-0613 $00.75

613

Conventional programming languages are growing ever more enormous, but not stronger. Inherent defects at the most basic level cause them to be both fat and weak: their primitive word-at-a-time style of program- ming inherited from their common ancestor- - the von Neumann computer, their close coupling of semantics to state transitions, their division of programming into a world of expressions and a world of statements, their inability to effectively use powerful combining forms for building new programs from existing ones, and their lack of useful mathematical properties for reasoning about programs.

An alternative functional style of programming is founded on the use of combining forms for creating programs. Functional programs deal with structured data, are often nonrepetitive and nonrecursive, are hier- archically constructed, do not name their arguments, and do not require the complex machinery of procedure declarations to become generally applicable. Combining forms can use high level programs to build still higher level ones in a style not possible in conventional lan- guages.

Communications August 1978 of Volume 2 i the ACM Number 8

Saturday, November 19, 11

Page 54: Boost your-oop-with-fp

Mark Needham

I’m beginning to think that the combination of functional and object oriented programming actually results in code which I think is more expressive and easy to work with than code written only with an object oriented approach in mind.

The functional mindset seems to be more about considering the problem as a whole and then working out how we can simplify that problem from the outside in which is a bit of a paradigm shift. I don’t think I’ve completely made but it can certainly lead to solutions which are much easier to understand. - blog April 2009

Saturday, November 19, 11

Page 55: Boost your-oop-with-fp

http://www.flickr.com/photos/dirtyf

Saturday, November 19, 11

Page 56: Boost your-oop-with-fp

The Functional eye

http://www.flickr.com/photos/dirtyf

Saturday, November 19, 11

Page 57: Boost your-oop-with-fp

The Functional eye

• Immutable structured values (messages)

• Never unready or null objects (a keyword)

• Use of pure functions (no side effect)

• Closures to decouple (or inner classes)

http://www.flickr.com/photos/dirtyf

Saturday, November 19, 11

Page 58: Boost your-oop-with-fp

Saturday, November 19, 11

Page 59: Boost your-oop-with-fp

The ObjectOriented eye

Saturday, November 19, 11

Page 60: Boost your-oop-with-fp

The ObjectOriented eye

• Dependency Injection

• No getters for mutable state

• Interfaces for collaborators (Liskov)

• Simpler aggregates (Demeter)

• Meaningful name convention

Saturday, November 19, 11

Page 61: Boost your-oop-with-fp

protected void processRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException {

log.info("Processing request " + httpServletRequest.getRequestURI()); HttpCallClock clock = new HttpCallClock();

MyRequest request = createRequest(httpServletRequest);

MyResponse response = prepareResponse(getContentService(), request);

translateResponse(response, httpServletResponse);

long elapsed = clock.getElapsedTime(); log.info("Processed in " + elapsed + " ms. " + httpServletRequest.getRequestURI()); accessLog.info(AccessLog.getRequestLog(httpServletRequest, elapsed, response.getStatus(), response.getResponseContentLength()));

}

Just an example:

Saturday, November 19, 11

Page 62: Boost your-oop-with-fp

protected MyResponse prepareResponse(MyRequestConfiguration myConfiguration) { String opco = myConfiguration.getOpco(); Device device = VIRTUAL_DEVICE;

if (myConfiguration.isTacPresent()) { DeviceResponse devicesResponse = getDeviceResponse(opco, myConfiguration.getPublishType());

if (devicesResponse.isErrorResponse()) { return new ResponseWithError(devicesResponse.getHttpStatusCode(), devicesResponse.getMessage()); }

if (!devicesResponse.isDevicePresentByTac(myConfiguration.getTac())) { return new ResponseWithError(SC_NOT_FOUND, "device with tac code: " + myConfiguration.getTac() + " not found"); } device = devicesResponse.getDeviceByTac(); }

DatastoreResponse responseFromDatastore = getDashboards(device, myConfiguration.getPublishType(), opco); if (responseFromDatastore.isErrorResponse()) { return new ResponseWithError(responseFromDatastore.getHttpStatusCode(), responseFromDatastore.getMessage()); }

return retrieveResponseAccordingUrl(myConfiguration, responseFromDatastore.getDashboards()); }

Another example:

Saturday, November 19, 11

Page 63: Boost your-oop-with-fp

Object Design Rebecca Wirfs-Brock

Control

• Centralized

• Dispersed

• Delegated

Saturday, November 19, 11

Page 64: Boost your-oop-with-fp

Centralized

Invoice

Customer

Printer

Manager

Invoice

Saturday, November 19, 11

Page 65: Boost your-oop-with-fp

Centralized

Invoice

Customer

Printer

Manager

Invoice

Martin Fowler: (http://martinfowler.com/bliki/AnemicDomainModel.html)The basic symptom of an Anemic Domain Model is that at first blush it looks like the real thing. [...] The catch comes when you look at the behavior, and you realize that there is hardly any behavior on these objects, making them little more than bags of getters and setters. [...] The key point here is that the Service Layer is thin - all the key logic lies in the domain layer.

Saturday, November 19, 11

Page 66: Boost your-oop-with-fp

Dispersed

Customer Items

Printer

Popular with Zombie objects (aka Hibernated beans)

Invoice

Saturday, November 19, 11

Page 67: Boost your-oop-with-fp

Delegated

Printer

InvoicePrinter

InvoiceFetcher

CustomerFetcher

Invoice

Customer

LogicEntity

IdentityValue

ImmutableNo Id

Saturday, November 19, 11

Page 68: Boost your-oop-with-fp

The valley of comfort

http://www.flickr.com/photos/lviggiano

Saturday, November 19, 11

Page 69: Boost your-oop-with-fp

The valley of comfort

http://www.flickr.com/photos/lviggiano

Elegance and familiarity are orthogonal Rich Hickey on #Clojure

Saturday, November 19, 11

Page 70: Boost your-oop-with-fp

The valley of comfort

http://www.flickr.com/photos/lviggiano

A Conversation with Ward Cunningham, Part III (5 January 2004)

The Accidental Architecture

I like the notion of working the program, like an artist works a lump of clay. An artist wants to make a sculpture, but before she makes the sculpture, she just massages the clay.[...] In a sense we get the architecture without really trying. All the decisions in the context of the other decisions simply gel into an architecture.

Elegance and familiarity are orthogonal Rich Hickey on #Clojure

Saturday, November 19, 11

Page 71: Boost your-oop-with-fp

The valley of comfort

http://www.flickr.com/photos/lviggiano

A Conversation with Ward Cunningham, Part III (5 January 2004)

The Accidental Architecture

I like the notion of working the program, like an artist works a lump of clay. An artist wants to make a sculpture, but before she makes the sculpture, she just massages the clay.[...] In a sense we get the architecture without really trying. All the decisions in the context of the other decisions simply gel into an architecture.

Elegance and familiarity are orthogonal Rich Hickey on #Clojure

There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies. [C.A.R. Hoare]

Saturday, November 19, 11

Page 72: Boost your-oop-with-fp

The journey to the valley

• What about domain

• What about tests

• What about mocks

• What about refactoring

http://www.flickr.com/photos/bobcatnorth

Saturday, November 19, 11

Page 73: Boost your-oop-with-fp

Open questions

• Do we need a yet another new language?

• Can we have Architects?

• How to teach design?

Saturday, November 19, 11