Perfect C is faster than perfect Python, same as perfect assembly is faster than perfect C.
But in the real world we don’t write perfect code. We have deadlines, we have constantly shifting priorities, we have non-technical managers dictating technical implementations. We have temporary prototype code that ended up being the backbone of a 20 year project because management overpromised and some overworked developer had to deliver real fast. We have managers still believing in the mythical man month (“If one woman can make a baby in 9 months, 9 women only need a single month to make one”) and we have constant cycles of outsourcing and then insourcing again.
With all that garbage going on we end up with a lot of “good enough for now”, completely independent of “laziness” or “low-skill” of developers. In fact, burnout is incredibly common among software developers, because they aren’t lazy and they want to write good software, but they get caught in the gears of the grind until they get to a mental breakdown.
And since nobody has the time to write perfect code, we end up with flawed and suboptimal code. And suboptimal assembly is much worse than suboptimal C, which is again much worse than suboptimal Python.
If your Python code is suboptimal it might consume 10x as much RAM as it needs. If your C code is suboptimal, it memory-leaks and uses up all RAM your PC has.
If your Python code is buggy, something in the app won’t work, or worst case the app crashes. If your C code is buggy, some hacker just took over your PC because they exploited a buffer overflow to execute any code they want.
The main issues with software performance are:
- Management doesn’t plan right and developers need to do with what they have
- Companies don’t want to spend incredible amounts of money on development to make things perfect
- Companies want products to be released in time
- Customers aren’t happy with simple things. They want pretty, fancy things
realitista@lemmus.org 1 day ago
You’ve obviously never looked at benchmarks because you’re one or two orders of magnitude off.
As someone who was trained in C and did most of my programming in it, yes it does everything you need but it’s a major pain in the ass doing it well. It’s slow to get things done and you need decades to get competent at it. Python allows you to get up and running a lot faster.
As cpu and ram are cheap compared to the days when C was a necessity, most programmers have made the decision that getting things going fast and easy was worth the trade off. The market has spoken. There is still a place for C or Rust, but there’s also a place for Python and other interpreted languages. You can make good programs in both but it’s a lot easier to make a garbage program in C.
DarkAri@lemmy.blahaj.zone 1 day ago
Python is really that much slower. It has actually come a long way in the past few years but it’s still a interpreted, strongly typed language. You can use libraries that are written in C or rust or something to make python run much faster but anything you write in actual Python is extremely slow. It can be okay for scripting, like basically bash, but it’s not really good for a programing language and writing applications in it is not good unless it’s a small project made by one programmer that does a specific useful thing.
Software really is getting terrible. We are hitting a wall in terms of refining process nodes further because we are at 2 nm and it’s really difficult to keep going. There is already way too much terrible code out there just destroying really powerful systems. We are evolving backwards, boot times in the early 2000s on low end hardware were a few seconds for windows XP. When I clicked an application, it either opened nearly instantly or within a couple seconds. It was a much better operating system than windows 10 ever will be.
The issue is having even a single piece of python or java or electron can just completely saturate your memory bus and halve the speed of every operation you do. i had a PC that had spotty thermal paste but long ago and opening discord would overheat it lol.
All I’m saying is that writing this type of code for production shouldn’t really be acceptable. It would be nice if we actually benefited from advancing computer technology and new hardware wasn’t just an excuse to write worse software. I think operating systems should warn the users when running terrible code, that this program is low quality and will slow down the system or is taking as much resources as it can. We are in the age of 1000w computers with billions of transitions being taken out by webpages and OS spyware. The standards are just far too low. There is too much terrible software being written because companies are desperate to hire people who have no idea how to program in real languages instead of paying for real programmers or helping people learn to code in those languages and many of these companies are billion dollar companies.
Like I said, it’s bad for the user, it’s bad for the environment, it bad for your hardrives, and it’s bad for the economy. Not to go full terry Davis on you but computers should boot in under a second these days.