Sapir-Whorf Hypothesis linguistic differences have consequences on human cognition and behavior The principle of linguistic relativity holds that the structure of a language affects the ways in which its speakers conceptualize their world, i.e. their world view, or otherwise influences their cognitive processes. Sunday, October 21, 12
interpreted compiled dynamically typed statically typed object oriented functional difficulty JavaScript X X X* X easy Ruby/Python X X X X normal CoffeeScript X X X X normal Objective-C X X X X * nightmare Java X X X hard Go X * structural X X* X normal Clojure X X (hints) * X normal/ nightmare/ hell Scala X * structural X inferred X X normal/ nightmare Sunday, October 21, 12
class Presentation attr_accessor :name, :topic def initialize(name, topic) self.name = name self.topic = topic end def start puts "Hi, my name is #{name} \ and I will talk about #{topic}." end end talk = Presentation.new("Matt", "Ruby") talk.start Sunday, October 21, 12
class PostsController < ApplicationController def index @posts = Post.all respond_to do |format| format.html # FYI, render index.html.erb format.json { render :json => @posts } end end end Sunday, October 21, 12
Ruby what I dislike Often abused Overly complex specs Hard to follow/debug Not designed for parallelism Can’t be easily optimized Design choices that are hard to revert Sunday, October 21, 12
Ruby what I like Expressive Malleable Human oriented Business efficient Everything is an object Functional language Great “go to” language Influenced other languages Great for DSL Sunday, October 21, 12
var Presentation = function(name, topic) { this.name = name; this.topic = topic; }; Presentation.prototype.start = function(){ return "Hi, my name is " + this.name + " and I will talk about " + this.topic + "." }; var talk = new Presentation('Matt', 'JS'); talk.start(); Sunday, October 21, 12
class Presentation constructor: (@name, @topic) -> start: () -> return "Hi, my name is " + this.name + " and I will talk about " + this.topic + "." talk = new Presentation("Matt", "CoffeeScript") talk.start() Sunday, October 21, 12
what I dislike debugging space delimited o_O effect too many ways to do a simple thing compilation phase still requires to know JS not for everyone Sunday, October 21, 12
$ go build concurrency_example.go && ./a.out .Fetching http://pulsoconf.co/ Fetching http://golang.org/ Fetching http://matt.aimonetti.net/ .....http://golang.org/ was fetched .......http://pulsoconf.co/ was fetched .http://matt.aimonetti.net/ was fetched http://golang.org/ status: 200 OK http://pulsoconf.co/ status: 200 OK http://matt.aimonetti.net/ status: 200 OK Sunday, October 21, 12
what I like simple specs modern std libs concurrency (goroutines/channels) sensible conventions fast compilation flexible code organization simpler take on OO features of FP error handling documentation source as documentation Sunday, October 21, 12
(defprotocol Talk "A conference talk" (start [p] "return the speaker and topic.")) (defrecord Presentation [name topic] Talk; implement the Talk protocol (start [_] (str "Hi, this is " name " and I will talk about " topic "."))) (def talk (Presentation. "Matt" "Clojure")) (start talk) Sunday, October 21, 12
what I dislike not so simple not always consistent need to know a lot of functions/macros not really web focused brain stack overflow hard mental context switch meaningless error stacks Sunday, October 21, 12
class Presentation(val name: String, val topic: String) { val start = "My name is "+ name + " and I will talk about " + topic +"." } val talk = new Presentation("Matt", "Scala") talk.start Sunday, October 21, 12
val service = new Service[HttpRequest, HttpResponse] { def apply(request: HttpRequest) = Future(new DefaultHttpResponse(HTTP_1_1, OK)) } val address = new InetSocketAddress(10000) val server: Server[HttpRequest, HttpResponse] = ServerBuilder() .name("MyWebServer") .codec(Http()) .bindTo(address) .build(service) Sunday, October 21, 12
what I dislike huge surface stiff learning curve abused o_O syntax poor documentation feels like it’s trying to do everything JVM Sunday, October 21, 12
what I like Close to Ruby/Python Easy to get started Inferred types Flexible functional approach Modern concerns (parallelism) Pattern matching Relatively rich ecosystem JVM/CLR Sunday, October 21, 12