SlideShare une entreprise Scribd logo
1  sur  50
Télécharger pour lire hors ligne
this is the 0.8 language you were looking for
class << self
def who Maurizio De Magnis
I’m a Developer,
trying to improve
*
http://olistik.me
@olistik
def what
def where
First things first
let's sculpt this presentation
What you're NOT going to see today
“C’mon, use Ruby so I can
eat meat this week”
“Pick me! Pick me!”
What I'm going to say
is a personal remix of
what I've experienced,
heard and read.
http://goo.gl/TPywyp
Will you see breakthrough concepts here?
http://goo.gl/4FhtgR
No.
I'll just give you another point of view
● Ruby is NOT a perfect language
● Ruby is NOT the best language for
every scenario
"a language can’t be
good for everyone and
every purpose, but we
can strive to make it
good for 80% of what is
needed in a
programming language"
The most important slide so far
Yukihiro ‘Matz’ Matsumoto
(creator of Ruby)
http://goo.gl/0p7tBv
so do good/great programming
languages (and frameworks)
http://www.ruby-lang.org/en/about/
"Ruby is a language of careful balance.
Its creator, Yukihiro “Matz” Matsumoto, blended
parts of his favorite languages
(Perl, Smalltalk, Eiffel, Ada, and Lisp)
to form a new language that balanced
functional programming with imperative
programming."
● everyone has good ideas
● BUT not everyone perform well
Let's talk about something that
matters
http://goo.gl/60awJp
How?
perform well := adaptability to changes
either in the early stages (prototype)
or in the subsequent evolutions
Recipe for success
people
(skilled and motivated)
processes
(agile!)
but also the tools
on the coding layer
Let’s focus
coding is a creative process
positive thoughts unleash creativity
if coders are happy then creativity boosts
Provide them tools that actually improves the
efficiency of their environment
(also, pay them well enough so that they
don't worry about the economic details)
A good way to make
coders happy
The code you have to actually type
is the code you wish you had.
Today’s definition for
EPIC WIN
Expressiveness #1
The language you use influences your thoughts
Expressiveness #2
What about a language that looks like written
english?
“In the 1970s, researchers found that
developers tend to write roughly the
same number of lines of code every
day, regardless of what language
they're working in.”
Terseness #1
B. Boehm, Software Engineering Economics, Prentice-Hall, ISBN 0-138-22122-7, 1981.
Terseness #2
"the first 10 book's title, ordered alphabetically"
(it’s actually shorter than the corresponding english sentence)
Immediate feedback
I want to be able to “play” with the data:
Don't limit my designing skills
(testing new ideas)
Don't limit my problem solving skills
(debugging)
Immediate feedback - IRB
.js: 1
.css: 1
.rb: 21
.erb: 1
.yml: 3
.ru: 1
.lock: 1
.log: 1
.html: 3
.ico: 1
.txt: 1
.rdoc: 1
Immediate feedback - Rails console
Immediate feedback - meet AREL
Immediate feedback - meet AREL #2
Ruby code that gets transparently translated
into (usually) boring/verbose SQL statements.
Regardless the DBMS you're using
(MySQL, Postgres, SQLite, etc.)
Why? Abstraction!
"perform well := adaptability to changes"
“My code does
something funky, let
me inspect its context
at runtime”
Immediate feedback - MOAR
Immediate feedback - MOAR
Better
Errors
Immediate feedback - MOAR
RailsPanel
The pitfall of most frameworks
“Be the best at all the things!”
It usually ends up for the framework to be less
than average.
Even worse: “Let's do it by configuring all
the things!” (every time, from scratch)
=> a lot of time effort
Rails is an opinionated framework
Conventions over
configurations
A lot of assumptions based on what are the
most common needs of web developers.
● console
● standalone app server (but you can
choose whatever you like)
Fully isolated development
environment
Code organization
Follows the MVC pattern:
The goal is to understand in almost zero time
where a file is or should be located.
app/
models/
views/
controllers/
Code organization #2
Tends to fight bad practices such as:
● single directory with hundreds of files
● few huge monolithic files
Data persistence: ActiveRecord
class Author < ActiveRecord::Base
end
The code above reflects this database
configuration:
- authors
id: integer
Data persistence: ActiveRecord #2
If the database table happens to contain
additional fields like "name" and "age" the
developer doesn't need to update any code in
order to perform these:
author = Author.take(name: 'PKD')
author.age # => 55
author.age = 53
author.save
Data persistence: ActiveRecord #3
Even relations are easily mapped with little
effort:
class Author < ActiveRecord::Base
has_many :books
end
class Book < ActiveRecord::Base
belongs_to :author
end
- authors
id: integer
- books
id: integer
author_id: integer
author.books.first
author.books.destroy_all
author.books << Book.create
Here are some of the tools that makes Ruby
shine.
The focus should not be placed into what
they do, but how they have been
architectured so that your effort consists only
in declaring your needs.
When you use Ruby, you
get the whole ecosystem
for free
$ irb
> require 'mini_magick'
> image = MiniMagick::Image.open("input.jpg")
> image.resize "100x100"
> image.write "output.jpg"
$ gem install mini_magick
$ irb
> require ‘nokogiri’
> require 'open-uri'
> doc = Nokogiri::HTML(open("http://www.nytimes.com"))
> puts doc.
css('.story h3').
map {|story| "- #{story.text.strip}"}
- Obama's Battle for Votes on Syria Strike Is Taut and Uphill
- In Egypt, a Welcome for Syrian Refugees Turns Bitter
- Facing Fury Over New Law, Stoli Says '€˜Russian? Not Really'
- Two Men, 58 Years and Counting
- Editorial: Banning a Pseudo-Therapy
- Loose Ends: My Adventures in Their Clutches
$ gem install nokogiri
"RSpec is testing tool
for the Ruby
programming language.
Born under the banner
of Behaviour-Driven
Development,
it is designed to make
Test-Driven
Development a
productive and
enjoyable experience"
Testing with RSpec
# spec/bowling_spec.rb
require 'bowling'
describe Bowling, "#score" do
it "returns 0 for all gutter game"
do
bowling = Bowling.new
20.times { bowling.hit(0) }
bowling.score.should eq(0)
end
end
$ rspec bowling_spec.rb --format nested
Bowling#score
returns 0 for all gutter game
Finished in 0.007534 seconds
1 example, 0 failures
Who uses Ruby?
● http://www.shopify.com/
● http://www.yellowpages.com/
● https://github.com/
● https://www.heroku.com/
● https://twitter.com
● http://www.hulu.com/
● http://www.scribd.com/
● http://www.slideshare.net/
● http://www.soundcloud.com/
● http://www.prada.com
Ruby is used for both web and system programming
Ruby is used by both startups and enterprise companies
(Someone you might know)
This brief introduction is just to be
considered as a teaser.
Have Fun & Happy Coding
festival ICT 2013: Ruby, the 0.8 language you were looking for

Contenu connexe

Tendances

Tendances (6)

Testing Storm components with Groovy and Spock
Testing Storm components with Groovy and SpockTesting Storm components with Groovy and Spock
Testing Storm components with Groovy and Spock
 
Stop JavaScripting like it's 1999
Stop JavaScripting like it's 1999Stop JavaScripting like it's 1999
Stop JavaScripting like it's 1999
 
Hot and spicy Java with Lombok. Live!
Hot and spicy Java with Lombok. Live!Hot and spicy Java with Lombok. Live!
Hot and spicy Java with Lombok. Live!
 
Cucumber.js: Cuke up your JavaScript!
Cucumber.js: Cuke up your JavaScript!Cucumber.js: Cuke up your JavaScript!
Cucumber.js: Cuke up your JavaScript!
 
Introduce cucumber
Introduce cucumberIntroduce cucumber
Introduce cucumber
 
Intro to Rails
Intro to RailsIntro to Rails
Intro to Rails
 

En vedette

Alimentos transg nicos-presentacion-completada
Alimentos transg nicos-presentacion-completadaAlimentos transg nicos-presentacion-completada
Alimentos transg nicos-presentacion-completada
ErikaPalaciosA
 
27 malakoff2semaines 30-sep-13-oct-13
27 malakoff2semaines 30-sep-13-oct-1327 malakoff2semaines 30-sep-13-oct-13
27 malakoff2semaines 30-sep-13-oct-13
Malakocktail
 
Digital surya 02 oktober 2013
Digital surya 02 oktober 2013Digital surya 02 oktober 2013
Digital surya 02 oktober 2013
Portal Surya
 
Kristien bonneure, trage post
Kristien bonneure, trage postKristien bonneure, trage post
Kristien bonneure, trage post
pulsenetwerk
 
Msme expo 2013 broucher
Msme expo 2013 broucherMsme expo 2013 broucher
Msme expo 2013 broucher
mianagpur
 

En vedette (12)

Argentina Tourism
Argentina TourismArgentina Tourism
Argentina Tourism
 
Transgen1
Transgen1Transgen1
Transgen1
 
Alimentos transg nicos-presentacion-completada
Alimentos transg nicos-presentacion-completadaAlimentos transg nicos-presentacion-completada
Alimentos transg nicos-presentacion-completada
 
27 malakoff2semaines 30-sep-13-oct-13
27 malakoff2semaines 30-sep-13-oct-1327 malakoff2semaines 30-sep-13-oct-13
27 malakoff2semaines 30-sep-13-oct-13
 
Digital surya 02 oktober 2013
Digital surya 02 oktober 2013Digital surya 02 oktober 2013
Digital surya 02 oktober 2013
 
Military resume sample
Military resume sampleMilitary resume sample
Military resume sample
 
Kristien bonneure, trage post
Kristien bonneure, trage postKristien bonneure, trage post
Kristien bonneure, trage post
 
Positium overview
Positium overviewPositium overview
Positium overview
 
Msme expo 2013 broucher
Msme expo 2013 broucherMsme expo 2013 broucher
Msme expo 2013 broucher
 
Solving the Puzzle of Crowdfunding in Sweden_Teigland et al
Solving the Puzzle of Crowdfunding in Sweden_Teigland et alSolving the Puzzle of Crowdfunding in Sweden_Teigland et al
Solving the Puzzle of Crowdfunding in Sweden_Teigland et al
 
Sistemas operativos
Sistemas operativosSistemas operativos
Sistemas operativos
 
Delitos tributarios
Delitos tributariosDelitos tributarios
Delitos tributarios
 

Similaire à festival ICT 2013: Ruby, the 0.8 language you were looking for

Building an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learnedBuilding an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learned
Wojciech Koszek
 
On the path to become a jr. developer short version
On the path to become a jr. developer short versionOn the path to become a jr. developer short version
On the path to become a jr. developer short version
Antonelo Schoepf
 
Culture And Aesthetic Revisited
Culture And Aesthetic RevisitedCulture And Aesthetic Revisited
Culture And Aesthetic Revisited
Adam Keys
 
From Ant to Rake
From Ant to RakeFrom Ant to Rake
From Ant to Rake
jazzman1980
 

Similaire à festival ICT 2013: Ruby, the 0.8 language you were looking for (20)

Why Ruby?
Why Ruby? Why Ruby?
Why Ruby?
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
You should Know, What are the Common mistakes a node js developer makes?
You should Know, What are the Common mistakes a node js developer makes?You should Know, What are the Common mistakes a node js developer makes?
You should Know, What are the Common mistakes a node js developer makes?
 
An Introduction to ReactNative
An Introduction to ReactNativeAn Introduction to ReactNative
An Introduction to ReactNative
 
FGCU Camp Talk
FGCU Camp TalkFGCU Camp Talk
FGCU Camp Talk
 
Building an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learnedBuilding an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learned
 
On the path to become a jr. developer short version
On the path to become a jr. developer short versionOn the path to become a jr. developer short version
On the path to become a jr. developer short version
 
The story of language development
The story of language developmentThe story of language development
The story of language development
 
Culture And Aesthetic Revisited
Culture And Aesthetic RevisitedCulture And Aesthetic Revisited
Culture And Aesthetic Revisited
 
The Gist of React Native
The Gist of React NativeThe Gist of React Native
The Gist of React Native
 
Ruby for .NET developers
Ruby for .NET developersRuby for .NET developers
Ruby for .NET developers
 
C# and java comparing programming languages
C# and java  comparing programming languagesC# and java  comparing programming languages
C# and java comparing programming languages
 
From Ant to Rake
From Ant to RakeFrom Ant to Rake
From Ant to Rake
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overview
 
Gem That (2009)
Gem That (2009)Gem That (2009)
Gem That (2009)
 
Powerful tools for building web solutions
Powerful tools for building web solutionsPowerful tools for building web solutions
Powerful tools for building web solutions
 
Fewd week4 slides
Fewd week4 slidesFewd week4 slides
Fewd week4 slides
 
Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013
 
The Future of library dependency management of Ruby
 The Future of library dependency management of Ruby The Future of library dependency management of Ruby
The Future of library dependency management of Ruby
 
Good Coding Practices with JavaScript
Good Coding Practices with JavaScriptGood Coding Practices with JavaScript
Good Coding Practices with JavaScript
 

Plus de festival ICT 2016

Plus de festival ICT 2016 (20)

Migliorare il cash flow della propria azienda e dei propri clienti: i benefic...
Migliorare il cash flow della propria azienda e dei propri clienti: i benefic...Migliorare il cash flow della propria azienda e dei propri clienti: i benefic...
Migliorare il cash flow della propria azienda e dei propri clienti: i benefic...
 
Criticità per la protezione dei dati personali connesse all’utilizzo di dispo...
Criticità per la protezione dei dati personali connesse all’utilizzo di dispo...Criticità per la protezione dei dati personali connesse all’utilizzo di dispo...
Criticità per la protezione dei dati personali connesse all’utilizzo di dispo...
 
Lo Zen e l'arte dell'UX Design Mobile - by Synesthesia - festival ICT 2015
Lo Zen e l'arte dell'UX Design Mobile - by Synesthesia - festival ICT 2015Lo Zen e l'arte dell'UX Design Mobile - by Synesthesia - festival ICT 2015
Lo Zen e l'arte dell'UX Design Mobile - by Synesthesia - festival ICT 2015
 
The Web Advisor: restare vivi e aggiornati nel business digitale - festival I...
The Web Advisor: restare vivi e aggiornati nel business digitale - festival I...The Web Advisor: restare vivi e aggiornati nel business digitale - festival I...
The Web Advisor: restare vivi e aggiornati nel business digitale - festival I...
 
Favorire lo sviluppo di applicazioni native Cloud: lo Smart SaaS Program - by...
Favorire lo sviluppo di applicazioni native Cloud: lo Smart SaaS Program - by...Favorire lo sviluppo di applicazioni native Cloud: lo Smart SaaS Program - by...
Favorire lo sviluppo di applicazioni native Cloud: lo Smart SaaS Program - by...
 
I vantaggi di un’infrastruttura unica nell’erogazione dei servizi IT networke...
I vantaggi di un’infrastruttura unica nell’erogazione dei servizi IT networke...I vantaggi di un’infrastruttura unica nell’erogazione dei servizi IT networke...
I vantaggi di un’infrastruttura unica nell’erogazione dei servizi IT networke...
 
LibreOffice: software libero e formati standard - by LibreItalia - festival I...
LibreOffice: software libero e formati standard - by LibreItalia - festival I...LibreOffice: software libero e formati standard - by LibreItalia - festival I...
LibreOffice: software libero e formati standard - by LibreItalia - festival I...
 
Come rendere più collaborative le tue riunioni - by Epson - festival ICT 2015
Come rendere più collaborative le tue riunioni - by Epson - festival ICT 2015Come rendere più collaborative le tue riunioni - by Epson - festival ICT 2015
Come rendere più collaborative le tue riunioni - by Epson - festival ICT 2015
 
Case Study TWT: North Sails ha rivoluzionato il modo di lavorare - by TWT - f...
Case Study TWT: North Sails ha rivoluzionato il modo di lavorare - by TWT - f...Case Study TWT: North Sails ha rivoluzionato il modo di lavorare - by TWT - f...
Case Study TWT: North Sails ha rivoluzionato il modo di lavorare - by TWT - f...
 
Il mio ufficio è sempre con me. E il tuo? - by TWT - festival ICT 2015
Il mio ufficio è sempre con me. E il tuo? - by TWT - festival ICT 2015Il mio ufficio è sempre con me. E il tuo? - by TWT - festival ICT 2015
Il mio ufficio è sempre con me. E il tuo? - by TWT - festival ICT 2015
 
Non adeguatevi al Cloud - by Clouditalia - festival ICT 2015
Non adeguatevi al Cloud - by Clouditalia - festival ICT 2015Non adeguatevi al Cloud - by Clouditalia - festival ICT 2015
Non adeguatevi al Cloud - by Clouditalia - festival ICT 2015
 
Impatto privacy della video analisi nei sistemi di video sorveglianza intelli...
Impatto privacy della video analisi nei sistemi di video sorveglianza intelli...Impatto privacy della video analisi nei sistemi di video sorveglianza intelli...
Impatto privacy della video analisi nei sistemi di video sorveglianza intelli...
 
Web reputation, le verità nascoste dell’identità digitale - festival ICT 2015
Web reputation, le verità nascoste dell’identità digitale - festival ICT 2015Web reputation, le verità nascoste dell’identità digitale - festival ICT 2015
Web reputation, le verità nascoste dell’identità digitale - festival ICT 2015
 
Privacy e non profit online: profilazioni digitali di donatori e aderenti nel...
Privacy e non profit online: profilazioni digitali di donatori e aderenti nel...Privacy e non profit online: profilazioni digitali di donatori e aderenti nel...
Privacy e non profit online: profilazioni digitali di donatori e aderenti nel...
 
L'importanza del controllo nelle operazioni di Data Wiping - Sprint Computer ...
L'importanza del controllo nelle operazioni di Data Wiping - Sprint Computer ...L'importanza del controllo nelle operazioni di Data Wiping - Sprint Computer ...
L'importanza del controllo nelle operazioni di Data Wiping - Sprint Computer ...
 
Il dato è tratto: il lato B della mobilità tra privacy e reati informatici - ...
Il dato è tratto: il lato B della mobilità tra privacy e reati informatici - ...Il dato è tratto: il lato B della mobilità tra privacy e reati informatici - ...
Il dato è tratto: il lato B della mobilità tra privacy e reati informatici - ...
 
Web e privacy, le nuove regole per i cookies - festival ICT 2015
Web e privacy, le nuove regole per i cookies - festival ICT 2015Web e privacy, le nuove regole per i cookies - festival ICT 2015
Web e privacy, le nuove regole per i cookies - festival ICT 2015
 
Il paradigma UCaaS: come migliorare i processi di business dell’azienda attra...
Il paradigma UCaaS: come migliorare i processi di business dell’azienda attra...Il paradigma UCaaS: come migliorare i processi di business dell’azienda attra...
Il paradigma UCaaS: come migliorare i processi di business dell’azienda attra...
 
Nuvole e metallo: Infrastruttura e servizi Cloud based - by Hosting Solution...
 Nuvole e metallo: Infrastruttura e servizi Cloud based - by Hosting Solution... Nuvole e metallo: Infrastruttura e servizi Cloud based - by Hosting Solution...
Nuvole e metallo: Infrastruttura e servizi Cloud based - by Hosting Solution...
 
Definire, configurare ed implementare soluzioni scalabili su sistemi di Cloud...
Definire, configurare ed implementare soluzioni scalabili su sistemi di Cloud...Definire, configurare ed implementare soluzioni scalabili su sistemi di Cloud...
Definire, configurare ed implementare soluzioni scalabili su sistemi di Cloud...
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

festival ICT 2013: Ruby, the 0.8 language you were looking for

  • 1. this is the 0.8 language you were looking for
  • 2. class << self def who Maurizio De Magnis I’m a Developer, trying to improve * http://olistik.me @olistik def what def where
  • 3. First things first let's sculpt this presentation
  • 4. What you're NOT going to see today “C’mon, use Ruby so I can eat meat this week” “Pick me! Pick me!”
  • 5. What I'm going to say is a personal remix of what I've experienced, heard and read. http://goo.gl/TPywyp
  • 6. Will you see breakthrough concepts here? http://goo.gl/4FhtgR
  • 7. No.
  • 8. I'll just give you another point of view
  • 9. ● Ruby is NOT a perfect language ● Ruby is NOT the best language for every scenario
  • 10. "a language can’t be good for everyone and every purpose, but we can strive to make it good for 80% of what is needed in a programming language" The most important slide so far Yukihiro ‘Matz’ Matsumoto (creator of Ruby) http://goo.gl/0p7tBv
  • 11. so do good/great programming languages (and frameworks)
  • 12. http://www.ruby-lang.org/en/about/ "Ruby is a language of careful balance. Its creator, Yukihiro “Matz” Matsumoto, blended parts of his favorite languages (Perl, Smalltalk, Eiffel, Ada, and Lisp) to form a new language that balanced functional programming with imperative programming."
  • 13. ● everyone has good ideas ● BUT not everyone perform well Let's talk about something that matters http://goo.gl/60awJp
  • 14.
  • 15. How? perform well := adaptability to changes either in the early stages (prototype) or in the subsequent evolutions
  • 16. Recipe for success people (skilled and motivated) processes (agile!) but also the tools
  • 17. on the coding layer Let’s focus
  • 18. coding is a creative process positive thoughts unleash creativity if coders are happy then creativity boosts
  • 19. Provide them tools that actually improves the efficiency of their environment (also, pay them well enough so that they don't worry about the economic details) A good way to make coders happy
  • 20. The code you have to actually type is the code you wish you had. Today’s definition for EPIC WIN
  • 21. Expressiveness #1 The language you use influences your thoughts
  • 22. Expressiveness #2 What about a language that looks like written english?
  • 23. “In the 1970s, researchers found that developers tend to write roughly the same number of lines of code every day, regardless of what language they're working in.” Terseness #1 B. Boehm, Software Engineering Economics, Prentice-Hall, ISBN 0-138-22122-7, 1981.
  • 24. Terseness #2 "the first 10 book's title, ordered alphabetically" (it’s actually shorter than the corresponding english sentence)
  • 25. Immediate feedback I want to be able to “play” with the data: Don't limit my designing skills (testing new ideas) Don't limit my problem solving skills (debugging)
  • 26. Immediate feedback - IRB .js: 1 .css: 1 .rb: 21 .erb: 1 .yml: 3 .ru: 1 .lock: 1 .log: 1 .html: 3 .ico: 1 .txt: 1 .rdoc: 1
  • 27. Immediate feedback - Rails console
  • 28. Immediate feedback - meet AREL
  • 29. Immediate feedback - meet AREL #2 Ruby code that gets transparently translated into (usually) boring/verbose SQL statements. Regardless the DBMS you're using (MySQL, Postgres, SQLite, etc.) Why? Abstraction! "perform well := adaptability to changes"
  • 30.
  • 31. “My code does something funky, let me inspect its context at runtime” Immediate feedback - MOAR
  • 32. Immediate feedback - MOAR Better Errors
  • 33. Immediate feedback - MOAR RailsPanel
  • 34. The pitfall of most frameworks “Be the best at all the things!” It usually ends up for the framework to be less than average. Even worse: “Let's do it by configuring all the things!” (every time, from scratch) => a lot of time effort
  • 35. Rails is an opinionated framework
  • 36. Conventions over configurations A lot of assumptions based on what are the most common needs of web developers.
  • 37. ● console ● standalone app server (but you can choose whatever you like) Fully isolated development environment
  • 38. Code organization Follows the MVC pattern: The goal is to understand in almost zero time where a file is or should be located. app/ models/ views/ controllers/
  • 39. Code organization #2 Tends to fight bad practices such as: ● single directory with hundreds of files ● few huge monolithic files
  • 40. Data persistence: ActiveRecord class Author < ActiveRecord::Base end The code above reflects this database configuration: - authors id: integer
  • 41. Data persistence: ActiveRecord #2 If the database table happens to contain additional fields like "name" and "age" the developer doesn't need to update any code in order to perform these: author = Author.take(name: 'PKD') author.age # => 55 author.age = 53 author.save
  • 42. Data persistence: ActiveRecord #3 Even relations are easily mapped with little effort: class Author < ActiveRecord::Base has_many :books end class Book < ActiveRecord::Base belongs_to :author end - authors id: integer - books id: integer author_id: integer author.books.first author.books.destroy_all author.books << Book.create
  • 43. Here are some of the tools that makes Ruby shine. The focus should not be placed into what they do, but how they have been architectured so that your effort consists only in declaring your needs. When you use Ruby, you get the whole ecosystem for free
  • 44. $ irb > require 'mini_magick' > image = MiniMagick::Image.open("input.jpg") > image.resize "100x100" > image.write "output.jpg" $ gem install mini_magick
  • 45. $ irb > require ‘nokogiri’ > require 'open-uri' > doc = Nokogiri::HTML(open("http://www.nytimes.com")) > puts doc. css('.story h3'). map {|story| "- #{story.text.strip}"} - Obama's Battle for Votes on Syria Strike Is Taut and Uphill - In Egypt, a Welcome for Syrian Refugees Turns Bitter - Facing Fury Over New Law, Stoli Says '€˜Russian? Not Really' - Two Men, 58 Years and Counting - Editorial: Banning a Pseudo-Therapy - Loose Ends: My Adventures in Their Clutches $ gem install nokogiri
  • 46. "RSpec is testing tool for the Ruby programming language. Born under the banner of Behaviour-Driven Development, it is designed to make Test-Driven Development a productive and enjoyable experience" Testing with RSpec # spec/bowling_spec.rb require 'bowling' describe Bowling, "#score" do it "returns 0 for all gutter game" do bowling = Bowling.new 20.times { bowling.hit(0) } bowling.score.should eq(0) end end $ rspec bowling_spec.rb --format nested Bowling#score returns 0 for all gutter game Finished in 0.007534 seconds 1 example, 0 failures
  • 47. Who uses Ruby? ● http://www.shopify.com/ ● http://www.yellowpages.com/ ● https://github.com/ ● https://www.heroku.com/ ● https://twitter.com ● http://www.hulu.com/ ● http://www.scribd.com/ ● http://www.slideshare.net/ ● http://www.soundcloud.com/ ● http://www.prada.com Ruby is used for both web and system programming Ruby is used by both startups and enterprise companies (Someone you might know)
  • 48. This brief introduction is just to be considered as a teaser.
  • 49. Have Fun & Happy Coding