Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

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.


I'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.


The 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 :)


I 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.


In ruby you could just write

  2
assuming you're at the end of a function. Coffeescript is the same iirc.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: