About the style.
benjycui opened this issue · 5 comments
Not the code style, but the style of APIs. I am a JavaScript programmer and rust novice, and I am very interest in this project. But when read your readme.md, I found that the APIs' style is very different from underscore.js. So, is it impossible to imitate that style in Rust, or you have consider more? THANKS.
Hi, benjycui. Thank you for your pointing out. I try to rewrite README to clear difference between underscore.js, underscore-rust and rust std library. Wait a moment please.
First, it is possible to imitate original style. In fact, I had been implemented in original style.
But I thought vec!(1i, 2, 3).first()
betters than __.first(vec!(1i, 2, 3)
because
- it is in accordance with the OOP
- you need not consider about type at first argument
__.first
imply incorrect type at first argument like__.first(HashMap::new())
If you're embarrassed to be compared with the original function, refer to the following my notes (I'm going to include soon the following note in the README)
Brilliant! So, underscore-rust is a complement of Rust std library, inspired by underscore.js but not a port of it, right? THANKS.
Yes.
I'm still thinking about design. If you have other opinion, feel free to send issue or code.
Thank you for answering my questions :)