Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Similar feelings here. Ruby's philosophy of providing a ton of different ways to do the same thing can lead to some pretty sweet-looking code, almost like poetry... but I'd rather have Python's stylistic consistency and better-integrated type hints. Now that Python has Poetry and uv, Ruby's main remaining advantage has evaporated and it's hard for me to justify using the language.

Another thing I don't like about Ruby is how much the community has embraced the Clean Code brand of readability snake oil. It's easy to come by the opinion that any function over 5 lines is a code smell and over 10 lines it's outright bad. I've even heard the view that if-else statements are a code smell and I should always try to replace them with different classes that have the same interface. To be fair, that only happened twice, but that's two more times than I've heard it from users of any other language. I think that the Python community usually strikes a better balance between avoiding excessive function/class length and avoiding excessive indirection.



> Another thing I don't like about Ruby is how much the community has embraced the Clean Code brand of readability snake oil.

This also puts me off every time, and I've dealt with people who embrace this a lot as a Ruby programmer. Fortunately, you can ignore them and still enjoy writing Ruby code the way you want.


I inherited a project where this was taken to the extreme. We have a class that's used to calculate final pricing taking into account discounts, coupons, shipping fees (or free shipping). Each one of those values was implemented as methods but then we have a call like: method_a - method_b + method_c, but it turns out, method_a may be adding shipping_cost for it to then be subtracted out in method_b. We ended up refactoring this and removing all the needless methods and just have a simple inline calculation. Definitely not "clean".


I feel you. Rubocop is certainly rather a bikeshedding tool than a linter at this point.

The forced if/else transformations drive me nuts.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: