C does one thing really well and that’s everything fast with complete control. Python is cool for people just trying to bang out some scripts or learning to program but interpreted languages have no place in mainstream software. Devices are starting to become slower than computers 30 years ago because there is so much garbage being included in apps written in interpreted java and Python and other nonsense. It’s not just bad for the user but it’s bad for the planet. It shouldn’t take a million times the energy to run a simple program because someone doesn’t know how to write Inca proper language. Python is okay in some things. The world has become too reliant on it though.
edinbruh@feddit.it 1 day ago
I’ll be honest, I think modern python is cool. You just need to accept that it has some limitations by design, but they mostly makes sense for its purpose.
It’s true that the type system is optional, but it gets more and more expressive with every version, it’s honestly quite cool. I wish Pylance were a bit smarter though, it sometimes fails to infer sum types in if-else statements.
After a couple large-ish personal projects I have concluded that the problem of python isn’t the language, but the users.
On the other hand, C’s design is barren. Sure, it works, it does the thing, it gives you very low level control. But there is nothing of note in the design, if not some quirks of the specifications. Being devoid of innovation is its strength and weakness.
DarkAri@lemmy.blahaj.zone 1 day ago
edinbruh@feddit.it 1 day ago
I like many of your points, but your comment is facetious.
You said it yourself, “it’s good for someone trying to bang out scripts”… and that’s it, that’s the main point, that’s the purpose of python. I will argue over my dead body that python is a trillion times better than sh/bash/zsh/fish/bat/powershell/whatever for writing scripts in all aspects except availability and if that’s a concern, the only options are the old Unix shell and bat (even with powershell you never know if you are stuck ps 5 or can use ps 7).
I have a python script running 24/7 on a raspberry that listens on some mqtt topics and reacts accordingly asynchronously. It uses like 15kiB (literally less than 4 pages) of ram mostly for the interpreter, and it’s plenty responsive. It uses about two minutes of CPU time a day. I could have written it in rust or go, I know enough of both to do it, it would have been faster and more efficient, but it would have taken three times the time to write, and it would have been a bitch to modify, I could have done it in C and it would have been even worse. For that little extra efficiency it makes no sense.
You argue it has no place in mainstream software, but that’s not really a matter of python, more a matter of bad software engineers. Ok, cool that you recognise the issue, but I’d rather you went after the million people shipping a full browser in every GUI application, than to the guys wasting 10 kiB of your ram to run python. And even in that case, it’s not an issue of JavaScript, but an issue of bad practices.
P.S. “does one thing well” is a smokescreen to hide doing less stuff, you shouldn’t base your whole design philosophy on a quote from the 70s. That is the kind of shit SystemD hater shout, while running a display server that also manages input, opengl, a widget toolkit, remote desktop, and the entire printer stack. The more a high profile tool does, the less your janky glue code scripts need to do.
DarkAri@lemmy.blahaj.zone 1 day ago
Python is okay for some things. It’s just that software in general has become terrible because there is so much wasted power being used because people have access to fast hardware. In the 90s your entire environment would use a few MBs of ram. I know with high res images some of this stuff would increase but people are so wasteful with how they write stuff these days. We are evolving backwards because we spend hundreds or thousands on amazing hardware only to have it run like trash in a world where everything is written in java and python and electron. No longer do developers optimize. They just get their webpage to run at a inconsistent 30 FPS on your $2000 computer, and collect their 150k salary, on a machine that has more computing power than every computer in the world put together in the 90s.
It’s not just bad for your time and sanity. It’s bad for the environment, it’s bad for the economy, this same rot is working it’s way into operating systems, into game engines. Every game written for UE5 seems to run at 50 FPS regardless of how good your PC hardware is because of these same low quality programmers and terrible tools. Idk Linux to me has been a breath of fresh air in recent times as bad as it can be. It’s mostly C code with tiny binaries that are like 1-3 MB usually. I guess there is a silver lining to it in that all of these evil corporations like Google and meta and apple are dying because of this. Maybe the internet will go back to being centered around user content in a distributed fashion and not just a couple of highly controlled websites that try to brainwash you into supporting your corporate backed government. It already seems like every triple A game studio sucks and all the best games that have come out in the past 15 years have been from small indie studios.
squaresinger@lemmy.world 22 hours ago
Have you heard of the term “Software crisis”?
We don’t really talk all that much about it any more, because it’s become so normal, but the software crisis was the point where computers became faster than human programmers. That problem came up in the 1960.
Up until then a computer was simple enough that a single human being could actually understand everything that happened under the hood and could write near-optimal code by hand.
Since then computers doubled in performance and memory every few years, while developers have largely stayed human with human performance. It’s impossible for a single human being to understand everything that happens inside a computer.
That’s why ever since we have tried optimizing for developer time over execution time.
We have been using higher-level languages, frameworks, middlewares and so on to cut the time it takes to develop stuff.
I mean, sure, we could develop like in the 90s, the tools are all still there, but neither management nor customers would accept that, for multiple reasons:
- Everyone wants flashy, pretty, animated things. That takes an ungodly amount of performance and work. Nobody is ok with just simple flat unanimated stuff, let alone text-based tools.
- Stuff needs to run on all sorts of devices: ARM smartphones, ARM/x86 tablets, ARM/x86 PCs, all supporting various versions of Windows, Mac, Android, iOS and preferrably also Linux. But we also need a web version, at best running on Chrome, Firefox and Safari. You could develop all of these apps natively, but then you’d need roughly 20 apps, all of them developed natively by dedicated experts. Or you develop the app on top of browsers/electron and have a single app.
- Stuff needs to work. Win95-level garbage software is not ok any more. If you remember Win95/98 fondly, I urge you to boot it up in a virtual machine some time. That shit is unacceptably buggy. Every time the OS crashes (which happens all the time) you are playing russian roulette with your partition.
- Did I mention that everything needs to be free? Nobody wants to pay for software any more. Win95 was $199 ($432 in 2025 money) and Office was $499 ($1061 in 2025 money). Would you pay 1.5k just for Win11 and the current office?
So there’s more and more to do with less and less time and money.
We can square that circle by either reducing software quality into nothingness, or by using higher-level developer tools, that allow for faster and less error-prone develoment while utilizing the performance that still grows exponentially.
What would you choose?
But ultimately, it’s still the customer’s choice. You don’t have to use VSCode (which runs on Electron). You can still use KATE. You don’t have to use Windows or Gnome or MacOS. You can use Linux and run something like IceWM on it. You don’t have to use the newest MS Office, you can use Office 2013 or Libre Office.
For pretty much any Electron app out there, there’s a native alternative.
But it’s likely you don’t use them. Why is that? Do you actually prefer the flashy, pretty, newer alternative, that looks and feels better?
And maybe question why it feels so hard to pay €5 for a mobile app, and why you choose the free option over the paid one.
realitista@lemmus.org 1 day ago
Uses less memory until it inevitably springs a memory leak.
DarkAri@lemmy.blahaj.zone 1 day ago
Assembly isn’t really faster than C in many cases, although it is in some cases, C actually compiles to assembly basically. The speed ups you get from assembly come from the fact that you can hand optimize some things that compilers miss, and it can be useful sometimes, like when writing a very high performance part of software like a game rendering loop or something.
Python uses 10x the memory but probably 100x-1000x the CPU cycles to do the same thing. Also using libraries written for interpreted languages is going to bloat your memory footprint where c libraries are tiny and efficient.
Memory leaks are an issue with all programming languages, although some use what’s called a garbage collector to handle memory which can be okay with some things but terrible in other things like real time software, operating systems, video games, or just anything you don’t want to hitch and lag and run like a turd. Garbage collectors aren’t some magic fix to memory management, if so they would be a part of C. There are huge tradeoffs to not managing your own memory. If you are using c with objects, then you are pretty safe. The object oriented nature of the language makes it very easy to manage memory. That’s mostly what it’s there for besides reducing the amount of redundant code, if you are using inheritance like you are supposed to. This is called a node graph. You store your data under objects so when you want to remove your data you just call a recursive free function on the highest parent object.
The difference really is that C code is efficient, in the sense that it doesn’t waste anything. Every thing that seems low level about C is there for a reason. It came from a time where it was important to write code efficiently. Where every MB and cycle counted. Where having a garbage collector freeing and potentially crashing your operating system was unacceptable as well as extremely slow. It’s still slow btw, because programs have scaled with the ability of hardware to run it, so garbage collectors are still mostly as terrible as they always have been.
C is only low level in the sense that it actually runs on the hardware. There isn’t layers of stuff in-between it and the hardware. There is no good reason to do so, outside of maybe security in some context. You don’t want web resources running on your hardware directly.
All the other stuff that comes with modern languages is mostly nonsense. Type checking is for lazy programmers. It multiplies the time needed to do an operation. There is no good reason for it to exist other than programmers being bad at their job. C is loosely typed btw. It checks types in the compiler where it belongs. If your android phone was written in c++, your battery would last for days, and you could play games on it for hours, and everything would be extremely fast, nearly instant loading of stuff. The reason we pages were written in JiT languages was mainly just for comparability across many different types of hardware and browsers. They were also relatively small programs. Scripting can be useful sometimes, garbage collectors can be useful for script kitty stuff. It has no place in mainstream software and definitely not in operating systems. Google went from “Don’t be evil” to let’s build an entire operating system out of java and spyware. It’s not good. At this rate we aren’t even going to have guis anymore in 10 years because no hardware will be able to run it without destroying itself, and needing to be plugged in constantly, and $1000 worth of ram.
squaresinger@lemmy.world 10 hours ago
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 22 hours ago
Python uses 10x the memory but probably 100x-1000x the CPU cycles to do the same thing. Also using libraries written for interpreted languages is going to bloat your memory footprint where c libraries are tiny and efficient.
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.
Jarix@lemmy.world 21 hours ago
For us ludite lurkers who couldn’t figure it out from context alone, which one is the interpreted language? I got lost on that detail lol
DarkAri@lemmy.blahaj.zone 16 hours ago
Interpreted languages are languages that are compiled at run time. Compiled languages are compiled into binary by a compiler and then distributed as binaries.
Basically with interpreted languages, there is huge overhead because the code has to be compiled (turned into machine code) as the program is running. This is why games and operating systems are written in C but people learn how to write Python and Java in their college classes. Interpreted languages are often much easier to learn then C and cross platform, but C is fast and powerful.
Jarix@lemmy.world 3 hours ago
Love you. Thank you
captain_aggravated@sh.itjust.works 17 hours ago
Python is interpreted.
realitista@lemmus.org 1 day ago
As someone who studied C exclusively in school and used it for the majority of programming projects I had in the real world, coming to Python now is like moving from a kit car like a Caterham to a Mercedes S class.
JoeBigelow@lemmy.ca 1 day ago
Knowing nothing about code but a fair bit about cars, does that analogy mean like, you can play around with a kit car all you want because you built it, it’s relatively simple, and if you break it you’ll know why and how to fix it, and the Mercedes being the exact opposite?
squaresinger@lemmy.world 10 hours ago
Not exactly. In C you have to do everything by hand. There’s a ton of weird, badly fitting parts and stuff that doesn’t really make sense.
With Python stuff just works. I worked as a Python developer for almost 10 years (switched to Java and Kotlin in the meantime). There have been hardly any real WTF moments over the whole time.
I use C/C++ for my hobby stuff (I do a lot of hobby microcontroller development) and there’s tons of weird gotchas that I would have never imagined (e.g. a missing return statement not getting flagged by the compiler, which it really should, but instead semi-crashing the program at runtime).
Python is slower, but as long as you have a project where performance doesn’t matter, it’s day and night. It’s like working with something that was purposely designed by someone who has somewhat of an idea what they are doing, compared to C/C++ which feels like something that just happened.
In my hobby stuff I now added a Lua interpreter for a kind-of app system, and while Lua is an incredibly bare-bones language it still runs laps around C/C++ when it comes to usability.
Maybe to make the metaphor of the dude before me more poignant: C feels like your granddad’s kit car that you inherited. C++ feels like you got the same kit car after the neighbourhood crackhead had it for a few years and bolted all sorts of weird accessories onto it and did a lot of “tuning”.
Jarix@lemmy.world 22 hours ago
I think it’s not about using it, not the mechanics of using it. No putting together required. And you have everything you need to start driving it the moment you get the keys.
I’m not a mechanic or a programmer so I’m also curious what the meant lol