Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Forgetting Java: Why Java Should Die in Flames and Take its Developers Along

Forgetting Java: Why Java Should Die in Flames and Take its Developers Along

Video available from here: https://www.youtube.com/watch?v=LOcLwnV4Z2k
Java is old. Java is verbose. Java is ugly. Java is mocked and ridiculed by everyone and their dog. Hell, Java is dead. Well it's not but I'm preaching to the choir. Or am I? However convenient to say so, it's not exclusively Oracle to blame for Java's current state of the art. Java developers are guilty of laziness (the wrong kind), not questioning the tools they use (wrong again), following patterns (pretty much the right kind) they believe are blessed upon them yadda yadda yadda. Yet the communities around languages we find to be even lesser than Java offer world of a difference. The talk shows the tools, experiences and mindset we lack in the Java world. The virtues present elsewhere but needed here for Java to wipe the "enterprise-grade" solutions off the face of the world. Let's do this people. Let's do the right thing and get rid of the "enterprise" Java developers.

Piotr Limanowski

September 03, 2015
Tweet

More Decks by Piotr Limanowski

Other Decks in Programming

Transcript

  1. Forgetting JAVA
    Why Java Should Die in Flames and Take its
    Developers Along
    Piotr Limanowski
    @peel
    @peel #tricityjug 1

    View full-size slide

  2. PART I
    IS JAVA DEAD?
    @peel #tricityjug 2

    View full-size slide

  3. Nope.
    @peel #tricityjug 3

    View full-size slide

  4. Java might be
    @peel #tricityjug 4

    View full-size slide

  5. dy•ing (dīˈĭng)
    v. Present participle of die.
    adj. About to die: dying language.
    @peel #tricityjug 5

    View full-size slide

  6. dying by
    "verbosity"
    "poor type inference"
    "weak type system"
    "low-level support for concurrency/parallelism"
    "dependency hell"
    "OSS mostly comes from android & enterprises"
    @peel #tricityjug 6

    View full-size slide

  7. If programming is going
    to be the thing I spend
    my time on,
    it damn well better be
    awesome.
    — David Heinemeier Hansen
    @peel #tricityjug 7

    View full-size slide

  8. But, really...
    @peel #tricityjug 8

    View full-size slide

  9. Is Java dead?
    @peel #tricityjug 9

    View full-size slide

  10. COBOL
    @peel #tricityjug 10

    View full-size slide

  11. TO
    @peel #tricityjug 11

    View full-size slide

  12. OTHER LANGUAGES
    @peel #tricityjug 12

    View full-size slide

  13. COBOL TO JAVA
    TRANSPILER
    @peel #tricityjug 13

    View full-size slide

  14. Why?
    @peel #tricityjug 14

    View full-size slide

  15. Java does not change.
    @peel #tricityjug 15

    View full-size slide

  16. Why not C then?
    @peel #tricityjug 16

    View full-size slide

  17. source & binary compatible
    since
    @peel #tricityjug 17

    View full-size slide

  18. FOREVER
    @peel #tricityjug 18

    View full-size slide

  19. type erasure
    @peel #tricityjug 19

    View full-size slide

  20. let's change
    @peel #tricityjug 20

    View full-size slide

  21. attract those crazy, eager,
    young, passionate,
    enthusiastic
    — someone, somewhere, someday
    @peel #tricityjug 21

    View full-size slide

  22. Y U NO
    CHANGE?
    @peel #tricityjug 22

    View full-size slide

  23. missing: happiness
    @peel #tricityjug 23

    View full-size slide

  24. PROFFESSIONAL
    SINNERS
    @peel #tricityjug 24

    View full-size slide

  25. PROFFESSIONAL
    ENTERPRISE
    SINNERS
    @peel #tricityjug 25

    View full-size slide

  26. val virtues = "crazy" ::
    "eager" ::
    "young" ::
    "passionate" ::
    "enthusiastic" ::
    "happy"
    Nil
    virtues.dropWhile(wat)
    def wat = {
    @peel #tricityjug 26

    View full-size slide

  27. PART II
    THE SINS
    @peel #tricityjug 27

    View full-size slide

  28. IGNORANCE
    @peel #tricityjug 28

    View full-size slide

  29. shell
    @peel #tricityjug 29

    View full-size slide

  30. multiplexer tmux
    shell ZSH w/ prezto
    editor spacemacs
    sane defaults: skwp/dotfiles
    @peel #tricityjug 30

    View full-size slide

  31. test feedback
    REPL
    @peel #tricityjug 31

    View full-size slide

  32. REPL driven development
    @peel #tricityjug 32

    View full-size slide

  33. 1. experiment in repl
    2. write test
    3. [opt] how to make test pass in repl?
    4. implement
    5. refactor
    @peel #tricityjug 33

    View full-size slide

  34. gui git client?
    @peel #tricityjug 34

    View full-size slide

  35. then how about...
    @peel #tricityjug 35

    View full-size slide

  36. smart prompt
    multiple sessions
    session preserving
    quick file changes
    project generation
    finding files
    | operator
    microservices
    @peel #tricityjug 36

    View full-size slide

  37. CLI ALL THE THINGS
    @peel #tricityjug 37

    View full-size slide

  38. Java can't into shell.
    Properly.
    @peel #tricityjug 38

    View full-size slide

  39. Grass is always greener:
    codegangsta/cli
    @peel #tricityjug 39

    View full-size slide

  40. package main
    import (
    "os"
    "github.com/codegangsta/cli" //THIS
    )
    func main() {
    app := cli.NewApp()
    app.Name = "greet"
    app.Usage = "fight the loneliness!"
    app.Flags = []cli.Flag {
    cli.StringFlag{
    Name: "lang",
    Value: "english",
    Usage: "language for the greeting",
    },
    }
    app.Action = func(c *cli.Context) {
    name := "someone"
    if len(c.Args()) > 0 {
    name = c.Args()[0]
    }
    if c.String("lang") == "spanish" {
    println("Hola", name)
    } else {
    println("Hello", name)
    }
    }
    app.Run(os.Args)
    }
    @peel #tricityjug 40

    View full-size slide

  41. Commander.rb
    Shell
    scopt.scala
    @peel #tricityjug 41

    View full-size slide

  42. version management
    @peel #tricityjug 42

    View full-size slide

  43. $ rvm install 2.2.3
    $ rvm use 2.2.3
    $ cd ..
    $ rvm install 2.2.4
    $ rvm use 2.2.0 --default
    @peel #tricityjug 43

    View full-size slide

  44. jenv.io
    @peel #tricityjug 44

    View full-size slide

  45. distribution
    @peel #tricityjug 45

    View full-size slide

  46. OS packages
    self-contained fatjars
    containers
    @peel #tricityjug 46

    View full-size slide

  47. App Servers are DEAD
    @peel #tricityjug 47

    View full-size slide

  48. Server version
    dependency?
    @peel #tricityjug 48

    View full-size slide

  49. Server monitoring?
    @peel #tricityjug 49

    View full-size slide

  50. Call home
    @peel #tricityjug 50

    View full-size slide

  51. Dead man's switch
    @peel #tricityjug 51

    View full-size slide

  52. Status page
    @peel #tricityjug 52

    View full-size slide

  53. DEV W/O OPS
    @peel #tricityjug 53

    View full-size slide

  54. snowflake dev
    @peel #tricityjug 54

    View full-size slide

  55. every hour is Ship It hour
    @peel #tricityjug 55

    View full-size slide

  56. Continuous
    Delivery
    — Humble, Jez; Farley, David,
    Addison-Wesley, 2011
    @peel #tricityjug 56

    View full-size slide

  57. Release It!
    — Nygard, Michael, Pragmatic
    Publishing, 2007
    @peel #tricityjug 57

    View full-size slide

  58. 2007
    @peel #tricityjug 58

    View full-size slide

  59. bulkheading
    @peel #tricityjug 59

    View full-size slide

  60. circuit breakers
    @peel #tricityjug 60

    View full-size slide

  61. @peel #tricityjug 61

    View full-size slide

  62. Logging (frameworks)
    @peel #tricityjug 62

    View full-size slide

  63. Timestamp | Status | Entity Id | What happened | What
    did user do
    @peel #tricityjug 63

    View full-size slide

  64. EASY
    NOT
    SIMPLE
    @peel #tricityjug 64

    View full-size slide

  65. Build tools
    @peel #tricityjug 65

    View full-size slide

  66. Maven

    ...

    @peel #tricityjug 66

    View full-size slide

  67. Maven
    17
    ...
    1565
    @peel #tricityjug 67

    View full-size slide

  68. 1565
    @peel #tricityjug 68

    View full-size slide


  69. !
    Separation?
    @peel #tricityjug 69

    View full-size slide

  70. Gradle
    1 apply plugin: 'java'
    @peel #tricityjug 70

    View full-size slide

  71. GREAT SUCCESS
    @peel #tricityjug 71

    View full-size slide

  72. $ ls
    gradlew/
    src/
    build.gradle
    gradle.properties
    gradlew
    gradlew.bat
    settings.gradle
    @peel #tricityjug 72

    View full-size slide

  73. Ant
    25
    ...
    233
    @peel #tricityjug 73

    View full-size slide

  74. If I knew then what I know
    now, I would have tried
    using a real
    scripting language
    — James Duncan Davidson (creator of Ant)
    @peel #tricityjug 74

    View full-size slide

  75. XML
    @peel #tricityjug 75

    View full-size slide

  76. Grass is always greener:
    Rake
    @peel #tricityjug 76

    View full-size slide

  77. rails/rails
    67 lines
    of code
    @peel #tricityjug 77

    View full-size slide

  78. task default: %w[test]
    task :test do
    ruby "test/unittest.rb"
    end
    @peel #tricityjug 78

    View full-size slide

  79. Sample
    @peel #tricityjug 79

    View full-size slide

  80. Grass is always greener:
    Mix (Elixir)
    @peel #tricityjug 80

    View full-size slide

  81. mix new my_project --module MyProject
    vim mix.exs
    mix deps.get
    npm install
    @peel #tricityjug 81

    View full-size slide

  82. Dependency management
    @peel #tricityjug 82

    View full-size slide

  83. 1565
    XML
    @peel #tricityjug 83

    View full-size slide

  84. Grass is always greener:
    Bundler
    @peel #tricityjug 84

    View full-size slide

  85. $ gem install bundler
    $ bundle init
    source 'https://rubygems.org'
    gem 'nokogiri'
    gem 'rails'
    gem 'rack', '>=1.0'
    gem 'thin', '~>1.1'
    gem 'globalid', github: 'rails/globalid', branch: 'master'
    @peel #tricityjug 85

    View full-size slide

  86. Grass is always greener:
    Mix (Elixir)
    @peel #tricityjug 86

    View full-size slide

  87. $ mix phoenix.server
    defmodule Chat.Mixfile do
    use Mix.Project
    def project do
    [app: :chat,
    version: "0.0.1",
    elixir: "~> 1.0",
    elixirc_paths: ["lib", "web"],
    compilers: [:phoenix] ++ Mix.compilers,
    deps: deps]
    end
    def application do
    [mod: {Chat, []},
    applications: [:phoenix, :phoenix_html, :cowboy, :logger]]
    end
    def deps do
    [{:phoenix, "~> 0.17"},
    {:phoenix_html, "~> 2.1"},
    {:phoenix_live_reload, "~> 1.0"},
    {:phoenix_ecto, "~> 0.9"},
    {:postgrex, ">= 0.0.0"},
    {:cowboy, "~> 1.0"}]
    end
    end
    @peel #tricityjug 87

    View full-size slide

  88. Web Frameworks
    @peel #tricityjug 88

    View full-size slide

  89. (Don't) fight the HTTP
    @peel #tricityjug 89

    View full-size slide

  90. Java EE is a
    dead fish
    !
    @peel #tricityjug 90

    View full-size slide

  91. @Spring
    @peel #tricityjug 91

    View full-size slide

  92. Thanks to @Annotations,
    @Progress is
    @Unstoppable!
    — annotationmania.com
    @peel #tricityjug 92

    View full-size slide

  93. spring boot w/ velocity
    @peel #tricityjug 93

    View full-size slide

  94. Dropwizard
    no magic involved
    @peel #tricityjug 94

    View full-size slide

  95. Grass is always greener:
    Phoenix
    @peel #tricityjug 95

    View full-size slide

  96. $ mix phoenix.new hello_phoenix
    $ cd hello_phoenix
    $ mix phoenix.server
    @peel #tricityjug 96

    View full-size slide

  97. FALSE IDOLS
    WAY TOO OFTEN
    @peel #tricityjug 97

    View full-size slide

  98. GOF Design patterns
    @peel #tricityjug 98

    View full-size slide

  99. It's good to know them.
    @peel #tricityjug 99

    View full-size slide

  100. It's essential to understand them.
    @peel #tricityjug 100

    View full-size slide

  101. FINALE
    @peel #tricityjug 101

    View full-size slide

  102. Update your tools
    Look beyond the fence
    Question everything
    Kill the old
    Have fun
    @peel #tricityjug 102

    View full-size slide

  103. One last thing...
    @peel #tricityjug 103

    View full-size slide

  104. _INASWAN
    @peel #tricityjug 104

    View full-size slide

  105. HAVE FUN
    @peel #tricityjug 105

    View full-size slide

  106. HAKUNA MATATA
    THANKS
    @peel #tricityjug 106

    View full-size slide