Hacker News new | ask | show | jobs
by gorgoiler 2093 days ago
I would never share a Ruby code base with anyone either. It’s like issuing kindergartners a can of silly string and asking them to be sensible with it.

I consider myself a sensible developer, but even I’ve had some childish moments with Ruby: doing something I thought was clever and productive but which really just made my code inscrutable and unmaintainable...

...by other people. The flip side is I can just about figure out what I was trying to do when I read my own code: enough so that I still always use Ruby for personal projects.

Ruby is just too much fun and critically, to date, it’s the only language where I can write a page of code at the same speed I am thinking. It also usually executes first time without any errors, which is a joyous thing.

I am not claiming to be some kind of 10x uber hacker. Ruby just happens to be an incredibly wonderful language for thinking aloud with code.

1 comments

Why wouldn't you share your Ruby code with others? As a Ruby developer I an assure you, us Rubyists can work and understand each other's code.
To be frank, the language just isn’t boring enough.

In my experience, a company’s code should be like the style of English used in an instruction manual. It should clearly and plainly express the business logic behind the company’s mission.

Ruby is more like writing poetry. There’s nothing stopping one from writing boring, unambiguous, clear code in Ruby of course. As a Ruby developer, I’m sure your code looks very clear.

The reality is that other languages make it easier to enforce clarity. See gofmt for example, which standardizes Golang’s formatting, taking one more axis of “creativity” away from the less disciplined developers.

I second adding Rubocop. But sure, Ruby has a way richer syntax and a higher freedom degree than a language like Go. It's part of what makes Ruby what it is. If high degree of freedom isn't something you want Ruby isn't a good choice.
Add rubocop to your editor.

You can get it to discipline you as much or as little as you like.