20

I've always been critical of python as a development language because of it's efficiency issues and the fact that it's essentially pseudocode. However, today I had to reflect 200 coordinated over the line x=355 for a course lab and I hella didn't feel like doing it in my normal languages. Wrote it using python in less than 2 minutes. It might be a bad language for efficiency, but it's one hell of a scripting language. Sorry, python. I never fully appreciated you until now.

Comments
  • 7
    Python is great for scripting, absolutely. But Python is 'a scripting language'? Yeah no, full object oriented language that is absolutely as capable as any other. More so in many cases.

    Also I take issue with the complaints about its efficiency. I think most of the problems with this come from the fact that many think it is a 'scripting language' that is 'basically psuedocode' (how is that a bad thing? its a language that is easy to write in?) so they never actually bother to learn how it works and how to write performant code with it. Obviously its not going to go C speeds, but if you know how it works under the hood you can make most of the heavy work run at close to C speed. And even without that, it is pretty comparable to C# and Java and similar.

    Also, FUN AS FUCK to code in ^_^
  • 6
    @catadoxa I'm not trying to discredit it whatsoever. It's an incredible platform. I've simply found some of the design choices as a bit strange, and since I am a cheapskate, I write most of my web apps in native languages so I don't have to pay for more RAM. JavaScript, now THAT'S a language I can complain about.
  • 0
    @Techno-Wizard Haha I think we can all complain about javascript ^_^
  • 2
    @catadoxa how the hell did a language so bad become the trademark web system?
  • 1
    @zlice I've seen many benchmarks with very different results for time, which leads me to believe that implementation is probably a big factor. As you say, Python is fully interpreted so I think that is a big part of the issue. Without compilation it is very easy to write non-performant code if you don't know how to leverage the interpreter to make your code performant.
  • 2
    @Techno-Wizard Same reason the USA still uses standard instead of metric? It was there first and people are stubborn?
  • 1
    @catadoxa are there alternatives? I don't think there's a real replacement
  • 0
    @Techno-Wizard Yeah most of the attempts so far have just been transpilers like coffee/typescript etc etc...

    Upcoming tech that actually has promise (disclaimer, I've never actually worked with it) is web assembly:

    https://webassembly.org/
  • 0
    @catadoxa So you're saying that Python is easy to write scripts in but other languages are easier to write performant code in.
  • 2
    @electrineer I would agree with that.

    And what are those extra cycles and a bit more ram really worth when they save hours of writing, days of debugging, and down the line months of maintaining?

    Slower runtime > slower Dev time any day.
    A programmers (or teams) time is worth way more than a few hundred cycles on a modern processor.

    Also with things like Cython, PyPy and Nuikta, python is actually unbelievably fast. I don't have benchmarks, but I would bet at least in some cases it beats Java by a sizeable chunk. (It's still no C or pure asm, but it's pretty good!)
  • 0
    Python is fun until you need to deploy it. My beef with python is that it’s libraries are not python...
  • 0
    Pseudocode is just logic with simplified or imaginary syntax that’s easy to understand. If you could write a language whose syntax looks like pseudocode but is actually formal, how is that a bad thing?
  • 0
    @electrineer I wouldn't say that is harder to write performant code in Python than other languages, just that you need to know how to do it. Which is really true for any language, but compilers are able to optimize naive code to some degree.

    As an example, a for loop in Python will run at interpreter speed, but you can almost always write an equivalent list comprehension or map or similar that will leverage the C internals of the interpreter and generally be about twice as fast. Its also easier to write the list comprehension, but you have to know how to do it.
  • 0
    @catadoxa you also can call C code from within python. So you can write the most performance requiring code in C (or even ask) if required.
  • 2
    @deadPix3l it's nightmarish. Go look at the documentation if you want to know what I mean
Add Comment