I have heard that for years and I just don't get it. Magic abounds. The test assertions and testing libraries are whole DSLs that require a separate/additional learning process with inconsistent chaining with inconsistent return types. Being able to overwrite anything in the language gives rise to things like unicode whitespace being misinterpreted as an undefined function. You can define methods by combining method names leading to wholly undiscoverable methods because "my_func_that_is_cool" is actually defined over multiple files, combining my_func and that_is_cool; saw this a lot in our chef cookbooks. Ruby requires mountains of tests (thus the DSLs). Knowing ruby and knowing rails and knowing how to test are different things.
I find ruby (and rails) to bring the opposite of joy. I find myself frustrated. On the opposite end of magic is Go. I love Go. Tests are just code; no magic needed, not even mocks. Methods behave and usage is consistent. Code is navigable. Types make everything more explicit and easy to follow and more maintainable.
I assert Go leads to org happiness, letting teams work together productively.
I am not trying to convince you as you are already decided and your experience and feelings are valid. I think different programming languages can fit to different people and there is no bad choice here.
For anyone else reading this and considering Ruby I have to say the followings:
1. No, there is no magic in Ruby but there is flexibility and metaprogramming. Everything that appears magic is allowed by Ruby syntax and can be traced down to a few meta programmimg features. It might be hard to get it when you see it first, but please do make sure you understand Ruby and then you will also get the magic.
2. You can choose to use Minitest (which is Rails default testing framework) instead of RSpec and Minitest is Ruby code with few methods for assertion.
3. Mocking is an important part of testing
4. In any programming language and even agnostic of any programming language knowing how to code is different than knowing how to test. The testing framework is just an abstraction that should translate your test cases into executable tests.
I always thought it was funny that people criticize the "magic" of certain frameworks, when at its core, almost all programming is magic (since it is almost always an abstraction). And there is probably no clear distinction on where non-magic ends and magic starts.
But somehow, no one complains about having a GC instead of needing to use `malloc`/`free` or `fetch` doing the DNS query automatically.
And that's exactly _why_ I use frameworks and libraries. So I don't have to write low level code, or as one could call it, to use some magic.
As much as I really hate the Ruby magic, I have to say, it's always about doing the right thing, at the right time, for the right purpose. Even more on the kind of magic Rails use.
I personally can't handle it. It's completely frustrating. Nothings documents what your system is doing, and nobody on the community seems to have an inch of clue about what exactly is happening on their computers. But you can't deny that it works, and works well... unless you need to override something due to a niche use-case.
Maybe that was true for PHP before 7. For me php make sense. Ruby on the other hand feels like it was made by an alien who learned human language by reading books that were shredded to pieces and glued together randomly
sethammons|10 months ago
I find ruby (and rails) to bring the opposite of joy. I find myself frustrated. On the opposite end of magic is Go. I love Go. Tests are just code; no magic needed, not even mocks. Methods behave and usage is consistent. Code is navigable. Types make everything more explicit and easy to follow and more maintainable.
I assert Go leads to org happiness, letting teams work together productively.
gls2ro|10 months ago
For anyone else reading this and considering Ruby I have to say the followings:
1. No, there is no magic in Ruby but there is flexibility and metaprogramming. Everything that appears magic is allowed by Ruby syntax and can be traced down to a few meta programmimg features. It might be hard to get it when you see it first, but please do make sure you understand Ruby and then you will also get the magic.
2. You can choose to use Minitest (which is Rails default testing framework) instead of RSpec and Minitest is Ruby code with few methods for assertion.
3. Mocking is an important part of testing
4. In any programming language and even agnostic of any programming language knowing how to code is different than knowing how to test. The testing framework is just an abstraction that should translate your test cases into executable tests.
Lukas_Skywalker|10 months ago
But somehow, no one complains about having a GC instead of needing to use `malloc`/`free` or `fetch` doing the DNS query automatically.
And that's exactly _why_ I use frameworks and libraries. So I don't have to write low level code, or as one could call it, to use some magic.
marcosdumay|10 months ago
I personally can't handle it. It's completely frustrating. Nothings documents what your system is doing, and nobody on the community seems to have an inch of clue about what exactly is happening on their computers. But you can't deny that it works, and works well... unless you need to override something due to a niche use-case.
TiredOfLife|10 months ago