Earlier quoted context omitted.
"an unreliable but still useful indication that there may be something wrong in the design of the code" Well, but you just proved the point - it can be described in non offensive manner. And more over, judging something based on gut feeling ("indication") may be actually even worse, as you may offend someone who did actually a good job. Sorry if "nit picking", recently was reading a lot about burn outs in the industr…
I don't think it's meant to be offensive. It's "smell" in the same sense as "something smells fishy here", or "I smell trouble", with smell serving the analogy of being the least specific of your senses, alluding to having a non-specific feeling rather than hard evidence about something. In theory there's no implication of a "repulsive / offensive smell" or "ew this code smells" in the phrase, like you seem to percei…
C Gibberish to English
51–54 of 54 posts
Re: C Gibberish to English
#52Earlier quoted context omitted.
In this case, the C declaration doesn't match the other two. The variable x is a function that returns a pointer to an array of 5 pointers to functions returning char. Indeed, that's what cdecl.org says: declare x as function returning pointer to array 5 of pointer to function returning char Using the notation you did, that would be: var x: func() ^[5] ^func() char There are only two arrows there now. If you wanted a…
Oh, good catch, thank you! But I remember an example with some other tricky C expression/type declarator where the number of actual dereferences differed from the amount of asterisks in the code. > Using the notation you did, that would be: Well, it'd be func x() ^[5] ^func() char; ... because it's a function declaration, after all, not a variable.
Was it this code?
void f(int *a) {
void *p = &a;
***(int*(*)[])p = 1;
}
Reading your comment made me think of this. I tried to find the original post for this, but it seems it was deleted. I only found it again through this post: https://zig.news/sobeston/using-zig-and-translate-c-to-under...Re: C Gibberish to English
#53char (*(*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 coul…
Why do people continue to use this term "code smell", instead of "hard to read code" or something similar, more equivalent??? First seem almost offensive to an author.
People should not be offended if others critique their work in good faith.
Nobody's fragile ego is worth censoring discussion seeking truth.
Code smell is something that implies deeper issues but isn't usually a serious issue by itself.
I am sorry if you've been assaulted by bad code reviews, but a 'code smell' is a useful idea and term.