Hacker News new | ask | show | jobs
by amorphid 3636 days ago
I like what a friend of mine who went from Ruby to Python said... "Python is easier to understand, harder to love."

For me personally:

* I like Rubygems & Bundler more than Pip

* I find the split between Python 2.x and 3.x to be obnoxious

* Python whitespace indentation bugs me a lot

TL;DR -- Python isn't much different than Ruby in terms of what it can and cannot do. Personally, my new favorite language is Elixir, which does a whole bunch of stuff neither Ruby or Python does particularly well.

1 comments

I hate whitespace indentation on principle (and practice of copypasting code written in a different editor). But after spending too much time trying to parse endless )})})}}} in JavaScript, the Python approach seems like a much better way of doing it.

It seems like pure C programmers are pretty well behaved with their curly braces through.

Any radically different blocking paradigms besides indentation and parenthesis-like things?

The same indentation Python uses in lieu of closing curly braces, can help your issue, so instead of:

    [].map(function (foo) {baz(bar(foo))});

You could write:

    [].map(
        function (foo) {
            baz(
                bar(foo)
            )
        }
    );
Alternatively (or in addition to that), use a decent IDE, which will highlight matching parenthesis, curly braces, allow code folding, etc.

I've never heard a builder say "I don't like screws, nails are better because they work better with my hammer".

I disliked Pythons whitespace when I first started using it. Then after a while I went back to update a Perl script, moved some blocks of code around, then got the dreaded missing brace problem. Its worth it to eliminate that problem alone.

Now the only problem I have with whitespace, is when I switch to other languages and forget a semicolon at the end of lines.

Lua and Ruby use the keyword "end" to signal the end of a function or loop. I much prefer that.