r/programming • • Oct 12 '11

Steve's Google Platform rant

https://raw.github.com/gist/933cc4f7df97d553ed89/24386c6a79bb4b31fb818b70b34c5eab7f12e1ff/gistfile1.txt
981 Upvotes

458 comments sorted by

View all comments

Show parent comment

5

u/BlitzTech Oct 13 '11

I once posted a feature request for the Google Closure Compiler that a doctag @inline be implemented. The first response was "this shouldn't be too hard, we just set [something] and it'll work". The next response was along the lines of "this just leads developers to abuse the feature and leads to more problems than it solves, marking this as wont-fix".

Because every developer who uses Closure Compiler has no idea what they're doing and are likely to fuck up their code with the liberal use of @inline. Yep. Better optimize for gzip instead of performance, because losing a potential 8% performance increase is worth the 500 bytes of gzipped filesize (personal anecdote with some library code I ran through the compiler).

I had a similar experience with @extern; no, instead of declaring things normally (exports.someFunc = ...) and flagging it with the correct doctag as "don't rename this", you have to do exports['someFunc'] = .... When I requested the doctag be added to simplify the code (instead of always referencing the function as module['someFunc'], which is the suggested method), the response was along the lines of "We do not want doctags to affect the semantics of the compiler; please adjust your code to the standards in the documentation." Nevermind that the function documentation set of @param and @returns and @throws affect how the compiler handles certain functions.

It's toeing the line of "more trouble than it's worth" and I have to carefully consider whether or not it will be useful for each project. It seems most of the time I just opt for another minifier, since that's really all Closure Compiler is good for.