Movatterモバイル変換


[0]ホーム

URL:


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

[SaigonRB#20] Clean code in Ruby

Avatar for Hoang Duc Quan Hoang Duc Quan
March 14, 2025

[SaigonRB#20] Clean code in Ruby

Avatar for Hoang Duc Quan

Hoang Duc Quan

March 14, 2025
Tweet

More Decks by Hoang Duc Quan

See All by Hoang Duc Quan

Other Decks in Programming

See All in Programming

Featured

See All Featured

Transcript

  1. Clean code in Ruby Clean code, coding convention, Rubocop and

    Pronto
  2. About me Hoang Quan Born: Hanoi, Vietnam Work: Tokyo, Japan

    Github: BlazingRockStorm Viblo: Hoàng Đức Quân
  3. Agenda Topics Covered Why clean code is necessary? Coding convention

    Rubocop and setup Pronto and integration with Github actions
  4. Why clean code is necessary? Go Back to Agenda Page

  5. Clean code is the code that is easy to read,

    understand, and maintain What is clean code?
  6. Readability and maintenance: Clean code prioritizes clarity, which makes reading,

    understanding, and modifying code easier. Writing readable code reduces the time required to grasp the code's functionality, leading to faster development times. Why clean code is necessary?
  7. Team collaboration: Clear and consistent code facilitates communication and cooperation

    among team members. By adhering to established coding standards and writing readable code, developers easily understand each other's work and collaborate more effectively. Why clean code is necessary?
  8. Debugging and issue resolution: Clean code is designed with clarity

    and simplicity, making it easier to locate and understand specific sections of the codebase. Clear structure, meaningful variable names, and well-defined functions make it easier to identify and resolve issues. Why clean code is necessary?
  9. Improved quality and reliability: Clean code prioritizes following established coding

    standards and writing well-structured code. This reduces the risk of introducing errors, leading to higher-quality and more reliable software down the line. Why clean code is necessary?
  10. Why clean code is necessary?

  11. Coding convention Go Back to Agenda Page

  12. Coding convention Coding conventions are a set of guidelines for

    a specific programming language that recommend programming style, practices, and methods for each aspect of a program written in that language.
  13. Coding convention These conventions usually cover file organization, indentation, comments,

    declarations, statements, white space, naming conventions, programming practices, programming principles, programming rules of thumb, architectural best practices, etc. These are guidelines for software structural quality.
  14. Coding convention Different organizations have different coding conventions and code

    styles
  15. Coding convention with Ruby https://ruby-style- guide.shopify.dev/ https://github.com/cookpad/style guide/blob/master/ruby.en.md

  16. Coding convention with Ruby

  17. How can we implement coding rules in Ruby?

  18. Rubocop and setup Go Back to Agenda Page

  19. Rubocop RuboCop is a Ruby code style checker (linter) and

    formatter based on the community-driven Ruby Style Guide. RuboCop is extremely flexible and most aspects of its behavior can be tweaked via various configuration options. In practice RuboCop supports pretty much every (reasonably popular) coding style that you can think of. Apart from reporting problems in your code, RuboCop can also automatically fix some of the problems for you.
  20. Rubocop: Setup

  21. Coding convention with Ruby

  22. Pronto and integration with CI/CD (Github actions) Go Back to

    Agenda Page
  23. https://github.com/prontolabs/pronto Pronto runs analysis quickly by checking only the relevant

    changes. Created to be used on GitHub pull requests, but also works locally and integrates with GitLab and Bitbucket. Written in Ruby Pronto
  24. https://github.com/BlazingRockStorm/rails- lyrics-site/pull/33 Pronto

  25. Pronto

  26. — https://youtu.be/smDgS8E_-jI? si=IpGH-9lUoL8QP2RD

  27. Thank you!


[8]ページ先頭

©2009-2025 Movatter.jp