14
dotPy
123d

Had a stupid argument with a “last year robotics engineer” student that shits on python just because he doesn’t like the syntax and compares the runtime speed with C++

like what the fuck dude, how is that a valid argument

Comments
  • 3
    Python syntax is nice. But elixir does it best when it comes to execution speeds. If you wanna use it in a repl use elixirscript, else use elixir that complies for speed
  • 3
    Python doesn't suck because of it's execution speed, it sucks because it's dynamically typed. There are some interesting grad papers out there about how dynamically typed languages are actually a kind of statically typed language (practically just unityped) and how they have no practical advantages over a good statically typed language (like Haskell).

    There are obvious advantages that Python has over Java and vice versa, but Java is an old, bad language, not because it's statically typed though.
  • 3
    @Nevoic see atleast you have a valid argument that actually makes sense, i mean i can argue why python is better dynamically typed but your argument make sense to me and is a valid reason
  • 2
    @dotPy I'd be interested in hearing your opinion on it. I've never really heard of a good example of an advantage of dynamically typed languages. Most my professional experience is in them (Ruby & Python), but in large scale projects they're just nightmarish at their worst and exactly as good as a statically typed language at their best.

    The only thing I've really heard that I believed for a little while was conciseness, but I realized I was just comparing older languages like Java to newer ones like Ruby, but in actuality newer statically typed languages are just as, if not more concise, (i.e Kotlin vs Python, Kotlin is more concise in almost every regard and statically typed).
  • 2
    Had this talk with my brother when I was teaching him C++ for Arduino. He kept comparing it to Python. I had to explain the history, and use-case that each had.

    No language is better or worse, they're just different.
  • 2
    @ODXT I disagree with the notion that "no language is better or worse". That notion comes from a good place, and I think it's a good starting point, but compare Java vs. Kotlin. Kotlin was built as an improvement on Java, and doesn't really lose anything. I would say Kotlin is just better.

    Now something like Kotlin vs Python I get what you're saying. Both have advantages. But one advantage in favor of Kotlin is it's statically typed, while Python is dynamically typed. And I would say unequivocally that static typing is superior. (Assuming the static typing system is strong enough to support the kind of abstractions that duck typing allows).
  • 1
    @Nevoic yes of course, my argument starts with pythons philosophy of programming. It is stated that pythons intention was to simplify the process of programming, being less verbose, quick to add changes and in result being faster for people to catch on and enjoy programming. Because of these reasons, it really suits python to be dynamically typed rather than statically typed. A statically typed language is better in some cases, i even agree that statically typed is in some cases better, but this being python’s true intention, it is better to be dynamically typed. I can think of a few other reasons, but most of them just support this argument in general :)

    source
    https://python.org/dev/peps/...
  • 2
    @ODXT So true, no language is better than the other and you need to learn and learn more to really see why it is what it is
  • 2
    @dotPy I agree with that philosophy, nothing stands out as bad or wrong.

    But what examples could you come up with to support the idea that dynamic typing is superior ever? I.E a code example or conceptual example, whatever is easiest.
  • 2
    @Nevoic i can see your point on why you think Kotlin is better than Java, but can you say for certain that Kotlin is better than Java in all cases rather than just a few cases?

    If you say, “Kotlin is a better choice for Android Programming than Java” then I agree, because in this case it is true and can be proven also. But saying “Kotlin is better in Java” is way too brorad and doesnt cover all the cases of it being true. I can say for certain, Java is better than Kotlin in some cases and vice versa
  • 1
    And just to be explicitly clear, I'm strictly talking about the language feature of dynamic typing vs. static typing. Not Python vs Kotlin. Some code can be better represented in Python vs Kotlin.

    The best example I can use to demonstrate what I mean is Crystal vs Ruby. Crystal code is 90% of the time identical to Ruby code, but it's backed by a compiler and statically typed.

    That means typing errors that exist in almost all Python projects would be caught at compile time instead of runtime (I saw someone do a port of some standard libraries of Python to Haskell and they found like multiple typing errors in them, so any code base that uses those standard libraries is vulnerable to those runtime errors that can be fixed by proper typing of variables)
  • 2
    @Nevoic
    That line is the shorten version of a long rant.

    Yes for a given task, you use the best tool for that specific job. That doesn't automatically make a language superior to another. It just means that you used a good tool.

    We are currently working on a collaboration. It's a book that looks at languages and their history, purpose, advantages and disadvantages.

    https://github.com/devRant-Communit...
  • 0
    @Nevoic sorry but i didnt say that dynamically typed is superior than statically typed. I said that dynamically typed supports python’s philosophy and therefore being a better choice than statically typed in this case.
  • 0
    @dotPy Kotlin can use all the Java standard libraries, has all the same language features and more, and literally can translate into Java code.

    Take this example. Would you say Java 10 is better than Java 9 in all situations? I would, because Java 10 has all the features of Java 9, plus some.

    The exception being language bugs, if there's some bug introduced in a newer version, we could all agree that's worse.

    I view Kotlin as a Java 2.0, because it really is intended as such.
  • 0
    @dotPy I don't think my point came across well.

    Statically typed languages can be just as non-verbose as dynamically typed languages.

    Static typing doesn't mean type annotations, or method return annotations, or anything like that. You can have code that is identical but one is statically typed and the other is dynamic.
  • 0
    Check out Crystal, it's pretty impressive what a static language can look like. I didn't know we could make a static language look like a dynamic one, but we can.
  • 1
    @Nevoic okay then if python became a statically typed language and is still low in verbosity, i would actually think that is awesome. In this case, my argument becomes invalid because if that was the case, it will not violate Pythons Philosophy at all. Any chance i can view the papers you’ve been talking about, i want to read it :)
  • 0
    @dotPy yeah, I'll grab some links and post them in here later :)
  • 0
  • 1
    @Nevoic awesome dude, I’ll check it out!
  • 2
    I'm in the no language is the best camp. They all have there pros and cons. Python is great for short scripts and small projects. I'll use Golang for microservoces and C++ when mucking around with robotics and image recognition. It all depends on what your needs are
  • 0
    @gabowser I agree generally that most languages have an advantage compared to other languages.

    Specifically with Python, what makes it better at running scripts than say, Kotlin or Haskell?
  • 2
    I like how civil the discussion is! Great info sharing! Awesome.

    @Nevoic I like you for liking Kotlin :D
  • 2
    @kabbura thats how it should be done, without provocation, based on facts and provide sources to support the argument. I find that people get really defensive when they are proven
    incorrect and eventually act offensively towards the argument and end up straying off topic.
  • 0
    @Nevoic

    No idea, I've never actually tried them. I alternate between bash and Python for scripting but really it's whatever floats your boat.

    As someone who has worked proffessionally with a Python app that was nontrivial and dealt with USB devices, all I can say is don't do it kids.

    Python is good for prototypes, data analysis, and scripting, that's it
Your Job Suck?
Get a Better Job
Add Comment