slidenumbers: true footer: @peel #tricityjug
^ Abstract: Java is old. Java is verbose. Java is ugly. Java is mocked and ridiculed but 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.
^ Contents: PART I: Is Java Dead? Tries to find the right angle at why Java is seen dead or dying. Addresses often mentioned language quality as well as social arguments. States that Java is a dying language not because of it's features but the social aspect that puts off innovative programming community members from working with Java and choose another language instead. Sums up the topic with a claim that Java unlike some other languages/tools does not enable 'developer happiness' while writing code. PART II: The Sins States several 'sins' that we the Java developers often make. Sins that drive Java language down the line. Compares the usual Java developer choices with a range of choices available to developers in other languages/communties.
- Ignorance States that we are way too lazy and often choose to ignore anything outside of what is comfortable and well known to us. Things that would come in handy if we had used them. Shell and command line tools are the first thing to notice. Compares usual way shell is used by Java developers and notes why Java developers, unlike Go and Ruby devs, don't usual build small, handly CLI tools. Shows several useful tools that might be convenient to use.
- Language version management Java community is reluctant of upgrading both Java as well as dependencies. This no Jav
- Distribution We tend to ignore the way that we distribute and cache software versions. The part shows several approaches how distribution is handled. Hints the non-usual approaches that work better than usual. Targets app servers as legacy software.
- Dev w/o Ops Describes tools, practices and facts from operations world that are usually ignored by Java devs. Mentions continuous delivery and stability patterns.
- Logging Java devs tend to focus on using logging frameworks rather than thinking on how and why to log. And eventually how to make use of the logs.
- Easy not Simple
Choosing the frameworks, tools and solutions that are easy not simple and elegant:
- Build tools - addresses build tools in Java that haven't been changed for years and feel awkward when used. Shows the world of Ruby, Elixir.
- Dependency management - tackles dependency management that in Java unlike other languages feels equally awkward as build scripts; shows newer approaches chosen by Clojure and Ruby
- Web frameworks - Java web frameworks may be split in two: legacy (Struts, Spring MVC with JSP/JSF) and less legacy (Ratpack, JHipster, Dropwizard) all in all there is no real comparison with other solutions delivered in form of for instance Phoenix Framework
- False idols - tackles the use of design patterns (especially GOF) even in Java 8 functional solutions in place FINALE Summs up the presentation.Leaves the attendee with a message to 'have fun' while programming.
#[fit] PART I ##[fit] IS JAVA DEAD?
v. Present participle of die. adj. About to die: dying language.
#dying by "verbosity" "poor type inference" "weak type system" "low-level support for concurrency/parallelism" "dependency hell" "OSS mostly comes from android & enterprises"
^ Russel Winder - devoxx
If programming is going to be the thing I spend my time on, it damn well better be awesome. -- David Heinemeier Hansen
^ Venkat Subramaniam on evolution of programming languages
^ do you know there is a COBOL magazine
^they want to write the code and have it run the same way 50 years later, literally, truly ^ even when there are no programmers
^hence will run the old software for another 50 years no changes
^C changes depending on 64/32 architecture
^ horrible bugs
^type erasure is a stupid bug to have in code ^type erasure wouldn't be there if the language was implemented two years later
attract those crazy, eager, young, passionate, enthusiastic -- someone, somewhere, someday
^ RxJava ^ Android/Scala community
^ruby community
^ stockholm syndrome
val virtues = "crazy" ::
"eager" ::
"young" ::
"passionate" ::
"enthusiastic" ::
"happy"
Nil
virtues.dropWhile(wat)
def wat = {
^ ruby values ^ python code of conduct
#[fit] PART II ##[fit] THE SINS
^ what do we ignore? ^ why?
#[fit] shell
^ide lock in ^recruitment
###sane defaults: skwp/dotfiles ^Rakefile ^ skwp = Yan Pritzker
- experiment in repl
- write test
- [opt] how to make test pass in repl?
- implement
- refactor
^Conrad Irwin - REPL driven development
#gui git
client?
^ James Lewis - microservices
#Java can't into shell. Properly.
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)
}
^ cross-os ^ not the prettiest tho ^ bash completion ^ cross-os
#Commander.rb #Shell #scopt.scala ^ not a big fan of scopt tho
#[fit] version management ^ ignorance of java
$ rvm install 2.2.3
$ rvm use 2.2.3
$ cd ..
$ rvm install 2.2.4
$ rvm use 2.2.0 --default
#[fit] distribution ^ ignorance of
#OS packages #self-contained fatjars #containers
^ torsten curdt - jdeb ^ there is nothing about deployaple wars/ears they are bad
#App Servers are DEAD
^ multiple apps in one for memory/processor
^JMX - 2 way API for monitoring; SNMP integration; Jolokia JMX - REST w/ JSON ^ Log files/ELK ^ servers make monitoring complex
^ let know the app works
^ turn off the app when misbehaves
##[fit] snowflake dev
^every machine is a bit different ^configuration in IDE
##[fit] every hour is Ship It hour
Continuous Delivery -- Humble, Jez; Farley, David, Addison-Wesley, 2011
Release It! -- Nygard, Michael, Pragmatic Publishing, 2007
#[fit] 2007
#bulkheading
#[fit] Logging (frameworks)
Timestamp | Status | Entity Id | What happened | What did user do
^ single line
---
# [fit] EASY
# [fit] NOT
# [fit] SIMPLE
^ not upgrading tools
^łatwe nie proste
---
#[fit] Build tools
---
**Maven**
```xml
<project xmlns="http://maven.apache.org/POM/4.0.0" ...>
...
</project>
Maven
17 <project xmlns="http://maven.apache.org/POM/4.0.0" ...>
...
1565 </project>
😵
^ will not say which project ^ one I contributed to ^ OSS
Gradle
1 apply plugin: 'java'
$ ls
gradlew/
src/
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle
Ant
25 <project name="Lang" default="compile" basedir=".">
...
233 </project>
^ James Lewis ^ priperietary CMS ^ scriptable tasks ^ can fit into dev mind
If I knew then what I know now, I would have tried using a real scripting language -- James Duncan Davidson (creator of Ant)
^ why not... Java?
^ or leiningen (you can use it with java too!)
#[fit]67 lines #of code
task default: %w[test]
task :test do
ruby "test/unittest.rb"
end
#Sample ^ go to shell
#Grass is always greener: Mix (Elixir)
^ comes with a language that comes in brew/package manager near you ;) ^ go to shell ^ dave thomas - prag dave
mix new my_project --module MyProject
vim mix.exs
mix deps.get
npm install
^ project generation ^ typesafe
#[fit] Dependency management
#[fit]1565 #[fit]XML
^global dependencies ^can't setup per-directory config ^well, overriding settings.xml is not a solution ^json? - composer.php ^lein go gom vundle
#Grass is always greener: Bundler
$ 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'
^ comes with RVM
#Grass is always greener: Mix (Elixir)
^ comes with a language that comes in brew/package manager near you ;)
$ 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
^ gom
#[fit] Web Frameworks
^ hacking the HTTP architecture w/ servlets
#Java EE is a dead fish #🔥
^ complex ^ slow ^ unnecessary
Thanks to @Annotations, @Progress is @Unstoppable! -- annotationmania.com
#spring boot w/ velocity ^ asset pipelines
#Grass is always greener: Phoenix
$ mix phoenix.new hello_phoenix
$ cd hello_phoenix
$ mix phoenix.server
##[fit]GOF Design patterns
###It's good to know them.
###It's essential to understand them.
^ why do you use OO patterns with functions? ^ know beyond GOF patterns
#[fit]FINALE
^ matz is nice and so we are nice ^ welcome diversity ^ introduce new people
^ if you're not. go find where you can.
LOL you don't like Java's type system for being weak, and you seem to promote python / ruby just after :-)