Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
catadoxa4166yPython 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 ^_^ -
@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.
-
catadoxa4166y@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.
-
catadoxa4166y@Techno-Wizard Same reason the USA still uses standard instead of metric? It was there first and people are stubborn?
-
catadoxa4166y@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/ -
@catadoxa So you're saying that Python is easy to write scripts in but other languages are easier to write performant code in.
-
@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!) -
Python is fun until you need to deploy it. My beef with python is that it’s libraries are not python...
-
devios157056yPseudocode 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?
-
catadoxa4166y@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. -
@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.
-
@deadPix3l it's nightmarish. Go look at the documentation if you want to know what I mean
Related Rants
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.
rant
python3
scripting