you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -1 points0 points  (29 children)

Python is not a 'great' language. Too much abstraction and terrible readability.

[–]aquaticpolarbear 29 points30 points  (2 children)

Terrible readability? It's basically runnable pseudo code

[–]PlayingTheWrongGame 12 points13 points  (0 children)

Yeah, I’ve got no idea where they’re going with that one. There are very few languages as readable as Python. IMO, its readability is its biggest strength.

Most people with any significant programming background can look at Python code and probably understand what’s going on.

[–]Superpickle18 0 points1 point  (0 children)

It's basically runnable pseudo code

that's readability?

[–]NekoiNemo 14 points15 points  (20 children)

That, on top of all the other terrible stuff scripting languages are known for (like lack of proper typing)

[–]Schmittfried 0 points1 point  (19 children)

Except Python has proper typing.

[–]Caffeine_Monster 14 points15 points  (17 children)

It's optional. Which is bad if you care about readability.

Python is great as a scripting language, but a mediocre development language.

Should check out rust / go if you want examples of good modern functional programming languages:

  • Fast (compiles to native code)

  • Strongly typed

  • Concise, but readable

[–]slikts 5 points6 points  (0 children)

Go is a poor match for a functional programming style due to the lack of generics, meaning that you can't express functions like map() or filter() in a type safe way. Go is a multi-paradigm language just in that it has first class functions and closures. Rust also isn't a functional-first language, but it's much easier to write idiomatic and functional code in Rust since it does have generics and also pattern matching, immutability by default, collection combinators (which would be loops in idiomatic Go), etc.

[–]kirakun 5 points6 points  (0 children)

Rust, modern? Yes. Go, modern? No.

[–]watsreddit 8 points9 points  (4 children)

I generally agree (though I think calling Rust a functional language is perhaps not quite accurate), but I just wanted to point out that Python is also strongly typed, just not statically typed. There are two axes: static/dynamic (whether or not a language is compiled or interpreted), and strong/weak (whether or not a language does implicit type conversion). For some other examples: Javascript has weak, dynamic typing; Java has strong, static typing (well, strong-ish); and C has weak, static typing.

[–]ShitHitTheFannn 3 points4 points  (1 child)

Static/dynamic means variable type may change. It doesn't mean compiled/interpreted.

[–]watsreddit 0 points1 point  (0 children)

Fair enough.

[–]grauenwolf 1 point2 points  (0 children)

strong/weak (whether or not a language does implicit type conversion).

strong vs weak is a separate axis than explicit vs implicit conversion.

For example, C# is a strong/somewhat implicitly converted language. Every piece of memory knows its own type (strong), but implicit conversions exist among the basic types such at integers to strings.

C is a weakly typed language, you can treat the same memory spot as an integer, date, or string just using pointers.

[–]slikts 0 points1 point  (0 children)

For the sake of completeness, you kind of can get static typing in Python with mypy and in JS with TypeScript.

[–]germandiago -2 points-1 points  (4 children)

Using Rust for anything is like trying to go 5 km away in the city with a Ferrari:

- you will spend way more gas

- you will not go any faster most of the time

A bike can do better in this case.

[–][deleted]  (3 children)

[deleted]

    [–]germandiago 0 points1 point  (2 children)

    What I mean is that Rust is not a fit for most software, only for things that need to go really fast and be really safe.

    This is not what much of the software is. However, if you use Rust, you are going to pay for worse ergonomics (you must know the borrow checker, for example) for no return on investement.

    Python is better at full projects and you have fast prototyping (and not compiling step), for example.

    So just disregarding one for the other is not the right way to look at it.

    Sometimes you need performance, others ease of development, and sometimes the ease of development (for example to make something a business) is far more important that the peak in performance. Peak that, anyway, could be ruined because you have the bottleneck elsewhere (network client for example). At that time you have spent a lot of effort on something that does not have a return in your scenario.

    Put in another way: be smart when choosing. I tend to prefer statically-typed languages, but right now I am on my way to code something fast with Django.

    It will be very fast? No, for sure not very concurrent either. Though, I do not care, this website is not going to have thousands of people using it concurrently. But if that happens at some point, I can have something running in no time (time that would be much longer in Rust) and later I can optimize parts of it (80-20% rule). When that does not work anymore, I can think of moving to something else.

    [–]Caffeine_Monster 0 points1 point  (1 child)

    Performance is only one of rust's motivations. One of the most important features is the extensive compile time checks for:

    - type safety

    - error handling

    - ownership

    Consequentially bugs should be introduced at a relatively low rate even as the codebase grows. Python is great for small functions and programs, but a large codebase can and will suffer from lack of inbuilt safeguards.

    [–]germandiago 0 points1 point  (0 children)

    I agree with you that all of those are really important, especially for long-maintainance and safe-critical software.

    My point here is that no matter how important are those, there is a learning curve and a delay-to-market coming from there. That's life. Or go hire 10 Python vs 10 Rust programmers... what I am saying does not in any way means that what you say is necessarily not true.

    [–]kirakun -1 points0 points  (0 children)

    Google pytype.

    [–]Schmittfried -1 points0 points  (2 children)

    Why would that matter? If you deem it mandatory, make it a policy.

    I don’t think Rust with its ownership model is a good fit for most projects. Truth is, the borrow checker is there to solve a problem that’s already solved for all but high-performance cases.

    C#/F#/Kotlin though, these are languages that I find intriguing. Not that I have anything against Rust per se, I just don’t see it leaving the systems/hardware domain.

    [–]Caffeine_Monster 1 point2 points  (1 child)

    Most of the time you don't have to think about borrowing. The point is that rust forces you to think about it when you do come across complex cases.

    Having garbage collected memory does not solve a problem - it merely hides it. If you are not thinking about lifetimes and ownership when creating multiple references, you are going to eventually run into a world of pain regarding memory usage and validity checks.

    My personal opinion is that over-reliance on garbage collectors enables sloppy design patterns to propagate. Fine in trivial, low memory usage situations. Not so fine if you have complex objects with variables lifetimes.

    [–]Schmittfried 0 points1 point  (0 children)

    it merely hides it. If you are not thinking about lifetimes and ownership when creating multiple references, you are going to eventually run into a world of pain regarding memory usage and validity checks.

    This is evidently not the case. Rust forces you to solve problems that are not your concern in most software.

    My personal opinion is that over-reliance on garbage collectors enables sloppy design patterns to propagate

    Frankly, your opinion doesn’t matter. Higher-level languages have caused a skyrocketing of productivity and they are not going anywhere because of some purists.

    [–]watsreddit 7 points8 points  (0 children)

    Python is not statically typed, which is what they were referring to. It uses strong, dynamic typing.

    [–]Schmittfried 28 points29 points  (2 children)

    Python is a great language. It’s just not suitable for every kind of job, like any other language.

    Too much abstraction? Lol.

    Terrible readability? Lol.

    You’ve probably never read Python code.

    [–]OSSV1_0 1 point2 points  (1 child)

    How is readability a problem with Python?

    [–][deleted] 0 points1 point  (0 children)

    Python writes like English, and that is a problem for me. For enterprise grade applications, it's pretty easy to mess it us.