4 ms·
While Oberon is a bit verbose, the C/C++ declaration syntax is a train wreck. Consider the declaration of signal(), which does not have a very complicated type:
by pdw 12y ago
While Oberon is a bit verbose, the C/C++ declaration syntax is a train wreck. Consider the declaration of signal(), which does not have a very complicated type:
(*signal(int sigcatch, void (*func)(int sigraised)))(int);
I can't think of any C-derived language (other than C++) that uses C-style declarations.
- berkut 12y agoThat's for function pointers though, which is a bit different...
- chubot 12y agoI basically just typedef away the ugly syntax. It basically works. Though I wish you could use typedefs in prototypes, like typedef int signal_func(int sigcatch, raised_func f); foo.h: signal_func* p_handler; foo.cc: signal_func my_handler { ... } This would avoid a lot of repetition and is easier to read IMO.
- pdw 12y agoYes, C works if you know how to avoid the gotchas. It'd be nicer if the gotchas weren't there. It's not as if they add value to the language. (C++ OTOH seems to have too many gotchas to learn them all...)
- banachtarski 12y agoSeems to? How can you even know how to comment on the gotchas if you don't know them?
- the_why_of_y 12y agoScott Meyers seems to have made a career out of documenting them in his books.
- troubled5 12y agoThe statement is about the viability of learning all gotchas of C++, and to make a credible point on this you just need to know there exists a large number of them. (Indeed knowing all, or merely many, of the gotchas would speak against the conjecture.)
- banachtarski 12y agoEvery language has gotchas...