top | item 42101938

(no title)

johntdaly | 1 year ago

I am a Ruby programmer that came to Ruby as a Python programmer that had do do work mainly in PHP and JavaScript (no jobs in Python where I lived at the time). I sort of liked JavaScript (I know it so well now that I’m ambivalent about JavaScript) and started to really despise PHP (most of the problems I hated back then are gone now but I can’t go back). When I searched for a job that wasn’t PHP or Java based I found a Ruby on Rails job and Ruby really did something for me (and with me). I really liked it and was a bit confounded because I’ve looked into it before and it didn’t do anything for me back then.

Since then I’ve returned to Python for some projects and I find that Python made me better at Ruby and Ruby made me better at Python. JavaScript, Ruby and Python are my main goto languages for scripting and web programming and I think Ruby is getting the short end of the three languages. It deserves better and I think more people, especially web developers and people that need a *NIX scripting language should give it a try.

What I don’t really understand is that we (Ruby programmers) still use indentation for block definition as a reason against Python. Especially since yaml, haml and sass are technologies we helped build and popularize and they are all indentation based. I still agree that Python is the less elegant and more importantly the less fun language.

discuss

order

hoistbypetard|1 year ago

> What I don’t really understand is that we (Ruby programmers) still use indentation for block definition as a reason against Python. Especially since yaml, haml and sass are technologies we helped build and popularize and they are all indentation based.

The article was written by an LLM[1], not a Ruby programmer.

[1](https://news.ycombinator.com/item?id=42102000)

johntdaly|1 year ago

Now I get your point. That would be a good explanation why the arguments are surface level and regurgitated. This is not really something I want to have to look out for.

codesnik|1 year ago

nobody serious uses indentation as a bad point against Python. Ruby pretty much could work with indentation instead of "end" almost without drawbacks. Maybe irb would be slightly less convenient, and that's it. Whitespace IS significant in ruby too, it's just goes so much along with the programmer's intuition that it rarely bites anyone.

johntdaly|1 year ago

Indentation was seriously being used as a point against Python when I came to Ruby and we had lots of DSLs that where indentation based back then. I always felt that do be BS and I think it is meant seriously here too, in this article. I do agree that isn’t an argument I have heard used seriously in a long time tough.

zahlman|1 year ago

The usual argument is that bracketed syntax rather than indentation-based syntax makes it possible/easier to have multi-line anonymous functions (such as with Ruby's block syntax), and especially to use them within more complex expressions.

Pythonistas generally consider that a misfeature.