Traceback (most recent call last):
File "/home/user/projects/bakery/bakery.py", line 3, in <module>
from cake import Cake
File "/home/user/projects/bakery/cake/__init__.py", line 1, in <module>
from .cake import Cake
File "/home/user/projects/bakery/cake/cake.py", line 7, in <module>
import flour
ModuleNotFoundError: No module named 'flour'
flour didn't got installed because you are running python 3.12.4, which only supports flour versions 3.2.1 to 4.0.2. However, latest version of cake depends on flour 2.1.3 to 2.5.63
Ah, basically I told the compiler to do a find and replace so that instead of int main() you just type M and you can do an include at the command line so we throw that line out as well.
I remember 30 years ago there was similar joke about Delphi.
If you need to write a program that puts a tiger into a cage, In C, you write a structure for the tiger, a structure for the cage and a function that puts the tiger into the cage. In Java, you write a fabric that produces the tiger with the cage around it. In Delphi, you import a module that puts the tiger into the cage.
Probably there was some other languages in that joke, but I don't remember it.
That's the whole point of Python anyway. Just let the C++ guys do all the crazy optimizations. And then just leverage the incredible Python syntax to code whatever sorcery you want.
Your C++ for loop may be orders of magnitude faster than your Python one, but boi aren't you anyday get any faster than Numpy or Pytorch, and you ain't gonna recode that from scratch.
63
u/DatsLotus 6d ago
Uh... is the analogy C++: make it yourself vs Python: take a slice of already existing code?
37
u/JohnClark13 6d ago
Assembly - "If you want to make the cake from scratch you must first invent the universe"
7
u/overclockedslinky 6d ago
pretty accurate: python just uses things made by c++
better analogy would've been c
6
u/itemluminouswadison 6d ago
Why are my eggs rotten?
Default args are instantated at time of definition, not invocation.
5
u/nix206 6d ago
The cake is a lie.
8
u/teymuur 6d ago
r/firstweekcodermemes
2
u/MohakAoki 5d ago
c++: you can do whatever you want and change anything you want python: use this complete package and dont argue.
c++: you know fishing python: you have a fish
although python is written in C
1
u/DragonfruitGrand5683 6d ago
C - Object egg is not defined
1
u/Wise_Geekabus 6d ago
So true
1
u/Lines25 5d ago
And C is the same as C++ but don't have a bowl nor a mixer
1
u/kinchkun 5d ago
Both are just awful languages.
1
u/BarfingOnMyFace 4d ago
You bake c++ into python...?
1
u/sdjopjfasdfoisajnva 6d ago
give the batter a gun to shoot your leg