+ 34

Which is your preferred style while writing programs?

K&R: class A { //code } or Allman: class A { //code } Mine is K&R with 4 level of indentation. Write yours and let's see which style has more users.

18th Mar 2017, 5:49 AM
Ram chandra Giri
Ram chandra Giri - avatar
19 Réponses
+ 24
Allman !! :)
23rd Mar 2017, 3:41 AM
Mansi Dagla
Mansi Dagla - avatar
+ 20
K&R
21st Mar 2017, 12:05 AM
Gami
Gami - avatar
+ 12
It's just the way we look into the code
18th Mar 2017, 6:21 AM
Siddharth Saraf
+ 11
K&R in the following format - if (condition) { // code } else { // code }
18th Mar 2017, 6:20 AM
Siddharth Saraf
+ 10
K&R
18th Mar 2017, 6:34 AM
Agus Mei
Agus Mei - avatar
+ 9
My style is :- Anything works xD 😅😂
18th Mar 2017, 6:03 AM
Meharban Singh
Meharban Singh - avatar
+ 9
K&R with whitesmiths style...☺
18th Mar 2017, 6:26 AM
Dev
Dev - avatar
+ 7
K&R 😅
18th Mar 2017, 7:33 AM
Leon lit
Leon lit - avatar
+ 6
K&R 😀
18th Mar 2017, 6:12 AM
Heng Jun Xi
Heng Jun Xi - avatar
+ 6
Allman ftw!
18th Mar 2017, 4:37 PM
Haris
Haris - avatar
+ 6
I was Allman but i am now K&R, however; I think it is subject to the personality.
19th Mar 2017, 6:24 AM
Hasan Al-Yazidi
Hasan Al-Yazidi - avatar
+ 5
Allman 😊
18th Mar 2017, 7:26 AM
Mohammad Hossein Shahin
Mohammad Hossein Shahin - avatar
+ 5
Mine is K&R. The Allman's curly braces placement feels a bit "unnatural" to me xD
19th Mar 2017, 6:20 AM
Andy
+ 4
K&R always!
19th Mar 2017, 8:26 AM
Nichole Pellow
Nichole Pellow - avatar
+ 4
Depends on the language: - Java prefers K&R - C# prefers Allman I usually use the one the given language prefers, but tbh I personally like it the K&R way. Counting additional "{" rows are really waste of line numbers and too loose for my eyes. I started with C# and then learned Java, it is not because of the learning order :))
21st Mar 2017, 10:50 AM
Magyar Dávid
Magyar Dávid - avatar
+ 3
Allman! :)
18th Mar 2017, 3:22 PM
Ugnė Gi
Ugnė Gi - avatar
+ 3
second one....
18th Mar 2017, 3:35 PM
Ashish Kumar Panda
Ashish Kumar Panda - avatar
+ 3
Allman
22nd Mar 2017, 4:15 PM
Mrityunjay Jha
Mrityunjay Jha - avatar