Re:The Debugging Mindset
by xgbi on Monday April 03, 2017 @04:32AM
(#14021358)
Obj-C uses this.
C, on the other end, allows prototypes to be defined as:
Which is the worse IMHO. The autocomplete cannot event tell you which is which..
[ Parent
| on HN ]
Re:The Debugging Mindset
by nostrademons on Monday April 03, 2017 @04:41AM
(#14021399)
And 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.
Personally 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.