3 ms·
Ruby may be a TIMTOWTDI language, but on the other hand, without calling a method, proc, etc. to do so, every type of basic object usually has a single way to c
by twelvechairs 15y ago
Ruby may be a TIMTOWTDI language, but on the other hand, without calling a method, proc, etc. to do so, every type of basic object usually has a single way to create it (Procs excluded - I really dont like the way ruby handles these - but thats just me and I still like Ruby).
Symbols always start with a ':'. Creating a symbol from 'foo:' is quite foreign to me (as a 1.8.x user) - ':foo :' [replacing hash rocket with a colon] or similar I would have no complaints about.
- ericwaller 15y agoI agree that the lack of ':' preceding a symbol is the most awkward part. Especially since it only works in object literals. It means that the expression { :test => 1 } == { test: 1 } is true, but the expression { :test => 1 } == { test : 1 } results in a syntax error. In other words test: is almost like a preprocessor directive for :test => which is a strange expansion to have by default in a language.