My coding style is to always put an opening brace on a new line:
int aBoringCFunction()
{
...
Apple used to follow this style but changed to have the { on the same line as the function. When using blocks Apple code always has the { directly after the ^:
dispatch_async(dispatch_get_main_queue(), ^{
...
Is there any reason why using my style with blocks would be problematic? For example:
dispatch_async(dispatch_get_main_queue(), ^
{
...
I prefer my style but if it causes problems with blocks then I will have to reconsider it.
Clarification
This question is regarding the Blocks extension to the C language. It is not a general question about braces. The questions is whether the Blocks extension has any ramifications on code style.
Both styles are perfectly correct; it’s a matter of style and preference. The only way it will be problematic is that you might be expected to adhere to Apple’s convention depending on who your code is for. Hence you might have to go back and change the formatting slightly before your work is accepted.