Thread: Indentation style and personality

  1. #1
    Registered User
    Join Date
    Jun 2012
    Location
    Here
    Posts
    23

    Indentation style and personality

    Hello,

    I was wondering if there is any connection between programmer's personality type and his/her favourite brace style?

    As I have noticed, large amount of coders seem to prefer either K&R or Allman, while others styles are considered simply weird and abominable.

    I myself am a big fan of a Whitesmith style, and turns out that it places me outside the borders of "normality". If we can even talk about "normality" in this case. Programmers are already known as little bit weirdos (compared to average mortals) and being too freaky among the freaks takes everything onto a whole new level.

    Which leads back to main question: are there any psychological studies that are focusing on programmer's preferred indentation styles? I'd like to know if person's coding habits may somehow reflect his/her actual personality.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Get away from me, you weirdo!!

    Anyway, I do not know of any psychological studies that are focusing on programmer's preferred indentation styles.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    I would figure that brace/indentation style is largely a matter of preference, not psychology. As beginners, people tend to use the style they are first introduced to, and when they encounter new styles, they might choose to adapt them.

    In my opinion, brace style just doesn't have enough depth to reflect anything about the mind that chooses it. Compare this to, say, language, that has a vast amount of facets, and can easily be said to be a window into the mind (Steven Pinker wrote about this).

    I also doubt there are studies on the comparison between psychology and indentation style of a programmer. Such a study would be too narrow, and not useful, and would not be worth the time and money.

    For the record, I happen to be partial to the Allman style myself. I like seeing the opening and closing braces of a block in the same column - to me, it's more efficient as I can quickly and easily see blocks when scanning through code.

  4. #4
    Internet Superhero
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    964
    Quote Originally Posted by heinz55 View Post
    I myself am a big fan of a Whitesmith style, and turns out that it places me outside the borders of "normality". If we can even talk about "normality" in this case. Programmers are already known as little bit weirdos (compared to average mortals) and being too freaky among the freaks takes everything onto a whole new level.
    Don't worry, until compilers start adding warnings for poor style, you can be as freaky as you like within the confines of your IDE, without having to fear being put down or rejected.

    Code:
    ||=== g2, Debug ===|
    main.c||In function 'init':|
    main.c|34|warning: assignment makes integer from pointer without a cast|
    main.c|58|warning: this bracket is way off, get it together man! |
    main.c|65|warning: come on, you can do better than this |
    main.c||In function 'main': |
    main.c|121|warning: well, atleast you're consistently inconsistent |
    main.c|124|error: that's it, i'm done, good luck with this mess! |
    ||=== Build finished: 1 error, 4 warnings ===|
    How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics.

  5. #5
    Registered User
    Join Date
    Nov 2012
    Location
    Some rock floating in space...
    Posts
    32

    Arrow

    Quote Originally Posted by heinz55 View Post
    Hello,

    I was wondering if there is any connection between programmer's personality type and his/her favourite brace style?

    As I have noticed, large amount of coders seem to prefer either K&R or Allman, while others styles are considered simply weird and abominable.

    I myself am a big fan of a Whitesmith style, and turns out that it places me outside the borders of "normality". If we can even talk about "normality" in this case. Programmers are already known as little bit weirdos (compared to average mortals) and being too freaky among the freaks takes everything onto a whole new level.

    Which leads back to main question: are there any psychological studies that are focusing on programmer's preferred indentation styles? I'd like to know if person's coding habits may somehow reflect his/her actual personality.

    I use a mixture of BSD KNF and Allman style... It works for me and I don't get a lot of complaints... Not saying I've never had any though...

    I have no idea what it means about one's personality...

  6. #6
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Choice of indentation style doesn't give much information about one's personality.

    Getting into a debate about indentation style, versus a flame war, probably does.

    Personally, if asked to name my preferred indentation style, I have to look it up.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > main.c|58|warning: this bracket is way off, get it together man! |
    For real

    For example.
    Quote Originally Posted by flexelint
    525 Negative indentation from Location -- The current line was found
    to be negatively indented (i.e., not indented as much) from the
    indicated line. The latter corresponds to a clause introducing a
    control structure and statements and other control clauses and
    braces within its scope are expected to have no less indentation.
    If tabs within your program are other than 8 blanks you should
    use the -t option.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  8. #8
    Registered User
    Join Date
    Nov 2012
    Location
    Some rock floating in space...
    Posts
    32

    Cool

    Quote Originally Posted by Salem View Post
    > main.c|58|warning: this bracket is way off, get it together man! |
    For real

    For example.
    I've avoided learning Python because the interpreter is very picky about indentation. The TAB width etc. have to be just right or you get errors.

    So rather than editing my preferences for vim, I just decided that Python wasn't for me.

    I don't know if that has changed with Python since, but I've not bothered to check.

  9. #9
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by heinz55 View Post
    I was wondering if there is any connection between programmer's personality type and his/her favourite brace style?
    There should be. But everyone is afraid of asking and any studies are mysteriously delayed.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  10. #10
    Ticked and off
    Join Date
    Oct 2011
    Location
    La-la land
    Posts
    1,728
    They say that personality can be determined by favourite things or interest. If so, then the favourite brace style or indentation could be one of the personality indicators.

    Personally, I don't have strong preferences, except for readability. When submitting a patch, I do take care to conform to the project guidelines, if any.

    However, I definitely do not have a conformant personality type. For the most part, I couldn't care a flying fudge what people think, and I don't care what people think of me. I do care deeply about what they think of my work, though, and it is important for me to help others succeed in their work.

    Because of this, I would assume any relationship between favourites and personality type to be very complex, even in the typical cases. Because of the complexity, I don't think you can make any inferences on bracing style or indentation alone. However, if you include the code itself, and especially the comments, then we are getting to the point I think at least some basic inferences might be possible. I believe such research would fall nicely under psycholinguistics.

    For example, it is possible to determine the gender of the author of English text using word frequencies; for example, Gender Guesser. There has been quite a bit of research into that (gender differences), and I seem to recall there was a bit of commotion about that by feminists in early 2000s. To me the research simply sheds light on the gender differences, and does not promote any gender or gender-specific details, so I don't understand what the objections were about.

    The more interesting question, to me, would be whether there are distinct personality types with regards to the programming approaches taken; with regards to different programming paradigms; and with regards to typical issues with respect to programming as a profession. It might even have beneficial practical uses, in building better programming teams, with personal "blind spots" supported by others. (To be honest, most HR departments are not worth their wages; I suspect very few companies, if any, would even consider building teams for efficiency. Typically, company structures are dictated by middle-management empire-building, if we are honest about it. It's only in a specific early growing phase that low-level team efficiency is more important than middle-management -- because there is no middle-management yet.)

    Personally, I very often get complaints about overemphasis on correctness/robustness ("overengineering" -- not feature-wise, but being too careful, spending too much time to make sure it is correct). I'm also way too intent on solving problems, so unscrupulous co-workers find me ridiculously easy to manipulate and do their work for them. Current employers would prefer minimum development times and minimum acceptable quality, and I am unable and unwilling to provide that. That's why I decided to switch from programming to research years ago.

    Which leads to my final point: The context of the code will matter a lot. People will most likely have different preferences when writing a quick hack or a quick test code never seen by any other person, when writing for fun, and when writing code that will be incorporated in a product. I know I do. Just like the Gender Guesser differentiates between fiction and non-fiction, any personality analysis based on code would have to know the purpose of the code analyzed, and the situation when it was written in.

    I'd say it'd require a lot of data -- most of it social and psychological, i.e. requiring in-person interviews -- to be able to formulate even a simple hypothesis that could be tested.

  11. #11
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by Nominal Animal View Post
    The more interesting question, to me, would be whether there are distinct personality types with regards to the programming approaches taken; with regards to different programming paradigms; and with regards to typical issues with respect to programming as a profession. It might even have beneficial practical uses, in building better programming teams, with personal "blind spots" supported by others.
    I had a chill. I couldn't avoid thinking of eugenics.

    Thanks, but no thanks. Lets either remain ignorant, or simply accept that study and determination is the road to a correct approach to solving a computing problem.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  12. #12
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by Mario F. View Post
    I had a chill. I couldn't avoid thinking of eugenics.
    but don't you think that, knowing what sort of approach they would take, and whether that approach would be beneficial to solving the problem, you would want to select developers that would be most effective with the given problem? that's just good business. I suspect that Nominal Animal was not talking about making developers, but rather selecting from existing developers to produce better software development teams.

  13. #13
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by Elkvis View Post
    but don't you think that, knowing what sort of approach they would take, and whether that approach would be beneficial to solving the problem, you would want to select developers that would be most effective with the given problem? that's just good business.
    Sure. But I think we already have the tools for that.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  14. #14
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by Mario F. View Post
    Sure. But I think we already have the tools for that.
    absolutely, but being able to look at the code someone writes, and based on the bracket/indentation style, and know more detailed personality information, would add another dimension to screening applicants.

  15. #15
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,694
    While I understand that everybody has a different style, we should not forget that indentation has to follow a "global under the table agreement", so that every piece of code can be reused by people that probably do not know the author of the code.

    In other words, I feel that as time goes by I have to include others people code, which i select to read it and understand it.. while in many cases I have to debug it.

    So, by sticking to global structure, which ok can have a tolerance of different styles, you help the reader of your code to understand what you did. You make him feel comfortable. If you search a little bit the forum you will find people that write code as beginners. Indentations vary. To be honest they vary too much. Fortunately, many users redirect them to standard styles.
    Code - functions and small libraries I use


    It’s 2014 and I still use printf() for debugging.


    "Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code formatter for indentation, style...
    By learn in forum General Discussions
    Replies: 5
    Last Post: 01-13-2011, 09:42 AM
  2. indentation o indentation!
    By rogster001 in forum C++ Programming
    Replies: 18
    Last Post: 09-23-2009, 05:53 AM
  3. indentation error
    By cc870 in forum C Programming
    Replies: 3
    Last Post: 06-24-2005, 11:06 AM
  4. Personality Types
    By Thantos in forum A Brief History of Cprogramming.com
    Replies: 27
    Last Post: 05-15-2004, 05:48 AM