3 ms·
I've only been using Python for 2 months now. I'm coming from a Ruby, Java, Node background. The things I don't understand about Python and what I miss the most
by monster2control 11y ago
I've only been using Python for 2 months now. I'm coming from a Ruby, Java, Node background. The things I don't understand about Python and what I miss the most from those other languages is a solid tool chain. From package management down to the test runners. I miss Ruby gems, Bundler, Rack, and Gaurd tools. I miss Maven and the plethora of plugins. I miss NPM.
Pip is just OK. It feels like it's missing something. Could be a simple lack of experience still. I haven't found anything like Gaurd yet and yet to find a replacement for rack and NPM 's simple package.json. There is setup.py but it feels harder and wrapped in mystery still and doesn't work universally the same for Python 2 and 3 which I have been causing some road blocks and extra cycles being wasted.
Most of all I hate the backward compatibility issues of Python 2 to 3. I rarely have issues running older Ruby or Java code in newer versions of the language. It seems ridiculous that it's been a little over 7 years and people are still fighting with issues between Python 2 and 3 and you still need to pick a version to use. Sure you can code around it, but why the interpreter doesn't handle backward compatibility with deprecation statements is just amazing to me. This isn't a new thing. Languages like Java and Ruby do it as do plenty of others I'm sure if you wanted to make a syntax change you can handle the code in the interpreter and issue warnings to uograde them without breaking all old code bases.
But any ways, I digress, I don't think Python is going anywhere. Too many people and companies use it. It's got a lot of good libraries and and if you just start with Python 3 it's language is just like any other programming language. It's got some things you have to get used to that are unique to it but in the end, you can make it do what you need.
I personally think Ruby allows for nicer looking code and readability, and NodeJS has a far better Eco system. Hell, Languages like Elixir feel like a nice mixture of both with the huge added benefits of being highly parallel at the VM layer.
PyPy seems like a better place to invest resources since the JIT can really speed things up.
That's my 2 cents.
- csense 11y ago> Ruby allows for nicer looking code and readability Have you ever actually used Ruby? Here's what FizzBuzz looks like in Python: def fizz_buzz(number): if number%3 == 0: return "fizz" if number%5 == 0: return "buzz" return str(number) for num in range(1,101): print(fizz_buzz(num)) Compare that to the hideous mess of fizz buzz in Ruby [1] -- there's a lot of magic going on there. Many unfamiliar operators, line #2 is a magic string interpolation thing with tons of weird escaping going on (the #{} seems to be some kind of template which makes stuff inside the "" string actually be interpreted as code which itself contains '' strings, and I don't want to think about the potential injection vectors that could be introduced by this), the ternary operator, absolute value bars, an anonymous function, and defining a function by binding an anonymous function created with -> function call syntax to a name. People on HN keep saying Ruby is intuitive and easy to learn -- no it isn't. The Python code by contrast is basically the same as the pseudo code you would write on a napkin in "not-any-particular-language-I-just-want-to-describe-an-algorithm-without-language-specific-issues-to-get-in-my-way". [1] http://hostiledeveloper.com/2014/04/26/on-why-learning-to-program-is-hard.html http://hostiledeveloper.com/2014/04/26/on-why-learning-to-pr...
- zimpenfish 11y agoHere's what your code looks like in Ruby: def fizz_buzz(number) if number%3 == 0 then return "fizz" end if number%5 == 0 then return "buzz" end return number end for num in 1.upto(100) do puts(fizz_buzz(num)) end Don't mistake someone fannying about with code-golfing for the language itself. (Also your code is wrong - it never prints "fizzbuzz" which it should for 15, 30, 45, etc.)