Skip to content
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

Class name prefix? #77

Open
congsun opened this issue May 23, 2017 · 7 comments
Open

Class name prefix? #77

congsun opened this issue May 23, 2017 · 7 comments

Comments

@congsun
Copy link

congsun commented May 23, 2017

Hi all the contributors to the HTMLReader project,

Thanks for your hard work on such a great project! I'm suggesting we should put prefix on the class names since HTMLxxx is too general and I'm pretty sure I'm not the only one having naming conflicts with other classes in the project. That would be a lot of work on both sides but I believe it's better for the long run. What do you guys think?

Cong

@nolanw
Copy link
Owner

nolanw commented May 25, 2017

Hello!

Which projects are you aware of that suffer from name collisions?

I kinda consider HTML the class prefix for HTMLReader. When I started this project I looked around to see if anyone else was using it. I didn't find anyone, so I proceeded to use it. Didn't seem too general at the time!

But I'm not surprised to hear that there's some clashing, and in principle I'm for eliminating pointless friction.

@rval
Copy link

rval commented Oct 22, 2017

I would agree that HTML is probably too generic for use as a class prefix, and is likely to cause issues in some projects (e.g., if Apple were to introduce some HTML classes into Swift's standard library). Apple's Objective-C Conventions also state that class prefixes should be 3 letters:

"Your own classes should use three letter prefixes. These might relate to a combination of your company name and your app name, or even a specific component within your app."

@nolanw
Copy link
Owner

nolanw commented Oct 22, 2017

I’m not sure they meant "and only three letter prefixes". The immediate context for the snippet you quote is:

Two-letter prefixes like these are reserved by Apple for use in framework classes.

Besides, I can’t think of a reasonable three letters to choose as a prefix ;)

Anyway, my stance is to leave it be until someone can point to a project that’s causing conflicts. Once that happens I’m open to working something out.

@rval
Copy link

rval commented Oct 24, 2017

Totally reasonable. And thank you for this library. It's been completely rock solid and saved me a ton of time!

@nolanw
Copy link
Owner

nolanw commented Oct 24, 2017

You’re quite welcome!

@lurui1029
Copy link

lurui1029 commented May 30, 2018

I do have a naming conflicts with pod 'TapjoySDK' with following message:

duplicate symbol _parseNumber in:
/Users/user/Library/Developer/Xcode/DerivedData/MyProject-dccczrsfcebodlhhgwfuljlwdtfq/Build/Products/Debug-iphoneos/HTMLReader/libHTMLReader.a(HTMLSelector.o)
Pods/TapjoySDK/TapjoySDK_iOS_v11.12.2/Libraries/Tapjoy.embeddedframework/Tapjoy.framework/Tapjoy(Tapjoy)
ld: 1 duplicate symbol for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Please add a prefix :)

@nolanw
Copy link
Owner

nolanw commented May 30, 2018

@lurui1029 I'ma move that to a new issue if that's alright! #85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants