4 ms·
Obj-C uses this. C, on the other end, allows prototypes to be defined as: void* memcpy(void*, void* size_t) // no argument name Which is the worse IMHO.
by xgbi 10y ago
Obj-C uses this.
C, on the other end, allows prototypes to be defined as:
void* memcpy(void*, void* size_t) // no argument name
Which is the worse IMHO. The autocomplete cannot event tell you which is which..
- nostrademons 10y agoAnd Swift, and Smalltalk. 3 generations of that one family. It leads to very verbose code, which is perhaps why it hasn't caught on in other languages. It also can be surprisingly clumsy when a method is called from multiple call sites (which may apply it to different parameters in subtly different contexts, which can make the original phrasing awkward), or when a method is passed around as a first-class value.
- eriknstr 10y agoPersonally I use prototype definition without argument names because when I change the name of an argument in the C file I don't have to go to the header file and change the prototype. The code I work with in C is generally small enough that I have all the relevant C files open in different windows while working on the code, and furthermore because my programs are quite small I don't use autocompletion. What I do have however is simple completion that is not sensitive to the context but which will complete a word once I've typed part of it. This way I can have meaningful names for things without having to spend too much time when I write them.