Title: Do not use `__` before garbage collection API · Issue #1648 · AssemblyScript/assemblyscript · GitHub
Open Graph Title: Do not use `__` before garbage collection API · Issue #1648 · AssemblyScript/assemblyscript
X Title: Do not use `__` before garbage collection API · Issue #1648 · AssemblyScript/assemblyscript
Description: Copied from #1559 (comment) Description I want to propose to use a better notation for the public assembly script functions. There is no need to prepend __ before the end of the functions. Reasoning Usually, __ is used before something t...
Open Graph Description: Copied from #1559 (comment) Description I want to propose to use a better notation for the public assembly script functions. There is no need to prepend __ before the end of the functions. Reasonin...
X Description: Copied from #1559 (comment) Description I want to propose to use a better notation for the public assembly script functions. There is no need to prepend __ before the end of the functions. Reasonin...
Opengraph URL: https://github.com/AssemblyScript/assemblyscript/issues/1648
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Do not use `__` before garbage collection API ","articleBody":"_Copied from https://github.com/AssemblyScript/assemblyscript/pull/1559#issuecomment-758299586_\r\n\r\n### Description\r\n\r\nI want to propose to use a better notation for the **public** assembly script functions. There is no need to prepend `__` before the end of the functions. \r\n\r\n### Reasoning\r\n\r\nUsually, `__` is used before something that should not be used, not something that every developer needs to call manually. TypeScript provides many ways to prevent name conflicting that are better than prefixing underscores.\r\n\r\nI would recommend renaming `__collect` to `collect`. If someone wants these functions to have different names (rare), they can do:\r\n```ts\r\nimport { collect as as_collect } from '...'\r\n```\r\n\r\nUsing `__` and similar notations are used in languages like C that do not have any notion of namespace or module and the names conflict with each other. This is not certainly the case for AssemblyScript.\r\n\r\n### Example from other languages\r\n\r\nJulia, the only language I know that allows triggering garbage collection manually, uses GC.gc() function for triggering garbage collection. GC is a module (namespace) and gc is the function name.\r\n\r\nhttps://docs.julialang.org/en/v1/base/base/#Base.GC.gc\r\n\r\n\r\n### Potential Methods\r\n\r\n1) There was one suggested by @MaxGraey here: \r\nhttps://github.com/AssemblyScript/assemblyscript/pull/1559#issuecomment-758316798\r\n\r\n2) If I was the one who makes the decision, I would just use the power of TypeScript namespaces and modules. In TypeScript it is already possible to rename the functions using `as` when importing. ","author":{"url":"https://github.com/aminya","@type":"Person","name":"aminya"},"datePublished":"2021-01-30T23:20:24Z","url":"https://github.com/AssemblyScript/assemblyscript/issues/1648"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:81bb965c-cbe5-1f99-cf1e-e2c52cadd71a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BE1A:16A125:30DE94:414E84:6B009E64 |
| html-safe-nonce | 45d954063e116dbae34cde82d1f87a10485a810de3f639cc785392b6e7fcf742 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTFBOjE2QTEyNTozMERFOTQ6NDE0RTg0OjZCMDA5RTY0IiwidmlzaXRvcl9pZCI6Ijg1ODc2NzY5MDEyODYzODczMDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4484017405c58f517706e9a774fc431322e001b51fe54e2ed042f2d765fbbcc0 |
| hovercard-subject-tag | issue:797565493 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/AssemblyScript/assemblyscript/1648/issue_layout |
| twitter:image | https://opengraph.githubassets.com/598ede6e5e2af45b8d6c7091dfa6d2cccdf1428d6d9e3732b6698ab0294c33af/AssemblyScript/assemblyscript/issues/1648 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/598ede6e5e2af45b8d6c7091dfa6d2cccdf1428d6d9e3732b6698ab0294c33af/AssemblyScript/assemblyscript/issues/1648 |
| og:image:alt | Copied from #1559 (comment) Description I want to propose to use a better notation for the public assembly script functions. There is no need to prepend __ before the end of the functions. Reasonin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | aminya |
| hostname | github.com |
| expected-hostname | github.com |
| None | 52c95ce7e48016ae14399656b4ee812462b6f1fa28c5008c8394da64794c00b8 |
| turbo-cache-control | no-preview |
| go-import | github.com/AssemblyScript/assemblyscript git https://github.com/AssemblyScript/assemblyscript.git |
| octolytics-dimension-user_id | 28916798 |
| octolytics-dimension-user_login | AssemblyScript |
| octolytics-dimension-repository_id | 105138356 |
| octolytics-dimension-repository_nwo | AssemblyScript/assemblyscript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 105138356 |
| octolytics-dimension-repository_network_root_nwo | AssemblyScript/assemblyscript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1c9ddec8215f9a94e295c8310c3579b9c54ba31a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width