Writing code that lasts - JAB14
Upcoming SlideShare
Loading in...5
×
 

Writing code that lasts - JAB14

on

  • 10,367 views

As developers we write code everyday, only to frown at it a week after that. Why do we have such a hard time with code written by others and ourselves, this raging desire to rewrite everything we see? ...

As developers we write code everyday, only to frown at it a week after that. Why do we have such a hard time with code written by others and ourselves, this raging desire to rewrite everything we see? Writing code that survives the test of time and self judgment is a matter of clarity and simplicity. Let's talk about growing, learning and improving our code with calisthenics, readability and good design.

Statistics

Views

Total Views
10,367
Views on SlideShare
6,851
Embed Views
3,516

Actions

Likes
73
Downloads
370
Comments
5

43 Embeds 3,516

http://www.planet-php.net 959
http://blog.doh.ms 598
http://www.rafaeldohms.com.br 434
http://planet-php.net 321
http://feedly.com 279
http://rafaeldohms.com.br 138
http://jandbeyond.org 129
http://www.scoop.it 122
http://blog.jetbrains.com 111
http://www.edu.xunta.es 83
http://freeflux.net 72
https://twitter.com 63
http://planet-php.org 59
http://www.planet-php.org 25
http://digg.com 24
http://blog.rafaeldohms.com.br 14
http://www.newsblur.com 12
http://www.inoreader.com 12
http://collectifdevng.tumblr.com 10
http://www.feedspot.com 9
http://shakeme.info 5
http://www.hanrss.com 3
http://rss.armage.org 3
http://praktikum.dev 3
http://newsblur.com 3
http://feedreader.com 3
https://www.linkedin.com 2
http://translate.googleusercontent.com 2
http://132.69-195-222.static.servergrove.com 2
http://reader.aol.com 2
http://l.lj-toys.com 2
http://www.linkedin.com 1
http://awesomepitch.co 1
http://tiscilla.doh.ms 1
http://news.google.com 1
http://www.google.com 1
https://home.jolicloud.com 1
http://webcache.googleusercontent.com 1
http://getpocket.com 1
http://astonshaw.local 1
https://reader.aol.com 1
http://test.wp.dev 1
http://blog.doh.ms&_=1408231576297 HTTP 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • @TaniaAndreaMirandaMoreira com certeza, essa palestra tem coisa relevante para qualquer linguagem. Algumas das regras de Object Calisthenics podem mudar um pouco para python, mas não muita coisa, o resto segue valendo.
    Are you sure you want to
    Your message goes here
    Processing…
  • writing code is extremely relevant today. It is definitely something that needs to be more widely taught.
    Are you sure you want to
    Your message goes here
    Processing…
  • Amigo, fico feliz com seu retorno! Mesmo não sendo do 'mundo do PHP', curti as dicas que no final servem pra toda e qualquer linguagem de programação! Sucesso e vida longa! Abraço.
    Are you sure you want to
    Your message goes here
    Processing…
  • @undefined Felipe, eu discordo da filosofia 'ter o necessário', pois isso é muito subjetivo. Mas o intuito de OC não são 'regras' e sim sinais e práticas que te levam a avaliar se o seu código realmente esta o mais simples possivel. Isso não aparece nos slides, então sem ver a palestra é fácil achar que estou 'enfiando regras goela abaixo', mas o processo de OC é justamente de mudar sua cultura para uma de fazer as coisas mais simples, e o que eu apresento não são regras, mas sim exercícios que te levam a pensar mais sobre o código.

    Verifique a palestra 'Your code sucks' pois ela entra em mais detalhes sobre as regras, inclusive o porque de usar #9 baseado na falta de accessors no PHP.

    Espero poder repetir estas palestras para o publico brasileiro em breve.
    Are you sure you want to
    Your message goes here
    Processing…
  • Achei bem bacana a maioria das informações... mas por ex: #1 é leviano acreditar que você pode usar regras como essas, um nível de indentação por método. O método deve ter a quantidade de indentação necessária. #6 o tamanho da classe deve ser equivalente a abstração coesa do que ela representa. #7 digo o mesmo do item #6 a classe deve ter a quantidade de variáveis de instância necessária para representar a abstração para qual ela se propõe. #9 só devem ser usados se necessário, se você pensar bem get e set nem fazem parte da abstração de algum negócio, sabe, ninguém te diz :'faz um get nome no paciente que tá esperando ali na fila'.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Writing code that lasts - JAB14 Writing code that lasts - JAB14 Presentation Transcript

  • Writing code that lasts. Rafael Dohms
 @rdohms photo: djandyw.com
  • Writing code 
 you won’t hate tomorrow. Rafael Dohms
 @rdohms photo: djandyw.com
  • Let me introduce you to someone…
  • No Tests. Wrote his own framework. 500 line methods. Used Singletons!
  • photo: Rob Allen (@akrabat)
  • REWRITE ALL THE CODE!
  • Real Developers, SHIP STUFF. photo: Glyn Lowe Photoworks
  • How do we find balance? photo: Kalexanderson
  • Code has an expiration date photo: CarbonNYC
  • Code is perishable, it rots. photo by: massdistraction
  • Code Evolves photo by: kevin dooley
  • Languages evolve. photo by: raneko
  • You evolve. photo by: Kaptain Kobold
  • Complexity 
 kills Comprehension photo: osbornb
  • Bad Design photo: miskan
  • Bad specs
  • NIH source: Urban dictionary photo by: John 'K'
  • NIH | nɒt ɪnˈventɪd hɪə |
 Not Invented Here —The German art of humiliating any technology, agricultural product, or (medical) scientific work that has not been invented or produced in Germany, Switzerland, or Austria. source: Urban dictionary photo by: John 'K'
  • The Solution™ photo: Ian Sane
  • Improve code
  • Improve code make it easier to comprehend
  • Improve code make it easier to comprehend make it flexible
  • Improve code make it easier to comprehend make it flexible make it tested
  • Improve code make it easier to comprehend make it flexible make it tested make it easier to replace, refactor
  • Improve code make it easier to comprehend make it flexible make it tested make it easier to replace, refactor make it not exist
  • Good Design Concepts
  • SOLID Single Responsibility
 Open/close
 Liskov substitution
 Interface segregation
 Dependency inversion
  • STUPID Singleton
 Tight Coupling
 Untestability
 Premature Optimization
 Indescriptive Naming
 Duplication
  • Composer
  • PIE Proudly
 Invented
 Elsewhere
  • guzzle/guzzle HTTP client for RESTful API clients
  • morrisonlevi/ardent A library of collections for PHP
  • Readability photo: Morgenland
  • paragraphs photo: Trossachs Photography
  • whitespace
  • R&D Team for MIH/Naspers São PauloCape Town
  • Object Calisthenics photo by: boston_public_library
  • Calisthenics /ˌkaləsˈTHeniks/ Calisthenics are a form of dynamic exercise consisting of a variety of simple, often rhythmical, movements, generally using minimal equipment or apparatus. photo by: boston_public_library
  • Its about perception, not rules or standards photo by: david_a_l
  • Sunday
 12:00 Voyager Room
  • #1 Only one indentation level per method. photo by: justinliew
  • #2 Do not 
 use else photo by: justinliew
  • #3 Wrap primitive types, if they contain behavior photo by: justinliew
  • #4 Only one 
 -> per line photo by: justinliew
  • #5 Do not abbreviate. photo by: justinliew
  • #6 Keep your classes small. photo by: justinliew
  • #7 Limit your instance variables to less then 5 photo by: justinliew
  • #8 Use first class collections photo by: justinliew
  • #9 Use getters and setters. photo by: justinliew
  • #10 Document your code. photo by: justinliew
  • Your turn.
  • Improve yourself!
  • Read lots of code!
  • Write simple code.
  • Try Object Calisthenics for a month.
  • Use someone else’s code.
  • Share bite size libraries.
  • Thank you. http://slides.doh.ms http://doh.ms @rdohms
  • http://l.doh.ms/oc-links Video recording Slides Books Resources on 
 Object Calisthenics