ltenzil / scrape

Scrape talks about building reports on user entered keywords and its search results (Google)
0 stars 0 forks source link

Code style improvements #13

Open longnd opened 2 years ago

longnd commented 2 years ago

The application seems to not follow a common coding style guide, e.g Ruby style guide so several places can be improved for a better code style

by using a gem like rubocop, it would help to prevent these issues

ltenzil commented 2 years ago

Yes I have used it before. I missed those blank space, my bad.

I have different opinions on: (I like it this way)

ltenzil commented 2 years ago

Resolved in #21

longnd commented 2 years ago

Yes I have used it before.

May I know why you don't use it anymore, or why you just don't use it in this code challenge? IMO, following a coding styleguide would be helpful to keep the codestyle consistent & easy to read to other people.

I have different opinions on: (I like it this way)

when you use Rubocop, did you make some exceptions like that while other people still follow the common styleguide?

ltenzil commented 2 years ago

Long ago before using Rubocop, I went with my own style. In my own projects, when controllers doesn't have much methods under private. so I used to indent it. which happened to help me. Models usually i don't indent.

And my exceptions are with my personal projects only where i learn stuff trying to do things differently. Before accepting the rule (pros), I need to understand the cons by a working on a piece of code.

My exceptions are not with the projects where i work as a team. And with organization projects, everyone in team follows the selected style guide. I remember using a commit hook which throws warning. There are few legacy projects, i worked which doesn't go well with Rubocop.

I remember one of the exceptions, we had in team's style guide => 'Style/RedundantBegin was set to false.' I believe every team has their own exceptions.