DEV Community

Discussion on: Python Slices vs Ruby blocks

 
redfred7 profile image
Fred Heath

I didn't know that Python functions were also closures so thanks for that! And yes, Ruby functions (methods) are scope gates, the scope changes as soon as you enter them so they're not closures.

I suppose it comes down to different programming philosophy and approach between Ruby and Python. If you love well-structured, one-way-of-doing-it approaches then Python is for you. Ruby is more loose in that sense but that's why I (and many others) find it so attractive.

As for JavaScript, well, don't get me started :D