371
unsafeCode (lemmy.ml)
submitted 4 months ago by PandaDEV@lemmy.ml to c/programmerhumor@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] affiliate@lemmy.world 5 points 4 months ago

i will never forgive C for making the type syntax be

char* args[]

instead of the much more reasonable

&[char] args 

it also bothers me that char* args[] and char c are “the same type” in the sense that the compiler lets you write

char c, *args[5];

with no problems. i think the C languages would be way easier to learn if they had better type syntax. don’t even get me started on C++ adding support for

auto fn_name() -> ReturnType { … }
[-] barubary@infosec.exchange 6 points 4 months ago

@affiliate Hey, you didn't even mention that char *args[] actually means char **args in a parameter list.

[-] affiliate@lemmy.world 5 points 4 months ago

god, what a beautiful language. it brings a tear to my eye

[-] Bogus5553@lemm.ee 4 points 4 months ago

I personally think that C++ can be beautiful. For example: std::filesystem::path overrides the / operator, for specifying parent paths. It’s the same as Kotlin’s OKIO and Pythons standard pathlib.

load more comments (2 replies)
load more comments (2 replies)
this post was submitted on 11 Feb 2025
371 points (95.1% liked)

Programmer Humor

37046 readers
214 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS