SlideShare a Scribd company logo
1 of 25
Download to read offline
Polyglot Micro-Services
with a Dash of
Wittgenstein
Charles Pletcher
@brophocles
4 July 2015 at PolyConf
Ludwig Wittgenstein
1889 - 1951
Austrian-British Philosopher
A is building with building stones: there are
blocks, pillars, slabs, and beams. B has to pass
him the stones and to do so in the order in which
A needs them. For this purpose they make use of
a language consisting of the words “block,”
“pillar,” “slab,” “beam.” A calls them out; B brings
the stone which he has learnt to bring at such-
and-such a call. — Conceive of this as a
complete primitive language. 

(Wittgenstein, PI, §2)
A B ?
“block”
“pillar”
“slab”
<block>
<pillar>
<slab>
“beam”
<beam>
1. How does data’s meaning change from one context
to another?
2. How do we figure out what data means in a given
context?
3. What can we do about it?
1. Data’s meaning changes from context to context.
2. We can describe data in a given context
3. There are tools and techniques at our disposal to
mitigate confusion.
• Chuck Pletcher
• Software Engineering at Assembly (https://
assembly.com)
• Not a philosopher
When they (grown-ups) named some object and at the same
time turned towards it, I perceived this, and I grasped that the
thing was signified by the sound they uttered, since they meant
to point it out. This, however, I gathered from their gestures, the
natural language of all peoples, the language that by means of
facial expression and the play of eyes, of the movements of the
limbs and the tone of voice, indicates the affections of the soul
when it desires, or clings to, or rejects, or recoils from,
something. In this way, little by little, I learnt to understand what
things the words, which I heard uttered in their respective
places in various sentences, signified. And once I got my
tongue around these signs, I used them to express my wishes.

(Augustine, Confessions I. 8)
2.1 We make to ourselves pictures of facts. 

2.11  The picture presents the facts in logical space, the existence
and non-existence of atomic facts. 

2.12  The picture is a model of reality. 

2.13  To the objects correspond in the picture the elements of the
picture. 

2.131 The elements of the picture stand, in the picture, for the
objects. 

2.14 The picture consists in the fact that its elements are combined
with one another in a definite way. 

2.141 The picture is a fact.

(Wittgenstein, Tractatus Logico-Philosophocus)
Someone suddenly sees something which he
does not recognize (it may be a familiar object,
but in an unusual position or lighting); the lack of
recognition perhaps lasts only a few seconds. 

(Wittgenstein, PI, Part II, §141)
Is it correct to say that he has a different visual experience
from someone who recognized the object straightaway?

	 Couldn’t someone describe an unfamiliar shape that
appeared before him just as accurately as I, to whom it is
familiar? And isn’t that the answer?

(Wittgenstein, PI, Part II, §§141-142)
Duckrabbit Typing
A B ?
“block”
“pillar”
“slab”
<block>
<pillar>
<slab>
“beam”
<beam>
import React from 'react'
export default function connectToStores(...stores) {
return function(Component) {
return class StoreConnection extends React.Component {
static willTransitionTo(transition, params, query) {
Component.willTransitionTo &&
Component.willTransitionTo(transition, params, query)
}
constructor(props) {
super(props)
this.state = Component.getPropsFromStores(props)
this.handleStoresChanged = this.handleStoresChanged.bind(this)
}
render() {
return <Component {...this.props} {...this.state} ref="component" />;
}
componentDidMount() {
stores.forEach(store =>
store.addChangeListener(this.handleStoresChanged)
);
}
componentWillUnmount() {
stores.forEach(store =>
store.removeChangeListener(this.handleStoresChanged)
);
}
handleStoresChanged() {
this.setState(Component.getPropsFromStores(this.props))
}
// for testing
static get Component() {
return Component
}
}
}
}
https://medium.com/@dan_abramov/mixins-are-dead-long-live-higher-order-components-94a0d2f9e750
Render the target Component
along with any props and state
Attach listeners to each of the
Component’s stores (declared
in the call to this decorator)
Think of this as ReactRouter
sugar — it’s not super
important for our purposes, but
I’ll explain it if you want
import AvailableUsernameInputActions from 'actions/AvailableUsernameInputActions'
import AvailableUsernameInputStore from 'stores/AvailableUsernameInputStore'
import classnames from 'classnames'
import connectToStores from 'lib/connectToStores.jsx'
import React from 'react'
@connectToStores(AvailableUsernameInputStore)
export default class AvailableUsernameInput extends React.Component {
static getPropsFromStores(props) {
return { valid: AvailableUsernameInputStore.isValid(props.id) }
}
static defaultProps = {
id: 'available-input'
}
componentDidMount() {
AvailableUsernameInputActions.validate(this.props.id, this.props.value)
}
constructor(props) {
super(props)
this.handleChange = this._handleChange.bind(this)
}
render() {
const classes = classnames(this.props.className, {
'is-error': this.props.valid === false
})
return (
<div className="clearfix">
<input {...this.props}
className={classes}
onChange={this.handleChange} />
{this.renderMessage()}
</div>
)
}
renderMessage() {
const { valid, value } = this.props
// `valid` can be `null`, in which case we do nothing
if (valid === false) {
return (
<small className="red left mt1">
{value} is taken. Try again!
</small>
)
}
return null
}
_handleChange(e) {
AvailableUsernameInputActions.validate(this.props.id, e.target.value)
this.props.onChange && this.props.onChange(e)
}
}
Pass any changes off to
action creators.
`valid` is ultimately the prop
that we care about
@AuthenticatedMixin()
@connectToStores(HighlightsStore)
export default class HighlightPicker extends React.Component {
static getPropsFromStores(props) {
return {
highlights: HighlightsStore.all(),
page: HighlightsStore.page,
moreAvailable: HighlightsStore.moreAvailable
}
}
static defaultProps = {
changelogId: RouterContainer.changelogSlug()
}
constructor(props) {
super(props)
this.onScrollBottom = this._onScrollBottom.bind(this)
}
render() {
const changelogId = this.props.changelogId
return (
<div className="bg-white">
{this.renderPaginator()}
{…}
{this.renderHighlights()}
</div>
)
}
renderHighlights() {
const filter = RouterContainer.get().getCurrentParams().filter
return List(this.props.highlights).filter(highlight => {
if (filter !== 'mine') { return true }
return List(highlight.mentioned_users).some((user) => {
return user.username === SessionStore.user.username
})
}).sortBy(highlight => -highlight.occurred_at).map((highlight) => {
return <div className="border-bottom" key={highlight.id}>
<Highlight highlight={highlight} />
</div>
})
}
renderPaginator() {
if (this.props.moreAvailable) {
return <ScrollPaginator page={this.props.page}
onScrollBottom={this.onScrollBottom} />
}
}
_onScrollBottom() {
HighlightActions.fetchAll(this.props.changelogId, this.props.page + 1)
}
}
Just render whatever Highlights
we have, with a simple short-
circuit in case we’re rendering
the user’s own highlights
A B ?
“block”
“pillar”
“slab”
<block>
<pillar>
<slab>
“beam”
<beam>
[T]he language-games stand there as objects of
comparison which, through similarities and dissimilarities,
are meant to throw light on features of our language.

	 For we can avoid unfairness or vacuity in our assertions
only by presenting the model as what it is, as an object of
comparison — as a sort of yardstick; not as a
preconception to which reality must correspond. (The
dogmatism into which we fall so easily when doing
philosophy.)

(Wittgenstein, PI, §§130-131)
[T]he language-games stand there as objects of
comparison which, through similarities and dissimilarities,
are meant to throw light on features of our language.

	 For we can avoid unfairness or vacuity in our assertions
only by presenting the model as what it is, as an object of
comparison — as a sort of yardstick; not as a
preconception to which reality must correspond. (The
dogmatism into which we fall so easily when doing
philosophy computer science.)

(Wittgenstein, PI, §§130-131)
A B ?
“block”
“pillar”
“slab”
<block>
<pillar>
<slab>
“beam”
<beam>
Can there be a clash between the picture [our data]
and application? Well, they can clash in so far as the
picture makes us expect a different use; because
people in general apply this picture like this.

	 I want to say: we have here a normal case and
abnormal cases.

(Wittgenstein, PI, §141)
Thanks
•
• Wittgenstein, Ludwig. Philosophical Investigations.
Translated by G. E. M. Anscombe, P. M. S. Hacker,
and Joachim Schulte. Fourth Edition. Blackwell
Publishers, Malden, MA: 2009. (Originally
published 1953)
• Wittgenstein, Ludwig. Tractatus Logico-
Philosophicus. Translated by C. K. Ogden. Kegan
Paul, Trench, Trubner and Co., Ltd., London: 1922.

More Related Content

Viewers also liked

Developing Microservices with Apache Camel, by Claus Ibsen
Developing Microservices with Apache Camel, by Claus IbsenDeveloping Microservices with Apache Camel, by Claus Ibsen
Developing Microservices with Apache Camel, by Claus IbsenJudy Breedlove
 
Microservices with Apache Camel, DDD, and Kubernetes
Microservices with Apache Camel, DDD, and KubernetesMicroservices with Apache Camel, DDD, and Kubernetes
Microservices with Apache Camel, DDD, and KubernetesChristian Posta
 
Refactor your Java EE application using Microservices and Containers - Arun G...
Refactor your Java EE application using Microservices and Containers - Arun G...Refactor your Java EE application using Microservices and Containers - Arun G...
Refactor your Java EE application using Microservices and Containers - Arun G...Codemotion
 
Managing your camels in the cloud with CI/CD
Managing your camels in the cloud with CI/CDManaging your camels in the cloud with CI/CD
Managing your camels in the cloud with CI/CDChristian Posta
 
Fuse integration-services
Fuse integration-servicesFuse integration-services
Fuse integration-servicesChristian Posta
 
Java EE microservices architecture - evolving the monolith
Java EE microservices architecture - evolving the monolithJava EE microservices architecture - evolving the monolith
Java EE microservices architecture - evolving the monolithMarkus Eisele
 
Microservices with WildFly Swarm - JavaSI 2016
Microservices with WildFly Swarm - JavaSI 2016Microservices with WildFly Swarm - JavaSI 2016
Microservices with WildFly Swarm - JavaSI 2016Charles Moulliard
 
Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes Christian Posta
 
DevOps, Microservices and containers - a high level overview
DevOps, Microservices and containers - a high level overviewDevOps, Microservices and containers - a high level overview
DevOps, Microservices and containers - a high level overviewBarton George
 
How microservices are redefining modern application architecture
How microservices are redefining modern application architectureHow microservices are redefining modern application architecture
How microservices are redefining modern application architectureDonnie Berkholz
 
DevOps, containers & microservices: Separating the hype from the reality
DevOps, containers & microservices: Separating the hype from the realityDevOps, containers & microservices: Separating the hype from the reality
DevOps, containers & microservices: Separating the hype from the realityDonnie Berkholz
 
Microservices with Apache Camel, Docker and Fabric8 v2
Microservices with Apache Camel, Docker and Fabric8 v2Microservices with Apache Camel, Docker and Fabric8 v2
Microservices with Apache Camel, Docker and Fabric8 v2Christian Posta
 
Java one kubernetes, jenkins and microservices
Java one   kubernetes, jenkins and microservicesJava one   kubernetes, jenkins and microservices
Java one kubernetes, jenkins and microservicesChristian Posta
 
Facebook Architecture - Breaking it Open
Facebook Architecture - Breaking it OpenFacebook Architecture - Breaking it Open
Facebook Architecture - Breaking it OpenHARMAN Services
 
Microservices with Apache Camel
Microservices with Apache CamelMicroservices with Apache Camel
Microservices with Apache CamelClaus Ibsen
 
Developing Microservices with Apache Camel
Developing Microservices with Apache CamelDeveloping Microservices with Apache Camel
Developing Microservices with Apache CamelClaus Ibsen
 
7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications7 Stages of Scaling Web Applications
7 Stages of Scaling Web ApplicationsDavid Mitzenmacher
 

Viewers also liked (20)

Developing Microservices with Apache Camel, by Claus Ibsen
Developing Microservices with Apache Camel, by Claus IbsenDeveloping Microservices with Apache Camel, by Claus Ibsen
Developing Microservices with Apache Camel, by Claus Ibsen
 
Microservices with Apache Camel, DDD, and Kubernetes
Microservices with Apache Camel, DDD, and KubernetesMicroservices with Apache Camel, DDD, and Kubernetes
Microservices with Apache Camel, DDD, and Kubernetes
 
Refactor your Java EE application using Microservices and Containers - Arun G...
Refactor your Java EE application using Microservices and Containers - Arun G...Refactor your Java EE application using Microservices and Containers - Arun G...
Refactor your Java EE application using Microservices and Containers - Arun G...
 
Managing your camels in the cloud with CI/CD
Managing your camels in the cloud with CI/CDManaging your camels in the cloud with CI/CD
Managing your camels in the cloud with CI/CD
 
Fuse integration-services
Fuse integration-servicesFuse integration-services
Fuse integration-services
 
Java EE microservices architecture - evolving the monolith
Java EE microservices architecture - evolving the monolithJava EE microservices architecture - evolving the monolith
Java EE microservices architecture - evolving the monolith
 
Microservices with WildFly Swarm - JavaSI 2016
Microservices with WildFly Swarm - JavaSI 2016Microservices with WildFly Swarm - JavaSI 2016
Microservices with WildFly Swarm - JavaSI 2016
 
Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes
 
SOA to Microservices
SOA to MicroservicesSOA to Microservices
SOA to Microservices
 
DevOps, Microservices and containers - a high level overview
DevOps, Microservices and containers - a high level overviewDevOps, Microservices and containers - a high level overview
DevOps, Microservices and containers - a high level overview
 
How microservices are redefining modern application architecture
How microservices are redefining modern application architectureHow microservices are redefining modern application architecture
How microservices are redefining modern application architecture
 
DevOps, containers & microservices: Separating the hype from the reality
DevOps, containers & microservices: Separating the hype from the realityDevOps, containers & microservices: Separating the hype from the reality
DevOps, containers & microservices: Separating the hype from the reality
 
Microservices with Apache Camel, Docker and Fabric8 v2
Microservices with Apache Camel, Docker and Fabric8 v2Microservices with Apache Camel, Docker and Fabric8 v2
Microservices with Apache Camel, Docker and Fabric8 v2
 
Java one kubernetes, jenkins and microservices
Java one   kubernetes, jenkins and microservicesJava one   kubernetes, jenkins and microservices
Java one kubernetes, jenkins and microservices
 
Microservices and APIs
Microservices and APIsMicroservices and APIs
Microservices and APIs
 
A Microservice Journey
A Microservice JourneyA Microservice Journey
A Microservice Journey
 
Facebook Architecture - Breaking it Open
Facebook Architecture - Breaking it OpenFacebook Architecture - Breaking it Open
Facebook Architecture - Breaking it Open
 
Microservices with Apache Camel
Microservices with Apache CamelMicroservices with Apache Camel
Microservices with Apache Camel
 
Developing Microservices with Apache Camel
Developing Microservices with Apache CamelDeveloping Microservices with Apache Camel
Developing Microservices with Apache Camel
 
7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications
 

Similar to Polyglot Micro-Services with a Dash of Wittgenstein - PolyConf 2015

Object? You Keep Using that Word
Object? You Keep Using that WordObject? You Keep Using that Word
Object? You Keep Using that WordKevlin Henney
 
It Is Possible to Do Object-Oriented Programming in Java
It Is Possible to Do Object-Oriented Programming in JavaIt Is Possible to Do Object-Oriented Programming in Java
It Is Possible to Do Object-Oriented Programming in JavaKevlin Henney
 
20100420 Methods Of Multilingual Interoperability Of Art & Architecture Thesa...
20100420 Methods Of Multilingual Interoperability Of Art & Architecture Thesa...20100420 Methods Of Multilingual Interoperability Of Art & Architecture Thesa...
20100420 Methods Of Multilingual Interoperability Of Art & Architecture Thesa...AAT Taiwan
 
Beyond the Metaverse: XV (eXtended meta/uni/Verse)
Beyond the Metaverse: XV (eXtended meta/uni/Verse)Beyond the Metaverse: XV (eXtended meta/uni/Verse)
Beyond the Metaverse: XV (eXtended meta/uni/Verse)Steve Mann
 
Logic in Wittgenstein's Tractatus Logico-Philosophicus - A very brief introdu...
Logic in Wittgenstein's Tractatus Logico-Philosophicus - A very brief introdu...Logic in Wittgenstein's Tractatus Logico-Philosophicus - A very brief introdu...
Logic in Wittgenstein's Tractatus Logico-Philosophicus - A very brief introdu...Philip Schwarz
 
Argument Structure And State Composition
Argument Structure And State CompositionArgument Structure And State Composition
Argument Structure And State CompositionAmy Cernava
 
Material Cultures2010 Alexandre Monnin
Material Cultures2010 Alexandre MonninMaterial Cultures2010 Alexandre Monnin
Material Cultures2010 Alexandre MonninAlexandre Monnin
 
M01 Oo Intro
M01 Oo IntroM01 Oo Intro
M01 Oo IntroDang Tuan
 
A quantum framework for likelihood ratios
A quantum framework for likelihood ratiosA quantum framework for likelihood ratios
A quantum framework for likelihood ratiosRachael Bond
 
University of California, Berkeley: iSchool Nov, 2009
University of California, Berkeley: iSchool Nov, 2009University of California, Berkeley: iSchool Nov, 2009
University of California, Berkeley: iSchool Nov, 2009Tom Moritz
 
Supporting language learners with the
Supporting language learners with theSupporting language learners with the
Supporting language learners with theijaia
 
Prove asymptotic upper and lower hounds for each of the following sp.pdf
Prove asymptotic upper and lower hounds for each of the following  sp.pdfProve asymptotic upper and lower hounds for each of the following  sp.pdf
Prove asymptotic upper and lower hounds for each of the following sp.pdfwasemanivytreenrco51
 
Semiotics, Semantics, and The Linguistic Turn in Philosophy
Semiotics, Semantics, and The Linguistic Turn in PhilosophySemiotics, Semantics, and The Linguistic Turn in Philosophy
Semiotics, Semantics, and The Linguistic Turn in Philosophycognitiveron
 
Seven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersSeven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersKevlin Henney
 

Similar to Polyglot Micro-Services with a Dash of Wittgenstein - PolyConf 2015 (20)

M9910117 2007
M9910117 2007M9910117 2007
M9910117 2007
 
Object? You Keep Using that Word
Object? You Keep Using that WordObject? You Keep Using that Word
Object? You Keep Using that Word
 
It Is Possible to Do Object-Oriented Programming in Java
It Is Possible to Do Object-Oriented Programming in JavaIt Is Possible to Do Object-Oriented Programming in Java
It Is Possible to Do Object-Oriented Programming in Java
 
20100420 Methods Of Multilingual Interoperability Of Art & Architecture Thesa...
20100420 Methods Of Multilingual Interoperability Of Art & Architecture Thesa...20100420 Methods Of Multilingual Interoperability Of Art & Architecture Thesa...
20100420 Methods Of Multilingual Interoperability Of Art & Architecture Thesa...
 
Beyond the Metaverse: XV (eXtended meta/uni/Verse)
Beyond the Metaverse: XV (eXtended meta/uni/Verse)Beyond the Metaverse: XV (eXtended meta/uni/Verse)
Beyond the Metaverse: XV (eXtended meta/uni/Verse)
 
Logic in Wittgenstein's Tractatus Logico-Philosophicus - A very brief introdu...
Logic in Wittgenstein's Tractatus Logico-Philosophicus - A very brief introdu...Logic in Wittgenstein's Tractatus Logico-Philosophicus - A very brief introdu...
Logic in Wittgenstein's Tractatus Logico-Philosophicus - A very brief introdu...
 
Argument Structure And State Composition
Argument Structure And State CompositionArgument Structure And State Composition
Argument Structure And State Composition
 
Material Cultures2010 Alexandre Monnin
Material Cultures2010 Alexandre MonninMaterial Cultures2010 Alexandre Monnin
Material Cultures2010 Alexandre Monnin
 
Wittgenstein Exegesis
Wittgenstein ExegesisWittgenstein Exegesis
Wittgenstein Exegesis
 
9410-2.doc
9410-2.doc9410-2.doc
9410-2.doc
 
M01 Oo Intro
M01 Oo IntroM01 Oo Intro
M01 Oo Intro
 
A quantum framework for likelihood ratios
A quantum framework for likelihood ratiosA quantum framework for likelihood ratios
A quantum framework for likelihood ratios
 
CogSigma
CogSigmaCogSigma
CogSigma
 
University of California, Berkeley: iSchool Nov, 2009
University of California, Berkeley: iSchool Nov, 2009University of California, Berkeley: iSchool Nov, 2009
University of California, Berkeley: iSchool Nov, 2009
 
Onto clean methodology
Onto clean methodologyOnto clean methodology
Onto clean methodology
 
Supporting language learners with the
Supporting language learners with theSupporting language learners with the
Supporting language learners with the
 
Prove asymptotic upper and lower hounds for each of the following sp.pdf
Prove asymptotic upper and lower hounds for each of the following  sp.pdfProve asymptotic upper and lower hounds for each of the following  sp.pdf
Prove asymptotic upper and lower hounds for each of the following sp.pdf
 
Semiotics, Semantics, and The Linguistic Turn in Philosophy
Semiotics, Semantics, and The Linguistic Turn in PhilosophySemiotics, Semantics, and The Linguistic Turn in Philosophy
Semiotics, Semantics, and The Linguistic Turn in Philosophy
 
heim
heimheim
heim
 
Seven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersSeven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many Programmers
 

Polyglot Micro-Services with a Dash of Wittgenstein - PolyConf 2015

  • 1. Polyglot Micro-Services with a Dash of Wittgenstein Charles Pletcher @brophocles 4 July 2015 at PolyConf
  • 2. Ludwig Wittgenstein 1889 - 1951 Austrian-British Philosopher
  • 3. A is building with building stones: there are blocks, pillars, slabs, and beams. B has to pass him the stones and to do so in the order in which A needs them. For this purpose they make use of a language consisting of the words “block,” “pillar,” “slab,” “beam.” A calls them out; B brings the stone which he has learnt to bring at such- and-such a call. — Conceive of this as a complete primitive language. (Wittgenstein, PI, §2)
  • 5. 1. How does data’s meaning change from one context to another? 2. How do we figure out what data means in a given context? 3. What can we do about it?
  • 6. 1. Data’s meaning changes from context to context. 2. We can describe data in a given context 3. There are tools and techniques at our disposal to mitigate confusion.
  • 7. • Chuck Pletcher • Software Engineering at Assembly (https:// assembly.com) • Not a philosopher
  • 8. When they (grown-ups) named some object and at the same time turned towards it, I perceived this, and I grasped that the thing was signified by the sound they uttered, since they meant to point it out. This, however, I gathered from their gestures, the natural language of all peoples, the language that by means of facial expression and the play of eyes, of the movements of the limbs and the tone of voice, indicates the affections of the soul when it desires, or clings to, or rejects, or recoils from, something. In this way, little by little, I learnt to understand what things the words, which I heard uttered in their respective places in various sentences, signified. And once I got my tongue around these signs, I used them to express my wishes. (Augustine, Confessions I. 8)
  • 9. 2.1 We make to ourselves pictures of facts. 2.11  The picture presents the facts in logical space, the existence and non-existence of atomic facts. 2.12  The picture is a model of reality. 2.13  To the objects correspond in the picture the elements of the picture. 2.131 The elements of the picture stand, in the picture, for the objects. 2.14 The picture consists in the fact that its elements are combined with one another in a definite way. 2.141 The picture is a fact. (Wittgenstein, Tractatus Logico-Philosophocus)
  • 10.
  • 11. Someone suddenly sees something which he does not recognize (it may be a familiar object, but in an unusual position or lighting); the lack of recognition perhaps lasts only a few seconds. (Wittgenstein, PI, Part II, §141)
  • 12.
  • 13. Is it correct to say that he has a different visual experience from someone who recognized the object straightaway? Couldn’t someone describe an unfamiliar shape that appeared before him just as accurately as I, to whom it is familiar? And isn’t that the answer? (Wittgenstein, PI, Part II, §§141-142)
  • 16.
  • 17. import React from 'react' export default function connectToStores(...stores) { return function(Component) { return class StoreConnection extends React.Component { static willTransitionTo(transition, params, query) { Component.willTransitionTo && Component.willTransitionTo(transition, params, query) } constructor(props) { super(props) this.state = Component.getPropsFromStores(props) this.handleStoresChanged = this.handleStoresChanged.bind(this) } render() { return <Component {...this.props} {...this.state} ref="component" />; } componentDidMount() { stores.forEach(store => store.addChangeListener(this.handleStoresChanged) ); } componentWillUnmount() { stores.forEach(store => store.removeChangeListener(this.handleStoresChanged) ); } handleStoresChanged() { this.setState(Component.getPropsFromStores(this.props)) } // for testing static get Component() { return Component } } } } https://medium.com/@dan_abramov/mixins-are-dead-long-live-higher-order-components-94a0d2f9e750 Render the target Component along with any props and state Attach listeners to each of the Component’s stores (declared in the call to this decorator) Think of this as ReactRouter sugar — it’s not super important for our purposes, but I’ll explain it if you want
  • 18. import AvailableUsernameInputActions from 'actions/AvailableUsernameInputActions' import AvailableUsernameInputStore from 'stores/AvailableUsernameInputStore' import classnames from 'classnames' import connectToStores from 'lib/connectToStores.jsx' import React from 'react' @connectToStores(AvailableUsernameInputStore) export default class AvailableUsernameInput extends React.Component { static getPropsFromStores(props) { return { valid: AvailableUsernameInputStore.isValid(props.id) } } static defaultProps = { id: 'available-input' } componentDidMount() { AvailableUsernameInputActions.validate(this.props.id, this.props.value) } constructor(props) { super(props) this.handleChange = this._handleChange.bind(this) } render() { const classes = classnames(this.props.className, { 'is-error': this.props.valid === false }) return ( <div className="clearfix"> <input {...this.props} className={classes} onChange={this.handleChange} /> {this.renderMessage()} </div> ) } renderMessage() { const { valid, value } = this.props // `valid` can be `null`, in which case we do nothing if (valid === false) { return ( <small className="red left mt1"> {value} is taken. Try again! </small> ) } return null } _handleChange(e) { AvailableUsernameInputActions.validate(this.props.id, e.target.value) this.props.onChange && this.props.onChange(e) } } Pass any changes off to action creators. `valid` is ultimately the prop that we care about
  • 19. @AuthenticatedMixin() @connectToStores(HighlightsStore) export default class HighlightPicker extends React.Component { static getPropsFromStores(props) { return { highlights: HighlightsStore.all(), page: HighlightsStore.page, moreAvailable: HighlightsStore.moreAvailable } } static defaultProps = { changelogId: RouterContainer.changelogSlug() } constructor(props) { super(props) this.onScrollBottom = this._onScrollBottom.bind(this) } render() { const changelogId = this.props.changelogId return ( <div className="bg-white"> {this.renderPaginator()} {…} {this.renderHighlights()} </div> ) } renderHighlights() { const filter = RouterContainer.get().getCurrentParams().filter return List(this.props.highlights).filter(highlight => { if (filter !== 'mine') { return true } return List(highlight.mentioned_users).some((user) => { return user.username === SessionStore.user.username }) }).sortBy(highlight => -highlight.occurred_at).map((highlight) => { return <div className="border-bottom" key={highlight.id}> <Highlight highlight={highlight} /> </div> }) } renderPaginator() { if (this.props.moreAvailable) { return <ScrollPaginator page={this.props.page} onScrollBottom={this.onScrollBottom} /> } } _onScrollBottom() { HighlightActions.fetchAll(this.props.changelogId, this.props.page + 1) } } Just render whatever Highlights we have, with a simple short- circuit in case we’re rendering the user’s own highlights
  • 21. [T]he language-games stand there as objects of comparison which, through similarities and dissimilarities, are meant to throw light on features of our language. For we can avoid unfairness or vacuity in our assertions only by presenting the model as what it is, as an object of comparison — as a sort of yardstick; not as a preconception to which reality must correspond. (The dogmatism into which we fall so easily when doing philosophy.) (Wittgenstein, PI, §§130-131)
  • 22. [T]he language-games stand there as objects of comparison which, through similarities and dissimilarities, are meant to throw light on features of our language. For we can avoid unfairness or vacuity in our assertions only by presenting the model as what it is, as an object of comparison — as a sort of yardstick; not as a preconception to which reality must correspond. (The dogmatism into which we fall so easily when doing philosophy computer science.) (Wittgenstein, PI, §§130-131)
  • 24. Can there be a clash between the picture [our data] and application? Well, they can clash in so far as the picture makes us expect a different use; because people in general apply this picture like this. I want to say: we have here a normal case and abnormal cases. (Wittgenstein, PI, §141)
  • 25. Thanks • • Wittgenstein, Ludwig. Philosophical Investigations. Translated by G. E. M. Anscombe, P. M. S. Hacker, and Joachim Schulte. Fourth Edition. Blackwell Publishers, Malden, MA: 2009. (Originally published 1953) • Wittgenstein, Ludwig. Tractatus Logico- Philosophicus. Translated by C. K. Ogden. Kegan Paul, Trench, Trubner and Co., Ltd., London: 1922.