AlexDenisov / Fuzzer

Do not crash when your server lies
https://lowlevelbits.org/crash-free-code-with-fuzzer/
MIT License
69 stars 5 forks source link

Three letter prefix #3

Closed ollieatkinson closed 8 years ago

ollieatkinson commented 8 years ago

Apple recommends that 2-letter prefixes be reserved for first-party libraries and frameworks, while third-party developers (that’s us) opt for 3 letters or more.

https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Conventions/Conventions.html

Is this something you would want to adopt in your library?

AlexDenisov commented 8 years ago

Hi @ollieatkinson, Thank you for your contribution!

I'm considering cleaning up current code base a bit (couple of classes are just redundant). After this cleanup I may introduce the prefix you have mentioned, though I'm still not sure if it's required or not.

I do understand Apple's recommendation, but quiet often it is a sort of premature optimisation :)

P.S. I just didn't find a good prefix :)

ollieatkinson commented 8 years ago

I think that it is a requirement to avoid name collisions,

https://developer.apple.com/library/ios/documentation/cocoa/conceptual/ProgrammingWithObjectiveC/Conventions/Conventions.html

Objective-C classes must be named uniquely not only within the code that you’re writing in a project, but also across any frameworks or bundles you might be including. As an example, you should avoid using generic class names like ViewController or TextParser because it’s possible a framework you include in your app may fail to follow conventions and create classes with the same names.

In order to keep class names unique, the convention is to use prefixes on all classes. You’ll have noticed that Cocoa and Cocoa Touch class names typically start either with NS or UI. Two-letter prefixes like these are reserved by Apple for use in framework classes. As you learn more about Cocoa and Cocoa Touch, you’ll encounter a variety of other prefixes that relate to specific frameworks:

Further reading: http://stackoverflow.com/q/178434/289086

AlexDenisov commented 8 years ago

Let me quote myself:

I do understand Apple's recommendation, but quiet often it is a sort of premature optimisation :)

I will definitely consider adding the prefix when somebody will report the real problem.

nikolaykasyanov commented 8 years ago

I guess the probability of name collision in test target is quite low anyway. Low enough to not use uglier type names, IMO.

AlexDenisov commented 8 years ago

The main reason I had against this change was the backward compatibility. But since then I decided to clean up the "architecture" a bit. Now there is version 0.3.0, incompatible with 0.2.0 (I'm terribly sorry), but with the prefix FZR.

@ollieatkinson thank you for opening this issue.