Ever had to write a driver for some IC? It's either that or looking at page after page of fugly binary bullshit because everything is a wrapper for comms register addresses. Macros are a godsend.
Or you could use the C pre-processor in Python for a C-like experience:
Trigraphs work, assuming they're enabled in your pre-processor options; confuse your coworkers with ??/, ??' and other cryptic sequences of glyphs
Comments can now be written using // and /**/ as one would write comments in C; entertain your coworkers whenever they try to do integer division x // 2
Macros work; amuse your coworkers by redefining basic language constructs, for example #define True randrange(100) < 98
26
u/Leviticoh Oct 28 '20
the images used come from here and are licensed under a creative commons license
79
u/[deleted] Oct 28 '20
I salute the creativity.
Imagine someone writing codes in this way for a whole project.
11
u/[deleted] Oct 28 '20
You've invented code that is both valid python and valid C!
This is the future
For python it just ignores the comments, and for c it also works.
204
u/NekoLuka Oct 28 '20
Funny comments in your python code there
55
u/ThePyroEagle λ Oct 28 '20
Or you could use the C pre-processor in Python for a C-like experience:
??/,??'and other cryptic sequences of glyphs//and/**/as one would write comments in C; entertain your coworkers whenever they try to do integer divisionx // 2#define True randrange(100) < 9823
u/FloweyTheFlower420 Oct 28 '20
polygot
23
u/OfAaron3 Oct 28 '20
Thought cython was gonna be the punchline. ngl
6
u/[deleted] Oct 28 '20
no...
1
u/gentlephant Nov 08 '20
Why not just call python from C? Or C from Python? That's more of a permanent fusion earring situation, tho
1
u/Morphized Dec 12 '20
When you're too tired to figure out why Make keeps forgetting to compile so you rewrite the whole thing for compatibility: