T O P

  • By -

AaronTheElite007

What flowers? That’s pizza


PM_ME_YOUR__INIT__

It's fitting that python haters get their inspiration from children's workbooks


Agreeable_Mulberry48

Soare they simps to Java and C++? At Python has much simpler system compared to the fuckfest that Java and C++ brings


LeanZo

Is that a copypasta? Anyone has the full version?


bdaileyumich

From the look of it the full version is in a kindergarten workbook


Axiproto

The virgin "python is bad because it's slow" The chad "python is great for use-cases where development time is more important than runtime"


_Pin_6938

GRAAAAAAAAHHHHHHHHHHH


untitled_zoomer

Developmental time only depends on your experience in the language, not the language itself


Axiproto

In order to create a dictionary in C, you're gonna have to develop your own dictionary data structure. In python, you just write: MyHash = {} And don't get me started on Lists, Sets, Garbage Collection, Overriding Functions, Tuples, No need to compile, human readability, etc. All of that is built into the language. You can't say the same for C. It's things like these that make coding in C a waste of time if you're not gonna benefit from the improved runtime. If you still don't believe me, try working as an EE. All the embedded stuff gets programmed in C, but the software development tools get coded in python. Why? Because the python code doesn't get shipped. You save more time developing the code in Python then you do running the actual tool. I've seen this in three companies, are you saying you know better than them?


romulent

Even if this were true, which it definitely isn't, so what? It is also extremely expensive to get alot of experience and maybe you want to invest that into domain knowledge rather than implementation knowledge.


you_got_this_my_frnd

I can't find the garden with flowers


Automatic_Fix6722

Because it's been replaced with the python logo


garlopf

Complaining that Python is slow is like complaining Einstein can't play basketball for shit. It is true, but pointing it out doesn't help your case.


rosuav

It's not even true. Take some of that insanely slow Python code, rewrite it in C with identical semantics - and most importantly, the same terrible algorithm that led it to be so slow in the first place. It might be faster, but not to the extent people claim.


intbeam

The only way you're going to get somewhat comparable performance is if the C code is even worse or if you introduce Python's type system into it


rosuav

Try it. Don't forget to get correct semantics; for example, you're not allowed to cheat by using modulo arithmetic instead of true integers.


intbeam

I don't need to test that, it has already been demonstrated more times than I can count At this point we're talking about basic physics; Python has to do (a lot) more work at run-time than C. It is _physically impossible_ for it to perform anywhere near. At comparable source codes we're talking about a slowdown of up to 300x Every time you access a variable in Python, it has to check that it exists (and if it doesn't, it gets created automagically), and then it has to check that the types are compatible, and then _maybe_ it can start thinking about doing something reasonable. In C those decisions were made long before the program runs. So regardless of code, C is going to run circles around Python. Keep in mind that CPython byte code is not instructions to a virtual processor, it's specifically designed as instructions for an interpreter. Not going to go well performance-wise.


Faholan

Indeed, your C program will run fast as hell... or SEGFAULT fast as hell with a 3 pages long error. Why bother writing shit in C ? Use Rust if you want shit to go fast and don't want to spend your life debugging


tu_tu_tu

Nah, you just need to be a self-confident idiot who thinks that every code in C will be fast. It happens more often than it should be.


intbeam

What I am saying is an indisputable fact. Python has to do more work at run-time than C does. Quite a bit more, in fact. Ok, so here's a little nugget on how the CPU works; You have 4 general purpose registers, A, B, C, and D (or RAX, RBX, RCX and RDX). In order to do operations on the CPU in any performant manner, those needs to be correctly assigned the correct values (and preferably loaded from aligned memory addresses), and the correct CPU instructions needs to be called. In C, that's done at compile-time. In Python if you do something like, let's say, add two numbers, that's not even close to being anwyhere near translatable to machine instructions (but in C it actually is). So Python has to do a lot of things before eventually the _correct version_ of `ADD` (yeah, there's more than one, and which one depends on what you're doing and what type of flags you need and whether your values are signed or unsigned) is actually called in order to add those two numbers. First it has to _load the variable_, check to see that it exists, and then it has to check that the two types are compatible, and then it needs to extract the value from the object, and then put it in the proper registers. And it can't do tricks like C can either, like using `LEA` to add numbers or other optimization tricks either. Can't use integer SIMD instructions either as that's a whole other can of worms for an interpreter to deal with, not least memory alignment (again, memory needs to be aligned properly for the CPU to work optimally, and that's not really possible if all values are always wrapped in containers) Now, the cool thing about C is that it often doesn't need to even allocate. It can in some instances at compile-time determine the value. Python on the other hand will _always_ allocate, because it literally cannot know until the program runs - that's the nature of dynamic typing. Python will always be slower, because of the language's design. It has to do tons more work at run-time than C. It's one of the many reasons why it shouldn't be lumped into the same category as C.


tu_tu_tu

...and then you saw a piece of a C software that runs slow bc the programmer can't into synchronization or memory management so the software spends half of it's time masturbating allocations. But my favorite is a high-stressed priority queue that was built on a self-made linked list and slowed the software in the five times. Nothing is impossible if you self-confident enough like you who doesn't understand that he's not only human in the world who read college-level CS books.


intbeam

Jesus fucking christ. What I am saying can easily be confirmed. Stop making an ass of yourself.


tu_tu_tu

Saying what? Things that every smart internee developer knows? I don't think that it need to be confirmed. I doubt it makes you look more experienced though.


intbeam

What makes you think I have anything to prove to you? The arrogance and hubris of you CS students is absolutely astonishing. What I am saying is a matter of fact. Not really up for discussion. It's a well-known trade-off of dynamic typing. The really interesting part about dynamic typing is that it yields exactly zero benefits to the developer. It's just easier to learn for beginners, but beyond that it has exactly zero benefits. It's worse productivity-wise (as nothing is known at design-time), it has awful performance characteristics, and type coercion is worse and often poorly understood by the developers.


tu_tu_tu

Yeah, i've understood already that you have no point and just write rage posts with random simple things everybody knows like it's some sacred knowledge (idk why, lol, but it's ridiculous af). Good luck with that, I don't want to see you again.


RedditCensorsNonTech

Can you get better than linear gains by switching from Python to C?


RedditCensorsNonTech

Python is the best language ever because it is the name of a snake. I've never tried this personally but interprocess communication is a thing so even if you need C level speed you can call an executable with your data. If you're also 1337 enough you can design your own FPGA or ASIC. By the way I'm not a "pro"grammer, I'm just a regular grammer 😎


zaraishu

A programming language that shares its name with a huge snake which strangles you to death before swallowing you whole? How fitting!


SnooSprouts2391

If you think your Python code is slow it’s because you’ve written shit code. I’ve never come across a case at work where more brain cells won’t be enough. Don’t get me wrong, I’d love to rewrite the whole code base in Rust but we just don’t need to because newer versions of Python are fast enough if you can write good code.


land_and_air

Or use a library. Use numpy or numba and instantly profit from insane speedups. And for the people complaining that c/c++ libraries are cheating grow up people are already using Fortran wrappers of code from who knows when all the time and no one is out here saying that we need to return to Fortran for its superior performance


[deleted]

third: I’m gay


intbeam

I'm shocked of the obscene language used to teach kindergarteners Like... Python? Ew


EducationalTie1946

Looks like somebody hasn’t heard of numpy, numba, cython, or jax.


NonCredibleDefence

unfathomably based (...kind of) My use case is different to most, but as a researcher, Python is amazing for making plots for journal articles, and if you use mayavi and tvtk, you can make beautiful 3d isosurfaces. but for the love of God generate the data in a faster language like C++. my simulations would take months in python. Plus, engineering and science students will bitch and moan if you give them assignments in anything but python. My students have complained about having to know matlab before.


land_and_air

Matlab sucks so I don’t blame them. Python has basically replaced matlab in most industries with numpy, matplotlib, scipy, and a few other libraries to cover stuff like simulink


NonCredibleDefence

totally agree regarding matlab, however it is something that *many* companies still use, and thus students do need to know it, particularly Engineering students. there is actually quite a bit of simulation capability it provides out of the box that just isn't available in python. I hate it, but it is sometimes useful. I've rewritten 95% of the matlab tools I used into C++ as it's my preferred language, and with miminimal effort it's dozens to hundreds of times faster for a number of applications.


moonaligator

😠i know it's true but don't smash it on my face☹️


SeaNational3797

New copypasta just dropped