Jim Blandy wrote:
I'm surprised people are offering justifications based on how much work
it is to type or add typedefs or whatever.

I think readability can favor typedefs too, though, and tried to say that. Sorry for being unclear about "consumers". Readers do not benefit indefinitely (for every occurrence, say hundreds to thousands in a source file) from using exclusively long-hands, even ignoring costs to writers. Good code can even use a "local typedef" to avoid mindless repetition.

  Reading is *vastly* more
common than writing; that's the case to optimize for.

Is it optimal to read Handle<T> or Handle<T*> (or Handle<JST*>) spelling instead of HandleT? In some cases, the template spelling is better.

'typedef' comes from C, where it was used for short-handing, even hiding pointer declarator modes (e.g., function pointer types -- blame C for over-parenthesizing and adding other confusion there, but it's loosely analogous to the present situation).

'typedef' is a two-edged weapon. You can certainly overdo it and hurt someone. But it can help too, even considering only readability, even considering only template typedefs -- IMHO.

/be
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to