Live data from Hacker News

Python Is Eating the World

zdnet.com

781–790 of 993 posts

Re: Python Is Eating the World

#781

Earlier quoted context omitted.

To understand the hate, you have to realise that no one likes being forced into using a particular technology. Especially one that is more of a lowest common denominator and ignores much of the progress in programming language research over the last 40-50 years (e.g. expressive static type systems, and Python still markets itself as "strongly typed").

> and Python still markets itself as "strongly typed" What's wrong with that? It is strongly typed (doesn't coerce everything like Javascript) just not statically typed (objects have types but variables don't).

Type means statically typed unless you qualify it with your own nomenclature "dynamic". Please don't hijack the mathematical definition of type.

Re: Python Is Eating the World

#782
post #728

Earlier quoted context omitted.

Here's some rational "hate" for Python then. I just returned to Python for the first time in a little while to collaborate on a side project and ran into a few tricky-to-debug errors that caused a fair bit of lost time. Know what the errors were? In one case, I was iterating over the contents of what was supposed to be a list, but in some rare circumstances could instead be a string. Instead of throwing a type error,…

Python is a dynamic language, that's what dynamic languages do, you don't have a type checker but have greater flexibility, but you don't have to settle on that, you can actually use mypy and annotate types and get best out of both worlds. > And another one, I typoed a variable name as groups_keys instead of group_keys (or vice-versa, I don't remember). Instead of just throwing an error, Python happily went along wit…

I'm pretty sure this is what they meant...

  def my_func():
      group_keys = 'My thing'
      while group_keys == 'My Thing':
          if some_logic() == 42:
              groups_key = 'My other thing'  # typo here

Re: Python Is Eating the World

#783
post #737

Earlier quoted context omitted.

Here's some rational "hate" for Python then. I just returned to Python for the first time in a little while to collaborate on a side project and ran into a few tricky-to-debug errors that caused a fair bit of lost time. Know what the errors were? In one case, I was iterating over the contents of what was supposed to be a list, but in some rare circumstances could instead be a string. Instead of throwing a type error,…

The first problem is a valid problem in Python: it essentially don't have a "char" type, instead it only have strings with size 1. This actually ruined type annotation in Python: you can't properly annotate a function to accept anything iterable except string. https://github.com/python/mypy/issues/4334 is a FR to at least check it with mypy.

It's not a perfect solution, but you could perhaps hack it with @overload to say that the "str" version returns NoReturn.

Re: Python Is Eating the World

#784

Holy Crap! What a lot of irrational, hyperbolic hate for Python. I think everybody should spend their first couple of years working in Fortran IV on IBM TSO/ISPF. No dependency management because you had to write everything yourself. Or maybe [edit: early 90's] C or C++ development where dependency management meant getting packages off a Usenet archive, uudecoding and compiling them yourself after tweaking the config…

Here's some rational "hate" for Python then. I just returned to Python for the first time in a little while to collaborate on a side project and ran into a few tricky-to-debug errors that caused a fair bit of lost time. Know what the errors were? In one case, I was iterating over the contents of what was supposed to be a list, but in some rare circumstances could instead be a string. Instead of throwing a type error,…

TBO these are way too trivial stuff compared to the argument of the post you're replying to.

Re: Python Is Eating the World

#785

Earlier quoted context omitted.

> Particularly the lack of braces Since most of my professional experience is with C like syntax languages, I don't get how the lack of braces is an advantages, quite the opposite in my limited experience with Python. Braces define scope unequivocally, they are easy to visually parse and don't care whether you are using tabs or spaces or even if you, loud gasp, mix them. Furthermore, you can copy and paste, say for l…

> Braces define scope unequivocally So does whitespace, otherwise Python wouldn’t work as a programming language > they are easy to visually parse only if you indent properly > Furthermore, you can copy and paste, say for loop from a method to another method and it will work. In Python you might have to faff about with spaces (I'm sure there must be IDEs that solve this problem but it was no fun on vim or even notepa…

If I mix and match spaces and tabs, Python will not work and you cannot tell them apart ,it's a bit more subttle than this, but you get the idea (should you wish to).

There is no such issue with braces. This is what i meant.

As for formatting, you can use ide shorcuts to format your pasted code but it will run fine even if not formatted, not the same for Python, where it will not run.

Re: Python Is Eating the World

#786
post #471

Earlier quoted context omitted.

Isn't it also just as much about Python is having it's day, granted a day long in the waiting but many langs go through this (Ruby, PHP) and then it tapers off and the next language has it's day. Probably Go will be the next hotness in 5 years.

> Probably Go will be the next hotness in 5 years. I think it will be difficult to grow a large ecosystem for a language with very poor FFI performance [0] in the long run. Golang's poor FFI performance is the number 1 reason I wouldn't use it for my own projects. [0]: https://github.com/dyu/ffi-overhead

It depends on how active the community is. Java has had the same issue, and people just knuckled down and rewrote stuff in Java.

Re: Python Is Eating the World

#787

Earlier quoted context omitted.

I dont know about F# and ocaml, but haskell's numerical libraries really pale compared to numpy.

It's language vs libraries. If you have a library that has a function get_the_shit_done_quick () than you don't care much about the language. When you don't have such function, you need an expressive language to write it (and a bulk of python libs are not written in python, tho mostly for the performance reasons). So it's all about finding a sweet spot between fancy libraries which do the shit for you, and fancy lang…

Language vs libraries isn't just about an expressive language to build in when you don't have a library. The likelihood of a library's availability also depends on the barrier to entry. An amazing language that isn't usable by biologists won't have many libraries that solve biologist's problems.

To your original point of being "surprised at how many data scientists and quants are ignoring more mathematically principled languages like F#, OCaml and Haskell," I'd much rather use one of those languages, but I'd have to build the foundations myself. Today, they aren't the right tool for the job. They don't have the libraries I need, which means I don't build further libraries for them, making other people less likely to build on them, so they aren't the right tool for the job tomorrow either. I'd say it's a network effects thing primarily.

Re: Python Is Eating the World

#788

What stood out to me: online bullying (dressed-up sometimes as concern/outrage) is what led to Guido stepping down. Python is great, but it will never be perfect. But the outrage stuff, the entitlement stuff, essentially anything that happens on Twitter... Python seems like a victim of it's own success. Once it got popular, it couldn't scale the checks that might have stopped this runaway train of shit-tweets and bic…

What’s wrong with fstrings? I use JavaScript at my day job and leaning python for Raspberry PI projects. Fstrings looks like it’s better than .format or + concatenating + a bunch is strings. Especially large strings.

Re: Python Is Eating the World

#789

And that's a sad thing to hear. Before my death by thousand downvotes, I'd like to tell you why do I feel that way. Back in the day when I was way more inexperienced than I'm now, I was a die-hard Python fanboy. To me, it seemed like a best option available due to it being way more concise and readable than JS/PHP, not to mention that it was way more powerful and dense. I didn't really bother with type safety at the…

> sound and flexible type systems Python has a more powerful type system than any mainstream language except for C++ (templates). No other mainstream language has support for explicit marking of variance of arguments, nor does any other language support literal (dependent) types, except for typescript.

And how's it helping you verify the correctness of your codebase at compile time (it still compiles the source to byte-code before evaluation)? Last time I checked, it didn't care too much about type annotations, and it didn't type-check anything before execution without additional shoehorning.

>No other mainstream whatever

C#, Rust. Notice that I don't even mention my man Haskell or Scala while the latter one is really big.

>literal (dependent) types

Uh, even Java has dependent types, anyway. Read the docs.

>templates

Yes, that's parametric polymorphism. No, it's garbage in C++ to the point where you can't guarantee the soundness of a template. It's done in Java, Kotlin, C#, TypeScript, for the most mainstream ones, not to mention that (and how exactly) it's done in Haskell and Scala.

Edit: How do you feel about type-level programming, anyway? ;)

Re: Python Is Eating the World

#790
post #539

Earlier quoted context omitted.

People gripe about the strangest things. After using Go almost exclusively for about 18 months I have had to interface with existing C libraries exactly zero times.

I've run a few semi popular open source projects, and it's surprisingly common to hear people tell me it's useless because it's lacking their specific pet feature. Now these comments just make me laugh, just like the parent's gripe with slow FFI

Calling the FFI a pet feature is nonsense.
Post reply on HN