IDE: Folder and Module same names ?

I am awake since … hours, but it seems that I have a slow down :wink:

I create a Folder (in the IDE’s Navigation pane), gave it a meaningful name (Books).
Then, I add a Module and I wanted to give it… the same name.

Apparently, the IDE is against this idea.
So, I renamed the Module to Books_Data (meaningless) and renamed the Module to Books (since I will call what’s inside a certain number of time, the smaller the name is…).

Stupid idea (from my brain entering in the clouds of dreams) or implementation detail ?

Nota:
I already falls in some of these implementation details like…
Drop a tux logo image called Linux and you will get its name with a numerical suffix.
Since I called it just once, I renamed the image file as tux_logo.png, reimport it and done.

Sorry for the entry. I was starting to sleept…

Usually, I add prefixes to some interface elements (excepted Folders, but included Modules): I renamed the module as mBooks:

I am happy,
the Module name is small
the folder Name is Books ! and I love it.

Yes, I’ve experienced that as well. You cannot create a Folder and a Module with the same name. Neither on the same level nor within each other. But you can rename a Folder to the name of an existing Module (not vice versa). This is quite inconsistent, but it seems to change in the future: <https://xojo.com/issue/16174> and several duplicate cases.

Thanks.

Don’t do that. In text format, when a module contains other things (like classes) the disk representation has a file and a folder with the same name as the module. Tricking the ide to do this will only cause you pain down the road.

This I have experienced - but I do not tested the reverse;)].

All were back to standard operations when I recall that usually, I prefix Modules using a lower case ‘m’(and I never thank about the possible trouble I saw earlier. If I do operations as usual, I do not even create this discussion (I did not reach the ‘why’ since this does not happens…).

Hm. If <https://xojo.com/issue/16174> is the same for Folders as <https://xojo.com/issue/20514> was as for Modules, the following should be supported with the same name and w/o a Trick:

Folder |- Module
and

Module |- Class
A construct like

Folder Module |- Class
with the same name is not possible to construct, as far as I see as the IDE prevents to rename a folder to a name already in use on the same level. For this I see the problems that would occur on the Filesystem level.
Actually

Folder |- Module |- Class
seems to work without trouble currently:

Can you please clarify what structure exactly is to avoid?

ok, once we give class Test within Module Test a global scope, I can think of some trouble, but rather for the compiler then for the filesystem. However I have a project with such a situation and surprisingly did not experience any compile errors so far.

You should not try to put a Module at the same level as a Folder both with the same name because the module is represented by a file and a folder if it contains any other classes.

ah - I see. Thanks for the clarification. The IDE already prevents this situation and I wasn’t even able to trick it to do that. Great.

In the passage I quoted above, it sounded like you could rename a folder to match a module, and that shouldn’t be possible.

oh sorry, that statement was mistakable. I meant a folder with an module inside, not alongside.

Yeah, different levels is probably okay now. The problem is that how modules were laid out on disk changed somewhere along the line. It used to be that a module’s code would be moved into or out of the folder on disk if you added or removed all of the contained objects. When using a VCS you’d have an unnecessary move to record. If you already had a folder with that name, you could potentially overwrite the code portion of the module.

I put a space at the end of a folder name to be able to have a folder and a module with (visually) the same name. Never run into troubles with that as folder names allow for spaces.

Not long ago, I had used a series of image sets which had the same names as controls on an iOSView. The IDE let me, then I needed to move said controls to a Container control, and I was not able to because in that configuration, the IDE would not let me.

The moral of the story is for me : don’t name the same thing different objects in the same project. Even if the IDE lets you do it once, it does not mean at some point edge cases won’t make it an issue.

I should have followed my own naming rules, and named the images something like imgTxtFDate.