SlideShare a Scribd company logo
Quality Rails Coding
Before we begin...
- Discussion encouraged!
Who am I?
- Calum Halcrow
- Ruby Developer
- Rapid River Software
- "There are no experts, there’s only us"
What is code quality?
What is code quality?
- Extensible.
- Easy to understand/modify; simple.
- “bug free”; bugs almost never make it to production.
- ??? (the UX itself?)
How do you achieve code quality?
How do you achieve code quality?
- Single responsibility principle.
- How things are named; self-documenting code.
- Well thought out data model.
- Code review, from humans and automated tools.
- Obsessive attention to testing.
Single responsibility principle.
Single responsibility principle.
Single responsibility principle.
- Apply to classes.
- Apply to methods.
- Implies the need to use non-model classes to perform
business processes.
- service objects, DCI, trailblazer?,
“7 Patterns to Refactor Fat ActiveRecord Models”
How things are named; self-documenting code.
- Why write documentation when someone can just read the
code?
- Leads to readable, understandable code.
- Can show where your code needs to be simplified.
- Is difficult!
- Expand your English vocabulary.
Well thought out data model.
- Once you’ve got this right, it will seldom change.
- Rails ERD.
Code review, from humans and automated tools.
- Automated tools can take you far…
- rubocop (-a for auto-fixing!), CodeClimate, simplecov,
rails_best_practices, brakeman, bullet, CI, ???
- …humans can take you the rest of the way.
- code review (via PR), pair programming, etc.
Obsessive attention to testing.
- Always be confident that a passing test suite => that
your app is working.
- Always be thinking “how will I test this”.
- TDD?
- Constantly maintain/improve your test infrastructure.
Mindset.
- “Always code as if the guy who ends up maintaining your
code will be a violent psychopath who knows where you
live. Code for readability.” - John F. Woods
- Go further than just making it work.
- “No rush, no distractions” - Calum Halcrow !
Fin.

More Related Content

PDF
Backend roadmap
PPT
Writing Good Code
PPT
PPT
DOCX
Hoe blog aanmaken
DOCX
Lencana skjp 2
DOC
Martin Connor Burnett CV 2015
PPTX
Slide share demo
Backend roadmap
Writing Good Code
Hoe blog aanmaken
Lencana skjp 2
Martin Connor Burnett CV 2015
Slide share demo

Viewers also liked (14)

DOC
~$Sumen novela yuyo
PPTX
Cursos de Informática do SENAC-RN
PDF
portofolios-SGM
PDF
Pdf version
PDF
infografia
PDF
Esa pss-01-718
DOC
Cover that emergency expense
DOCX
Bolger Compliance
PDF
Neu Microsoft Office Word-Dokument.pdf
PDF
The babys own aesop
PDF
Bilhete de Identidade da Ana
PDF
Foro "Apropiación de la lectoescritura: retos, mitos y realidades"
PPT
áGua escola 14
PPTX
Anatomy Of An Agile .Net Project
~$Sumen novela yuyo
Cursos de Informática do SENAC-RN
portofolios-SGM
Pdf version
infografia
Esa pss-01-718
Cover that emergency expense
Bolger Compliance
Neu Microsoft Office Word-Dokument.pdf
The babys own aesop
Bilhete de Identidade da Ana
Foro "Apropiación de la lectoescritura: retos, mitos y realidades"
áGua escola 14
Anatomy Of An Agile .Net Project
Ad

Similar to Quality rails coding (20)

PDF
Developer Job in Practice
PPTX
Writing Clean Code
PDF
Effective entrepreneurship for developers
PPTX
Static-Analysis-in-Industry.pptx
PPT
Planning JavaScript and Ajax for larger teams
PPT
Code Quality
PDF
Writing code for people
PDF
Mob Programming for Continuous Learning
PDF
15 Experts on the Art of JavaScript Programming
PPTX
BDD - Collaboration for Continuous Delivery
PDF
Scottish Ruby Conference 2014
PPTX
Crafting Great Code
PPTX
Gateway to Agile: XP and BDD
PDF
Richardrodger nodeday-2014-final
PDF
Richardrodger nodeday-2014-final
PDF
Hire a Machine to Code - Michael Arthur Bucko & Aurélien Nicolas
PPTX
"Hands Off! Best Practices for Code Hand Offs"
PDF
Best practices for JavaScript RIAs
PDF
Worse Is Better, for Better or for Worse
PPTX
“One man” development process model
Developer Job in Practice
Writing Clean Code
Effective entrepreneurship for developers
Static-Analysis-in-Industry.pptx
Planning JavaScript and Ajax for larger teams
Code Quality
Writing code for people
Mob Programming for Continuous Learning
15 Experts on the Art of JavaScript Programming
BDD - Collaboration for Continuous Delivery
Scottish Ruby Conference 2014
Crafting Great Code
Gateway to Agile: XP and BDD
Richardrodger nodeday-2014-final
Richardrodger nodeday-2014-final
Hire a Machine to Code - Michael Arthur Bucko & Aurélien Nicolas
"Hands Off! Best Practices for Code Hand Offs"
Best practices for JavaScript RIAs
Worse Is Better, for Better or for Worse
“One man” development process model
Ad

Recently uploaded (20)

PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
DOCX
573137875-Attendance-Management-System-original
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPT
Mechanical Engineering MATERIALS Selection
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Digital Logic Computer Design lecture notes
PDF
PPT on Performance Review to get promotions
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
Internet of Things (IOT) - A guide to understanding
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
573137875-Attendance-Management-System-original
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Mechanical Engineering MATERIALS Selection
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Digital Logic Computer Design lecture notes
PPT on Performance Review to get promotions
R24 SURVEYING LAB MANUAL for civil enggi
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
OOP with Java - Java Introduction (Basics)
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Internet of Things (IOT) - A guide to understanding

Quality rails coding

  • 2. Before we begin... - Discussion encouraged!
  • 3. Who am I? - Calum Halcrow - Ruby Developer - Rapid River Software - "There are no experts, there’s only us"
  • 4. What is code quality?
  • 5. What is code quality? - Extensible. - Easy to understand/modify; simple. - “bug free”; bugs almost never make it to production. - ??? (the UX itself?)
  • 6. How do you achieve code quality?
  • 7. How do you achieve code quality? - Single responsibility principle. - How things are named; self-documenting code. - Well thought out data model. - Code review, from humans and automated tools. - Obsessive attention to testing.
  • 10. Single responsibility principle. - Apply to classes. - Apply to methods. - Implies the need to use non-model classes to perform business processes. - service objects, DCI, trailblazer?, “7 Patterns to Refactor Fat ActiveRecord Models”
  • 11. How things are named; self-documenting code. - Why write documentation when someone can just read the code? - Leads to readable, understandable code. - Can show where your code needs to be simplified. - Is difficult! - Expand your English vocabulary.
  • 12. Well thought out data model. - Once you’ve got this right, it will seldom change. - Rails ERD.
  • 13. Code review, from humans and automated tools. - Automated tools can take you far… - rubocop (-a for auto-fixing!), CodeClimate, simplecov, rails_best_practices, brakeman, bullet, CI, ??? - …humans can take you the rest of the way. - code review (via PR), pair programming, etc.
  • 14. Obsessive attention to testing. - Always be confident that a passing test suite => that your app is working. - Always be thinking “how will I test this”. - TDD? - Constantly maintain/improve your test infrastructure.
  • 15. Mindset. - “Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. Code for readability.” - John F. Woods - Go further than just making it work. - “No rush, no distractions” - Calum Halcrow !
  • 16. Fin.