C Gibberish to English

by warkanlockon 11/11/2024, 8:22 PMwith 50 comments

by ashleynon 11/14/2024, 2:51 PM

   char (*(*x[3])())[5]
I'm more of the mindset that writing something like this is probably a code smell to begin with. Is there any reason I'm not thinking of right now, that this couldn't be typedef'd and refactored into something far more readable?

C gets a lot of blame for pointer gibberish like this but quite honestly you can write gibberish in any language. I don't see any fundamental or technical reason you couldn't write clean, readable C.

by pavlovon 11/14/2024, 11:30 AM

Use typedef?

Granted, the function pointer syntax is forever confusing (to me anyway). The rest is easily tackled by naming things.

Even for function pointers, it’s just one lookup and then you can copy-paste the typedef for any other function pointer types in the project.

by elcritchon 11/14/2024, 1:51 PM

Handy site!

Next I want one to explain some of Rust’s more cryptic pointer gibberish. Usually I just hit “use suggested fix X” until the compiler’s happy.

by makachon 11/14/2024, 1:46 PM

I can read that.

I don't think it is gibberish. It's code and in order to read that code you need to understand the language, and to understand language you need learning and experience.

Maybe it can be useful for learning, but if you have to use such tool, I suspect you won't understand it anyway - so in a way it is more a gibberish-to-gibberish translator.

by card_zeroon 11/14/2024, 11:34 AM

Is there a language that's substantially free of gibberish?

by vzalivaon 11/14/2024, 5:00 PM

Is it just a web wrapper around good old `cdecl` command? Or it does something different/better?

by ngcc_hkon 11/12/2024, 8:21 AM

May need some bracket first then English.

by djmipson 11/14/2024, 12:18 PM

Is this largely supplanted by LLMs?

by lynx23on 11/14/2024, 12:06 PM

Why is it that the first thing I try tends to uncover shortcomings?

typedef uint64_t qbb_t __attribute__((vector_size(sizeof(uint64_t) * 4)))

Syntax error

OK, its an extension, meh.