4 ms·
In my opinion Ruby has a slightly more obscure syntax with custom symbols, and it's C API is not as clean and well put together as Python's.
by Game_Ender 15y ago
In my opinion Ruby has a slightly more obscure syntax with custom symbols, and it's C API is not as clean and well put together as Python's.
- 16s 15y agoWhich is more obscure? Reverse a string in ruby: string.reverse() Reverse a string in python: string[::-1]
- evincarofautumn 15y agoSlice syntax in Python always bothered me. This would be slightly more readable: ''.join(reversed(string)) Except it requires you to have an idea of how iteration works (beginners don’t) and why that “join” needs to be there, and it’s still an order of magnitude slower. But hey. Ruby is prettier in some ways, Python in others, and beggars, as they say, can’t be choosers.
- 16s 15y agoWay way slower than the slicing.
- TylerE 15y agoWhat an odd example. Other than perhaps a palindrome detector, I'm having a really hard time coming up with a use for a reversed-strings. Python DOES provide a reverse for arrays.