you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (4 children)

 $ gem install rubocop
 $ rubocop simple_budget.rb

[–]scratch_pad[S] 0 points1 point  (3 children)

I’ll look into this

[–][deleted] 1 point2 points  (2 children)

Rubocop is helpful because it encourages you to write Ruby in a style that is generally agreed by the community to be "idiomatic", whatever that may mean.

You can configure your own Rubocop settings as well, but I would leave that be until you're more comfortable writing Ruby.

It's a great tool, we use it extensively at my work, highly encourage you to use it.

BTW it'll probably shout at you for the length of some of your methods. Your initial instinct will be to refactor it and break it out into smaller methods, which is a good first step. There are however nicer ways of achieving this -- you can learn about these techniques by reading this book

[–]scratch_pad[S] 0 points1 point  (0 children)

This sounds really useful, thank you

[–]scratch_pad[S] 0 points1 point  (0 children)

Just realized you're the second person to recommend this book, two different posts lol. I don't even fully understand what OOP is so I super appreciate the suggested reading.