Why are certain types / formats of parentheses preferred in c / C ++?

I realized that the following

<T> my_function(...) {
   ....
}

is the preferred majority compared to:

<T> my_function(...) 
{
   ....
}

Similarly for:

if (...) {
   ...
}

preferable

if (...) 
{
   ...
}

This is true, and if so, why is the former style preferable to the latter?

+3
source share
2 answers

The first is mostly popular because it is required by Sun (Now: Oracle) in Java

0
source

This is not necessarily preferable - they are different styles, and different teams have their own preferences.

, "". , , , , . , , ( , , , ..).

+3

Source: https://habr.com/ru/post/1765348/


All Articles