Bug 109781 - Rename some files in WebCore/editing/
Summary: Rename some files in WebCore/editing/
Status: RESOLVED LATER
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kent Tamura
URL:
Keywords:
Depends on: 110721 111426
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-13 19:47 PST by Kent Tamura
Modified: 2013-03-20 22:31 PDT (History)
4 users (show)

See Also:


Attachments
Cook on EWS (444.95 KB, patch)
2013-02-25 06:39 PST, Kent Tamura
eflews.bot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Tamura 2013-02-13 19:47:25 PST
htmlediting.{cpp,h}   -> EditorCommandHelper.{cpp,h}
markup.{cpp,h}        -> MarkupHelper.{cpp,h}
visible_units.{cpp,h} -> VisiblePositionHelper.{cpp,h}

What do you think?
Comment 1 Ryosuke Niwa 2013-02-14 10:30:06 PST
(In reply to comment #0)
> htmlediting.{cpp,h}   -> EditorCommandHelper.{cpp,h}

I'd prefer calling it EditingHelper.{cpp/h} or EditorHelper.{cpp/h} since there are functions in that file used outside of editor commands.

> markup.{cpp,h}        -> MarkupHelper.{cpp,h}

Sounds good. Can we split StylizedMarkupAccumulator into its own file too?

> visible_units.{cpp,h} -> VisiblePositionHelper.{cpp,h}

I'd prefer VisibleUnits.{cpp/h} instead since line, paragraph, etc... are visible units.
Comment 2 Alexey Proskuryakov 2013-02-14 13:26:34 PST
I'm not sure if having "Helper" in file name is an improvement. What is the additional information provided by "Helper" part of the name?

If the longer name is not more helpful, I prefer a shorter one.
Comment 3 Kent Tamura 2013-02-25 06:14:55 PST
(In reply to comment #2)
> I'm not sure if having "Helper" in file name is an improvement. What is the additional information provided by "Helper" part of the name?
> 
> If the longer name is not more helpful, I prefer a shorter one.

Yeah, "Helper" is not so meaningful. However I think adding this word is helpful in this case.

* htmlediting.*
  Renaming them to editing/Editing.* would be confusing.  Editing.* sounds the main file in editing/ directory. 
  Renaming them to editing/HTMLEditing.* won't work. AFAIK, case-only renaming makes troubles.

* markup.*
  Renaming them to editing/Markup.* won't work.  Ditto.

* visible_units.*
  ok, I'd like to rename them to VisibleUnits.*.
Comment 4 Kent Tamura 2013-02-25 06:39:18 PST
Created attachment 190047 [details]
Cook on EWS
Comment 5 EFL EWS Bot 2013-02-25 07:13:53 PST
Comment on attachment 190047 [details]
Cook on EWS

Attachment 190047 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/16742378
Comment 6 kov's GTK+ EWS bot 2013-02-25 08:05:28 PST
Comment on attachment 190047 [details]
Cook on EWS

Attachment 190047 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/16745307
Comment 7 Alexey Proskuryakov 2013-02-25 09:30:08 PST
I prefer keeping existing names over renaming these files to "helpers". Later, someone will be able to come up with better names, or to refactor the code in a way that will make it possible to have good names.
Comment 8 Darin Adler 2013-02-25 10:29:01 PST
I actually like the current names for these files and I think we should just fix the capitalization.

For the markup file, the functions are the ones that create markup, otherwise known as serializing, the opposite of parsing, and also parsing functions. We use the word “markup” in the names of these functions. I think that Markup.h is actually a good name for the file and adding “Helper” is not helpful.

For htmlediting.h I think there is a reasonable argument for naming the file EditingHelpers.h. I don’t think it should be called EditorCommandHelper.h since these functions are useful outside of editing commands. And I do think that eventually it would be better to refactor so there is not a file of “helpers”, but for now this name matches the contents of the file. I think that HTMLEditing.h or Editing.h is a fine name and helpers does not add much.

So I would do:

htmlediting.{cpp,h}   -> Editing.{cpp,h}
markup.{cpp,h}        -> Markup.{cpp,h}
visible_units.{cpp,h} -> VisibleUnits.{cpp,h}

I agree in principle with Alexey’s suggestion to wait until we have even better names, but we’ve lived with these old capitalization ones for way too long.
Comment 9 Alexey Proskuryakov 2013-02-25 12:46:33 PST
I'm fine with correcting file name case, I was only objecting to adding "Helper" to the names.
Comment 10 Kent Tamura 2013-03-06 05:17:55 PST
(In reply to comment #8)
> For htmlediting.h I think there is a reasonable argument for naming the file EditingHelpers.h. I don’t think it should be called EditorCommandHelper.h since these functions are useful outside of editing commands. And I do think that eventually it would be better to refactor so there is not a file of “helpers”, but for now this name matches the contents of the file. I think that HTMLEditing.h or Editing.h is a fine name and helpers does not add much.
> 
> So I would do:
> 
> htmlediting.{cpp,h}   -> Editing.{cpp,h}

I don't like Editing.{cpp,h} because existence of Editor.{cpp.h} and Editing.{cpp,h} in the same directory would be very confusing.
I'd like to adopt EditingHelpers.{cpp.h} for now.

> visible_units.{cpp,h} -> VisibleUnits.{cpp,h}

Done in Bug 111426.
Comment 11 Ryosuke Niwa 2013-03-06 09:03:22 PST
(In reply to comment #10)
> (In reply to comment #8)
> > For htmlediting.h I think there is a reasonable argument for naming the file EditingHelpers.h. I don’t think it should be called EditorCommandHelper.h since these functions are useful outside of editing commands. And I do think that eventually it would be better to refactor so there is not a file of “helpers”, but for now this name matches the contents of the file. I think that HTMLEditing.h or Editing.h is a fine name and helpers does not add much.
> > 
> > So I would do:
> > 
> > htmlediting.{cpp,h}   -> Editing.{cpp,h}
> 
> I don't like Editing.{cpp,h} because existence of Editor.{cpp.h} and Editing.{cpp,h} in the same directory would be very confusing.
> I'd like to adopt EditingHelpers.{cpp.h} for now.

I would call EditingFunctions in that case. It's a little more descriptive than helpers.
Comment 12 Kent Tamura 2013-03-14 10:10:36 PDT
(In reply to comment #11)
> I would call EditingFunctions in that case. It's a little more descriptive than helpers.

In WebCore, there are:
6 *Function.h
4 *Functions.h
8 *Helper.h
3 *Helpers.h
3 *Util.h
10 *Utils.h
0 *Utility.h
17 *Utilities.h
Comment 13 Ryosuke Niwa 2013-03-14 10:43:32 PDT
Sounds like we're very inconsistent here :( I guess utilities is not that bad either but not as descriptive as functions. Maybe ap or darin has some opinions on this.
Comment 14 Darin Adler 2013-03-14 12:49:45 PDT
There are many other files that don’t use these suffixes and have better names. Files like HTMLParserIdioms.h that could easily have had a “utility” or “helper” name. I think that newcomers to the project often want to add files with these names because they are used to doing so in other projects. I would strongly resist doing this more. Further, there is no way to count the many files that don’t have these suffixes, but that someone new to the project would have been tempted to name with one of them.

Given the huge number of files in the project, these counts are surprisingly small, and reflect the leakage of these files into the project, with people not aware of this issue.

I don’t think the numbers here give us insight into our standards for file naming.
Comment 15 Ryosuke Niwa 2013-03-14 13:48:04 PDT
I agree. We shouldn't be naming more files helpers, utilities, etc...
Comment 16 Kent Tamura 2013-03-20 22:31:34 PDT
We don't have new name candidates except case-only changes and confusing Editing.*.
I gave up to proceed this.