Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistancy on global.__collect() with android #740

Closed
NathanaelA opened this issue Mar 31, 2017 · 3 comments
Closed

Consistancy on global.__collect() with android #740

NathanaelA opened this issue Mar 31, 2017 · 3 comments
Assignees

Comments

@NathanaelA
Copy link
Contributor

Since 3.0 is supposed to be bringing things more consistency, between platforms, this might be too late for the 3.0 release, but I'm tossing it onto the table. 馃榾

I was wonder what the thought would be to rename (or use but depreciate __collect) and use the global.GC() name that android is using. Android's version is baked into the tns core modules; so that side can't really be renamed easily. So since I don't recall seeing anything uses __collect() it would seem to be the more likely choice to be renamed to what the android version is using; so that both platforms have the same call that does a garbage collections.

@ivanbuhov
Copy link
Contributor

@NathanaelA I like the idea of more consistent API names across both platforms and I know that we can afford to introduce some breaking changes in 3.0 but still I believe that "name consistency" is not a strong enough justification for introducing such breaking change (even if we only add global.GC preserving global.__collect).
Also, keep in mind that the following code:

if (global.GC) {
    global.GC();
}

may be found in existing apps and it is written with the intention to run GC only on Android. With the proposed change this code will trigger GC on iOS, too, and probably the app author will never notice it.

@NathanaelA

This comment was marked as abuse.

@ivanbuhov ivanbuhov self-assigned this Apr 3, 2017
@ivanbuhov
Copy link
Contributor

@NathanaelA

Well, typically if I am having to manually running a GC, then it probably isn't a bad thing to do on both platforms.

This is often not the case. Often, the GC is triggered explicitly because of platform-specific reasons.

However, since the benefits of the proposal are not technical but purely for developer convenience I believe that it is rather a subjective decision. My opinion is that "name consistency" is not a strong enough justification for introducing such breaking change, so I am closing the issue but if someone has different opinion or proposal - feel free to reopen it and leave a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants