purebasic icon indicating copy to clipboard operation
purebasic copied to clipboard

Rename misnamed files

Open kpeters58 opened this issue 4 years ago • 5 comments

There is no Thor around and thus no lightning - it should be HiLighting!

/PureBasicIDE/ScintillaHilightning.pb /PureBasicIDE/HilightningFunctions.pb /PureBasicIDE/HilightningEngine.pb

kpeters58 avatar Dec 15 '19 00:12 kpeters58

Should we correct it even further to "Highlighting" then? 🤔

We must be careful about this one. Fixing typos in comments is OK, but renaming files might break something unexpected. We should check everywhere in the repo they are referenced.

kenmo-pb avatar Dec 15 '19 20:12 kenmo-pb

We must be careful about this one. Fixing typos in comments is OK, but renaming files might break something unexpected. We should check everywhere in the repo they are referenced.

True, without a proper refactoring tool the only way to go about it is by careful RegEx search and replace over the entire code base, which always poses a risk. The hard part will be checking that nothing broke up in the code, especially without being able to rely on a continuous integration tool which could test the builds on all supported OSs, including SpiderBasic.

Integrity checks need to be done manually, by either someone who has access to all three OSs and both languages, or by multiple users splitting the task among them, each one covering at least one target build.

But @kpeters58 is right, misspellings in the file names and source code are worth being corrected now that the code has gone public — I've noticed myself some other typos while sifting the code (e.g. "Platforme" instead of "Platform" when referring to the old Win SDKs, and others). Correct spelling is not just an aesthetic matter, it also serves as a reference when searching the code to spot all areas dealing with a given topic, and if the same word is spelled differently in various places one would miss out potential areas of interest.

Suppose I need to study and work on all aspects regarding syntax highlighting (which, as it happens it's actually true), I'd be searching the whole project for the \b[Hh]ighlight pattern, expecting it to match any comments, variables and procedures related to it, but would miss any misspelled occurrences.

For the above reasons I always enable the spell checker when editing code files.

tajmone avatar Dec 15 '19 21:12 tajmone

@kenmo-pb : Agree with you - let's do it properly all the way!

kpeters58 avatar Dec 15 '19 23:12 kpeters58

I recently purchased PowerGREP, a powerful search and replace tool for batch operations that allows running multiple RegExs in a row on the matched results, thus allowing to create safe context-dependent rules for en-masse subsitutions.

Lacking a code refactoring tool for PureBasic, this tool is the closest solution I can think of. The only problem is that I'll need to learn how to use it first, in order to create safe S&R rules that could be reused on this (and other similar) projec without risking to break anything. (it's a tool loaded with features, so mastering it could take a while)

I personally think that setting up a test suite of sorts should have the priority over these type of aesthetic fixes, to prevent code break-ups. Since we can't rely on CI, we should at least have a test/ folder with PB sources that import the various modules and emulate their usage, covering edge cases and stress tests — this being the only alternative to phisically launching the IDE and manually test all the single features.

For e.g. the syntax highlighting test could feed a sample PB source file and then compare the highlighted result with a pre-processed file, to ensure that there are no unexpected differences. And so on with the various features, leveraging the modules where they are implemented.

tajmone avatar Feb 08 '20 03:02 tajmone

Update READMEs After Renaming Files!

Whenever you rename a folder or file, please remember to check if there is a README.md document in that folder and whether it contains a list of file contents. If it does, you should also amend the files and folders entries and links in the markdown document.

tajmone avatar Mar 16 '20 10:03 tajmone