- Misuse predicates
- Forget to explicitly use “present?”, “blank?”, and “nil?”
- Don’t use memorization
- Forget that first come symbols, then single quotes, and then double quotes
- Use some random numbers and lines
- Often choose short or confusing words to name constants
- Excessively use postconditions
- Forget to remove unused parameters and variables, and other unused code
- Don’t use “public_send” Invokes the method identified by symbol, passing it any arguments specified. Unlike send, #public_send calls public methods only. When the method is identified by a string, the string is converted to a symbol.
- Write long and illegible conditions
- Think less code is always better
- Use obsolete syntax
- Excessively use “when” and “if”
- Don’t use rubocop and other tools for code analysis Rubocop notice almost all the errors described here
- Don’t fully understand the point about commenting Ruby is considered a very high-level language that doesn’t need commenting. Instead of writing another comment to your code, try making it more readable.
https://jetruby.com/
Comments
Post a Comment