3 ms·
By which measure is <- 2 easier to read than return 2 There are many more examples in the code, but I generally found the PHP code MUCH easier to re
by pietro 15y ago
By which measure is
<- 2
easier to read than
return 2
There are many more examples in the code, but I generally found the PHP code MUCH easier to read, and I don't know PHP very well. It could be that I'm biased towards C-like languages, but I doubt it; words are a lot easier to read than arbitrary symbols.
- protomyth 15y agoI wouldn't have blinked if it was: ^ 2 since that is what is used in Smalltalk, but the left arrow makes me think I am missing what it should point to.
- JonnieCache 15y agoIn ruby you could just write 2 assuming you're at the end of a function. Coffeescript is the same iirc.
- cageface 15y agoI've never written a line of php code in my life but on my current project I was asked to port some code from my client's php server api to native Obj-C running in an app. I had no trouble reading the php code and had the port working in under a day.
- runekaagaard 15y agoThe original reason for "<-" was to have it implement a "inner return", that should be "<--". Now I think there should only be one return type, but "<-" still looks ok to me as it points the value back as trying to "return" it :)