r/ProgrammerHumor • • Oct 14 '26

Meme noMatterWhereILookICannotEscapeTheAngleBrackets

Post image
542 Upvotes

110 comments sorted by

View all comments

Show parent comment

30

u/Drugbird Oct 14 '26

That's easy, in C or C++ just do this

#define ( <
#define ) > 

Then you can use normal brackets instead of angle brackets.

And I'm sure nothing will go wrong with that approach.

6

u/tatstytastycakes Oct 14 '26

i wish this were possible

altho im just now realizing that c++ has modules

import std; // great!!!!!!!!!!!!!!

7

u/Drugbird Oct 14 '26

It's great when it works. AFAIK modules still aren't working well enough for anything more than hobby projects.

1

u/RussianMadMan Oct 15 '26

Modules require strict compilation unit order in a system where for decades it was not a thing. Ofc it does not work.

1

u/ShadowSlayer1441 Oct 16 '26

Surely it works with std even if 3rd party libs are broken.

2

u/Drugbird Oct 16 '26

std works somewhat.

Currently were in this situation where third party libraries don't provide module support, so you still need to #include those, and they in turn generally #include stdlib headers again. So generally you're in this mixed world where you're partially doing modules and partially doing old #includes.

Benefits of modules are better build times and slightly better ergonomics (import std is easier than including the right stuff). I think it's about 10%-20% range.

The downsides are that compiler and build system support is still in flux, so using modules can mean that it becomes harder to support multiple compilers and/or build systems. And you obviously lose support of older compilers / build systems.

You also need to refactor your code to use the modules.

So as of now, modules are great if you're starting a new, mostly standalone project and you have full control over the compiler and build system.

It's not so great for existing code bases that want to support older and/or multiple compilers and build systems.

3

u/aberroco Oct 14 '26

You just invented LISP