3 ms·
The formatting string itself, sure - fine. What I think is ugly is using an operator (%) to call a function like that :/ It's just non-obvious and quirky. If yo
by axod 17y ago
The formatting string itself, sure - fine. What I think is ugly is using an operator (%) to call a function like that :/ It's just non-obvious and quirky. If you don't know ruby you won't be able to guess what it's doing.
- natrius 17y agoThe best solution here is probably to learn Ruby. There are plenty of non-obvious things in various programming languages. The benchmark should be readability by people who know the language.
- axod 17y agoI disagree. Most languages you can take a guess at without learning them. It's horrible things like this operator that will catch people out.
- Andys 17y agoI guess that any seasoned programmer would be well-aware of the printf notation (%.2f) and would immediately guess that % must be a printf operator in this language. I love using printf all the time in my programs and it is one of my litmus tests for a new language - does it have easy quick access to sprintf? (Java failed this test)