4 ms·
I’m a longtime PHP/JS dev who recently decided to give Ruby and Rails a look given its influence on Laravel. The first thing I did was read the Rails Doctrine a
by scop 3y ago
I’m a longtime PHP/JS dev who recently decided to give Ruby and Rails a look given its influence on Laravel. The first thing I did was read the Rails Doctrine and, while I appreciated most of it, I thought "The Principle of The Bigger Smile" and DHH’s comments re Ruby's elegance were one self-indulgent-bridge too far. Back to the jaded PHP cave I go...
That was until I learned that in Ruby:
`someObj.some_var = 'hello'`
Is syntactic sugar for:
`someObj.some_var=('hello')`
That made me smile. I have never smiled like that about a programming language. It literally gave me joy.
I’ll be honest I have some trepidation devoting my time now to something “old”, but on the flip side my career is in PHP so what the hell am I talking about “old” for.
- corytheboyd 3y agoYou’re going to love writing tests for Ruby! Nearly everything is a message send, which works insanely well with testing libraries. It’s so damn easy and clean to reach meaningful test coverage in Ruby where it feels like a chore in other languages