<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">The cited page make an upfront disclaimer "A NOTE ABOUT USAGE: Unlike the style guide, the content of this page is advisory, not required.  You can always deviate from something on this page, if the relevant author/reviewer/OWNERS agree that another course is better.”</div><div class=""><br class=""></div><div class="">As a first point.  I don’t agree with everything stated in this guide and it is advisory at most.  You cannot require every single implementation to follow some specific rule.</div><div class=""><br class=""></div><div class="">Second.  I don’t agree with “code bloat” problem.  Yes, I saw your tests long time ago and they showed some correlation between listing code inline and not.  It is always compilers decision anyways to inline something or not to inline something.  I believe, when it is not in the header, the compiler simply don’t have a chance to make optimizations if it deem them appropriate.  Use size-oriented optimization, where compiler should be smarter about inlining.</div><div class=""><br class=""></div><div class="">Third.  Putting (some) implementation in the header and not putting it has its own tradeoffs.  When “hiding” in .cpp it reduces how much stuff is included, but also requires creation of additional compilation unit.  In some cases extra compilation unit make sense, in some cases it is not.  I’m against defining any specific rules for that, as it is developer’s discretion.</div><div class=""><br class=""></div><div class="">Finally.  There are so much other work to do.  We have >180 open redmine issues for NFD and ndn-cxx.  I’m completely against touching the code that has been working, even if we do modifications.  I can cite a couple of examples when such changes resulted in serious bugs.</div><div class=""><br class=""></div><div class="">—</div><div class="">Alex</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 31, 2015, at 10:23 PM, Junxiao Shi <<a href="mailto:shijunxiao@email.arizona.edu" class="">shijunxiao@email.arizona.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Dear folks<div class=""><br class=""></div><div class="">Back in June, in issue 1694, I have pointed out that ndn-cxx has a tendency of over-using inline functions.</div><div class="">According to <a href="http://www.chromium.org/developers/coding-style/cpp-dos-and-donts#TOC-Stop-inlining-code-in-headers" class="">C++ Dos and Don'ts</a> from Chromium project, using too much inline functions creates additional work for the linker, because every file that includes those headers would emit a version of an inline function in the object file (.o), and the linker has to eliminate those duplicates.</div><div class="">There's also evidence that inline functions can lead to binary size bloat, which is bad news of devices with small memory or storage, such as home routers and IoT gadgets. Even if ndn-cxx can fit into those devices, bloated binaries will consume precious memory space, and reduce available memory for ContentStore.</div><div class=""><br class=""></div><div class="">A <a href="http://redmine.named-data.net/issues/1694#note-6" class="">decision was made in 20140708 conference call</a> that we should stop adding new inline functions unless they are trivial getters/setters, but fixing old code is low priority.</div><div class="">Of course, if a function is template, and all possible template parameters are not known in advance, it can be inline.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">During the review of issue 2183, I suggested Change Owner to move inline functions into .cpp, as per the decision above.</div><div class="">However, this suggestion was rejected.</div><div class="">The reply was "whatever you saying. I'm refusing to do change here". No valid reason is given with this reply.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">To finally resolve this and similar disputes, I request a review on the decision about inline function usage.</div><div class="">Please give your opinion about where inline functions should be used, along with necessary reasons and citations.</div><div class=""><br class=""></div><div class="">Yours, Junxiao</div></div>
_______________________________________________<br class="">Nfd-dev mailing list<br class=""><a href="mailto:Nfd-dev@lists.cs.ucla.edu" class="">Nfd-dev@lists.cs.ucla.edu</a><br class="">http://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev<br class=""></div></blockquote></div><br class=""></body></html>