-
Notifications
You must be signed in to change notification settings - Fork 95
Description
Per README:
Follow the existing coding style
There are many different styles throughout the headers, even ignoring vendor headers (e.g. openssl).
I believe there should be a more unified, and explicit style.
Examples of different existing styles
-
Availability attribution:
- SpringBoard/SBApplication.h uses
NS_AVAILABLE_IOS, andNS_DEPRECATED_IOS - BatteryCenter/BCBatteryDevice.h uses
API_AVAILABLE(I don't see instances of the equivalentAPI_DEPRECATEDin this repo)
- SpringBoard/SBApplication.h uses
-
External declarations:
- Preferences/PSSpecifier.h uses
__BEGIN_DECLS - GraphicsServices/GSCapability.h uses the
#if __cplusplus \\ extern "C" { \\ #endifidiom (mostly equivalent to__BEGIN_DECLS) - Flipswitch/FSSwitchState.h uses
extern, without any C++ linkage indicator. - I didn't see any instances of it, but Apple's SDKs also use
OBJC_EXTERNandFOUNDATION_EXTERN
- Preferences/PSSpecifier.h uses
-
Property attributes (
ObjCSpaceAfterProperty):- BaseBoard/BSProcessHandle.h uses
@property (attributes) type; - SpringBoard/SBAppSwitcherPeopleDataSource.h uses
@property(attributes) type
- BaseBoard/BSProcessHandle.h uses
Style discussions are sometimes criticized, because developers have different opinions on how code should be formatted, however I mention these three because I've seen issues arise in due to these in particular.
Availability attributions are important, especially for projects such as this one, where private system APIs are sometimes documented. Deciding on an attribution system allows developers to contribute more easily and effectively.
External declarations must be accurate when using C++, to avoid linking errors. Theos used to create ObjC++ source files by default. A unified extern marking system would avoid issues such as FSSwitchState.h missing a C++ linker hint.
Property attributes are very strongly a style choice, but I mention it due to #21 changing these property declarations. It could be bothersome, if someone felt compelled to change them back, or if new changes are made with no property trailing space, and someone else goes to change those.