-
Notifications
You must be signed in to change notification settings - Fork 585
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explore refactoring code base's formatting to improve readability #490
Comments
List of TagUI source files with easy-to-read formatting - 43/46 (93% of files)
List of TagUI source files with hard-to-read formatting - 3/46 (7% of files)
|
More details at issue #490. Only 7% of files are not formatted for easy reading. It makes no sense to refactor these 7% (3 files tagui_header.js, tagui_parse.php, translate.php) at a risk of hurting existing compatibility and scripts. Solution is to provide beautified snapshots of these 3 files and add link to these snapshots at top of the files, so that any developer who wishes to view or edit the source code can see the beautified version. As TagUI is an engine that tries to translate human languages into working JavaScript code that works with its various components, it has mash-up code using string manipulations and replacements in order to get some things done. Simply using a beautifier may break some parts of the engine that affects some existing users' scripts. Thus it is better to provide beautified versions for the 7% of files that is hard to read, than try to refactor at risk of breaking existing users' scripts. |
More details at issue aisingapore#490. Only 7% of files are not formatted for easy reading. It makes no sense to refactor these 7% (3 files tagui_header.js, tagui_parse.php, translate.php) at a risk of hurting existing compatibility and scripts. Solution is to provide beautified snapshots of these 3 files and add link to these snapshots at top of the files, so that any developer who wishes to view or edit the source code can see the beautified version. As TagUI is an engine that tries to translate human languages into working JavaScript code that works with its various components, it has mash-up code using string manipulations and replacements in order to get some things done. Simply using a beautifier may break some parts of the engine that affects some existing users' scripts. Thus it is better to provide beautified versions for the 3% of files that is hard to read, then try to refactor at risk of breaking existing users' scripts.
More details at issue #490. Only 7% of files are not formatted for easy reading. It makes no sense to refactor these 7% (3 files tagui_header.js, tagui_parse.php, translate.php) at a risk of hurting existing compatibility and scripts. Solution is to provide beautified snapshots of these 3 files and add link to these snapshots at top of the files, so that any developer who wishes to view or edit the source code can see the beautified version. As TagUI is an engine that tries to translate human languages into working JavaScript code that works with its various components, it has mash-up code using string manipulations and replacements in order to get some things done. Simply using a beautifier may break some parts of the engine that affects some existing users' scripts. Thus it is better to provide beautified versions for the 3% of files that is hard to read, then try to refactor at risk of breaking existing users' scripts.
Committed to master, closing issue. |
Dummy checklist to go through codebase on functional level with @siowyisheng -
|
Most of TagUI's code was written while I was on a year plus sabbatical, mostly in Eastern Europe. There is no external monitor, so on my Vim editor, I pack lines of code tightly to maximise screen real estate. This helps to reduce development time.
Though the project is unlikely to often have contributions and PRs from users, improving the formatting would make it easier for someone else to maintain the codebase at AI Singapore in future. Raising an issue to look into that.
Python code is already formatted due to its inherent indentation formatting. Some of the newer code are already formatted nicely. The bulk of the code re-formatting would likely be in tagui_parse.php and tagui_header.js.
For post-change, besides testing the translation test cases in positive_test, there is a need to validate further to ensure no regression in functionality.
The text was updated successfully, but these errors were encountered: