you are viewing a single comment's thread
view the rest of the comments
[–] -4 points 1 year ago (21 children)

Python is popular because it's whitespace based syntax make noobs think it's easy to read. This and it's pre-installation on Linux made it popular amongst academics who embraced it for data analysis. This lead to a lot of data scientists embracing it and writing libraries for it which created a virtuous cycle in that arena.

And it's a damn shame because Python, and it's whitespace nonsense and lack of type system, is a horribly impractical language for building anything at scale.

  • source
  • parent
  • hideshow 21 child comments
  • [–] 6 points 1 year ago*

    White space nonsense. Yes and no. I do not enjoy tracking down white space issues until I remember the alternative. Matching brackets, writing begin/end statements, and worst of all looking at code that appears well indented until later you find it is not. and it runs totally differently then it looks. Similar issues with semicolons.

    Pretty much everyone uses LSEs these days so frankly matters less either way most of the time.

  • source
  • parent
  • [–] 3 points 1 year ago* (last edited 1 year ago) (3 children)

    It does make it easier to read. We primarily use indentation to match brackets, so clearly, indentation is the most important readability feature between the two, not brackets.

    Try reading the same piece of code: without brackets, and then without whitespaces and tell me which is better.

    Whitespaces as syntax force you to indent your code properly and not be misleading.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 1 point 1 year ago

    Brackets are infinitely easier because any IDE (and most text editors) have a dead simple linting plugin which auto indents for you and lets you know when you fucked up. Your editor can barely do anything with whitespace only because everything is valid syntax.

    Also lemme take this opportunity to say fuck yaml for exactly this reason.

  • source
  • parent
  • [–] 1 point 1 year ago* (1 child)

    I literally do that professionally, and I'm telling you that brackets are inarguably better.

    You are used to whitespace; I have literally spent months refactoring and upgrading a react frontend and a python backend and am telling you that brackets are a single character and far more predictable, and then your IDE / Linter / Formatter can reliably use them to fill in the perfect indentation and whitespace.

    My first professional language was Python, but I have since tried a half dozen others and would never choose to go back to a whitespace based language unless there was a good reason.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 3 points 1 year ago (3 children)

    Instagram's back bone is written in python. I'd say that's pretty scaled.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 0 points 1 year ago (2 children)

    No, it's not. It was rewritten in Facebook's version of PHP when they bought them.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 1 year ago

    Typing thing is way over blown. What did suck before Python 3 was indeterminate type result from the / operator. You never know if it would be integer or floating division looking at the code. Now it is floating.

  • source
  • parent
  • [–] 2 points 1 year ago (7 children)

    It's not made for scale. Use C/C++ or something if you want scale.

  • source
  • parent
  • hideshow 7 child comments
  • [–] 10 points 1 year ago* (2 children)

    Or you know, TypeScript, Go, C#, Java, Swift, etc. etc.

    Python isn't great at anything except for having a lot of data science libraries already written for it.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 1 year ago* (last edited 1 year ago) (1 child)

    Not only data science libraries, there is a library for about anything. Which is not the case for your list of languages.

    Edit: not all languages in the list.

    When you understand how python works, it's quite simple to use too, and has lot less clutter than say java or c#.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 7 points 1 year ago

    Not only data science libraries, there is a library for about anything. Which is not the case for your list of languages.

    Java has an excellent ecosystem for libraries. And a much more mature one in most cases than Python. The Spring framework alone is simply amazing.

    Go's ecosystem is pretty good as well and getting better.

    When you understand how python works, it’s quite simple to use too, and has lot less clutter than say java or c#.

    The problem is that many python devs consider things like "type hints" and "classes" to be "clutter". It takes a lot of discipline to write managable python. Being "newb friendly" is a curse. "stringly typed" crap does NOT scale well.

  • source
  • parent
  • [–] [S] 2 points 1 year ago (2 children)

    It can scale though. It parallelizes really well if you use queuing systems to distribute the load. You just have to make sure that the hot loops are in C/C++, and it is very easy to interface with compiled binaries via the C API.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 5 points 1 year ago (1 child)

    It can scale though.

    So can assembly. But it takes a tremendous amount of discipline.

    Python's curse is that it's popular with "newbs" who think it's okay to use dictionaries for everything and that type hints are "clutter".

  • source
  • parent
  • hideshow 1 child comment
  • [–] [S] 2 points 1 year ago

    Agreed. I have seen a lot of Python code that was really painful to massage back into a more structured object hierarchy. Java certainly does a bit better in that respect, and as a language, it does a much better job of encouraging better practices, but I think it's also largely due to the kinds of people that use those languages as well.

  • source
  • parent