qgis / qgis4.0_api

Tracker for QGIS 4.0 API related issues and developer discussion
3 stars 1 forks source link

Rename all qgs*.h and qgs*.cpp files to introduce and underscore between "qgs" prefix and class name #77

Closed elpaso closed 7 years ago

elpaso commented 7 years ago

Not really an API change, and maybe it's just me, but I find difficult to read the file listing, such as:

qgsindexedfeature.h
qgsinterval.cpp
qgsinterval.h
qgsjsonutils.cpp
qgsjsonutils.h
qgslabelattributes.cpp
qgslabelattributes.h
qgslabel.cpp
qgslabelfeature.cpp
qgslabelfeature.h
qgslabel.h

I'd like to rename the files to:

qgs_indexedfeature.h
qgs_interval.cpp
qgs_interval.h
qgs_jsonutils.cpp
qgs_jsonutils.h
qgs_labelattributes.cpp
qgs_labelattributes.h
qgs_label.cpp
qgs_labelfeature.cpp
qgs_labelfeature.h
qgs_label.h

The disadvantage is that there will be no more matching between class names and (lowercase) file names.

Crazy idea?

strk commented 7 years ago

How about having the filename be MixedCast to exactly match class name ? I'd love it :)

elpaso commented 7 years ago

@strk that would also help my myopia :)

QgsIndexedFeature.h
QgsInterval.cpp
QgsInterval.h
QgsJsonUtils.cpp
QgsJsonUtils.h
QgsLabelAttributes.cpp
QgsLabelAttributes.h
QgsLabel.cpp
QgsLabelFeature.cpp
QgsLabelFeature.h
QgsLabel.h

yeah, that looks good!

3nids commented 7 years ago

As pointed in the other renaming issue, you'll lose git history due to the renaming too.

NathanW2 commented 7 years ago

Not sure you loose any history. Git is smarter then that if you don't change the content of the file.

On Fri, Mar 17, 2017 at 8:12 PM, Denis Rouzaud notifications@github.com wrote:

As pointed in the other renaming issue, you'll lose git history due to the renaming too.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/qgis/qgis3.0_api/issues/77#issuecomment-287316219, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXS3I50a3nJkFRjzIv6UYRnKZKFgGWYks5rmlyegaJpZM4MgSTF .

3nids commented 7 years ago

Sorry not git history just the history link on github, it doesn't follow renaming.

Le ven. 17 mars 2017 à 11:20, Nathan Woodrow notifications@github.com a écrit :

Not sure you loose any history. Git is smarter then that if you don't change the content of the file.

On Fri, Mar 17, 2017 at 8:12 PM, Denis Rouzaud notifications@github.com wrote:

As pointed in the other renaming issue, you'll lose git history due to the renaming too.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/qgis/qgis3.0_api/issues/77#issuecomment-287316219, or mute the thread < https://github.com/notifications/unsubscribe-auth/AAXS3I50a3nJkFRjzIv6UYRnKZKFgGWYks5rmlyegaJpZM4MgSTF

.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/qgis/qgis3.0_api/issues/77#issuecomment-287317795, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHxG7jn_oCn_3U_67EPP0XjvdAlQ6uhks5rml59gaJpZM4MgSTF .

strk commented 7 years ago

That's a GitHub limitation/bug. Git is smarter than GitHub.

File a ticket to GitHub source code ? Oh, oops, GitHub is not open source. What about moving QGIS source code in a better place ? GitLab might not be too bad as a move ...

3nids commented 7 years ago

I'm OK to move to gitlab but please keep the issue tracker on Redmine.

NathanW2 commented 7 years ago

Can we stay focued on the ticket here and what it addresses instead of other lets move git hosts.

I'm happy to talk about it but one thing at a time given we already have enough on at the moment.

On Sat, Mar 18, 2017 at 11:45 PM, Denis Rouzaud notifications@github.com wrote:

I'm OK to move to gitlab but please keep the issue tracker on Redmine.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/qgis/qgis3.0_api/issues/77#issuecomment-287547298, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXS3DPF4abODvkNsPzGkE_wCDB3xA7Cks5rm9_zgaJpZM4MgSTF .

strk commented 7 years ago

So personally I think git history is best checked locally than via a web browser (so you can grep, for example). Name changes are followed by git log --follow <filename>

m-kuhn commented 7 years ago

While it's probably nicer to read, I fear that it will end up in more typing. I tend to write the filenames a lot in the terminal and IDE and includes. _ is one of the harder characters to type (Alt + key bottom right on my keyboard). CamelCase would be acceptable. But actually I quite got use to the way it is and see no big reason to change :-)

elpaso commented 7 years ago

@m-kuhn yes, that's not a revolutionary change and there is no big reason, it's just a small improvement with readability of file listings. I just thought that this might be the right moment to do that.

strk commented 7 years ago

@m-kuhn does your shell not support TAB-completion ? :)

elpaso commented 7 years ago

BTW, I think that the camel case is actually a better solution than the underscore, the file name would match the name of the class, which is good.

NathanW2 commented 7 years ago

Not a fan of camel case for files, makes it annoying to type.

On Mon, Mar 20, 2017 at 6:55 PM, Alessandro Pasotti < notifications@github.com> wrote:

BTW, I think that the camel case is actually a better solution than the underscore, the file name would match the name of the class, which is good.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/qgis/qgis3.0_api/issues/77#issuecomment-287703625, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXS3KPX3DICuA6tlhyFeW4HdlyKuDdIks5rnj8fgaJpZM4MgSTF .

strk commented 7 years ago

Agreed about CamelCase being better than underscores

m-kuhn commented 7 years ago

It's typing

<shift><Q> -> <tab> -> <shift> <some-otherletter>

vs. currently

<q> -> <tab> -> <some-otherletter>

That's with tab-completion.

jef-n commented 7 years ago

Potential pain w/o much gain.

timlinux commented 7 years ago

@elpaso I'm also of the opinion that if we make such a sweeping change that will potentially affect so many developers, scripts etc. that may be out there, we should have a good rationale for making the change. There was a similar discussion about removing the Qgs prefix for classes in favour of using namespaces. If we do remove the Qgs prefix, this ticket would be redundant, and if we don't, we may as well stick with the scheme that folks are already familiar with.