Lambda the Ultimate

inactiveTopic How to tell your personality type from your code
started 9/26/2002; 4:46:41 AM - last post 10/3/2002; 3:50:09 AM
Ehud Lamm - How to tell your personality type from your code  blueArrow
9/26/2002; 4:46:41 AM (reads: 2109, responses: 11)
How to tell your personality type from your code
(via David Weinberger)

Code and Personality. How to tell your personality type from your code. Kevin Marks & Maf Vosburgh

People with different personalities write the same code different ways. Unfortunately, not all these ways actually work, but people can learn to change...

This is more about software engineering than about programming languages, but it does tell you something about designing languages. If you are an optimist, C is not the language for you. Or maybe: If you still use C, you really are an optimist...


Posted to fun by Ehud Lamm on 9/26/02; 4:47:42 AM

Luke Gorrie - Re: How to tell your personality type from your code  blueArrow
9/26/2002; 7:41:22 AM (reads: 1221, responses: 1)
Similarly, a friend at work once claimed that he could identify the author of any given piece of code in our system, out of about a dozen people.

At the time I was very skeptical, but now I think I could do it too. It could make a fun contest :-)

Todd Coram - Re: How to tell your personality type from your code  blueArrow
9/26/2002; 8:38:06 AM (reads: 1205, responses: 1)
Without making qualitative judgements, I tend to group competent programmers into 3 personality types: poet, essayist and novelist.

The poet seeks compression: Doing as much as possible with as little verbage as possible. The poet accepts surface ambiguities. The reader works harder.

The essayist seeks clear exposition: Every line of code has its place. Assume the reader understands the domain, but make the code as clear as possible with little room for misinterpretation.

The novelist seeks to describe everything in detail: Don't use fancy constructs; keep it simple. Where code isn't crystal clear, re-factor into simpler terms and provide copious commentary.

Although most general purpose languages support all 3 types, I find that there are language features that attract a fair share of each type:

Poet: Perl, Lisp, Tcl, FP languages, C++ template (meta)programming

Essayist: Java, general C++, Python

Novelist: Don Knuth's Literate Programming, C, Java

Ehud Lamm - Re: How to tell your personality type from your code  blueArrow
9/26/2002; 9:12:04 AM (reads: 1243, responses: 0)
APL? Not for the poet, essayist or novelits. It's the language of choice for the cryptographer

Ehud Lamm - Re: How to tell your personality type from your code  blueArrow
9/26/2002; 9:24:53 AM (reads: 1257, responses: 0)
Yes. I had the bad luck of having to work on code written by a true paranoid.

This system was written in ASM/370 (that's mainframe assembly). This guy was so paranoid he would check the a register is zero, after every subtract instruction used to clear a register! So you had these sequences SR R1,R1 (zero R1) and then three instructions to check that R1 is indeed zero. He didn't trust the CPU!

He didn't believe in macros, either. So huge blocks of code were repeated in each file.

Last but not least, he was so afraid of memory overlays, he cleared each reigster after using it. So the most freuqent line was "SR R4,R4 clear register to avoid overlay". A 5000 line assmebly module could contain up to a thousand of these.

Michael Vanier - Re: How to tell your personality type from your code  blueArrow
9/26/2002; 9:21:32 PM (reads: 1125, responses: 0)
Hmm. I'm definitely a "novelist" but my favorite languages are objective CAML and scheme, and I'm not particularly fond of java. I *hate* excessive code compression, although I don't mind compression caused by clever use of higher-order functions. I've always considered my style "anal-retentive" and/or "obsessive-compulsive" ;-)

Incidentally, there seem to be a lot of "poets" among C programmers; at any rate there are a lot of obfuscators (in the terminology of the article) who seem to think that whitespace is unbearably ugly and code is only good if it's totally incomprehensible. Hopefully I'll never again have to work with one of those people.

I think Paul Graham would definitely be in the "poet" ranks you speak of. Personally, I don't think commenting or clear explanations detract from the poetry of the program. Ideally, though, a beautiful program wouldn't need much explanation because it would have a sense of compelling rightness to it, and the reader would be able to see that right away.

Ehud Lamm - Re: How to tell your personality type from your code  blueArrow
9/27/2002; 4:50:07 AM (reads: 1082, responses: 0)
When I teach about exceptions, I like to say that the language designers reified execution errors, so that programmers could deal with them as they see fit. Thus, exceptions are a programming language level abstraction.

We can compare this approach to two other common ways to handle execution errors. The basic apporach sees thaem as outside the scope of the program, and they simply result in the program bombing giving a "run time error" message. This is essentaily what Pascal does.

The second approach quite similar, but uses standard langugae mechanisms to help routines to report on errors. The may return an error code (e.g., malloc), set a global error flag (ioerror), asnd may even use exotic control mechanisms to influence error handling (e.g, longjump and friends).

By adding exceptions to the language, you make it harder for the programmer to neglect error handling. The exception mechanism establishes the fact that errors change the flow of control through the program.

jon fernquest - Re: How to tell your personality type from your code  blueArrow
9/28/2002; 3:39:38 AM (reads: 997, responses: 0)
Sounds like the more experienced "realist-cynics" end up creating their own type systems anyway in the manner of SICP [ 1, 2] when they start tagging their data structures:

"The step beyond Realism is to add a dose of Cynicism. We like to tag all our data structures, so we can recognise them when they are passed in again. The overhead is low, and it makes your modules almost bullet-proof."

What about programmers that try to be like chameleons, and blend their coding style with the style of the system they are working on? A conformist? considerate? Or do they even have a personality?

I wonder what language Antonin Artaud the mad poet of all mad poets have chosen?

Michael Vanier - Re: How to tell your personality type from your code  blueArrow
9/28/2002; 3:47:52 AM (reads: 1002, responses: 0)
Jon, that's a cool quote. I can't find it in SICP. What section is it in?

Luke Gorrie - Re: How to tell your personality type from your code  blueArrow
9/29/2002; 12:36:41 PM (reads: 937, responses: 0)
Re people who blend into the style of the language/system they're working with - that's something I find very hard, and impressive when people can do it well.

Franck Arnaud - Re: How to tell your personality type from your code  blueArrow
9/30/2002; 9:36:50 AM (reads: 928, responses: 0)
What about programmers that try to be like chameleons, and blend their coding style with the style of the system they are working on?

An engineer?

jon fernquest - Re: How to tell your personality type from your code  blueArrow
10/3/2002; 3:50:09 AM (reads: 900, responses: 0)
>Jon, that's a cool quote. I can't find it in SICP. What section is it in?

The quote is from the paper that's the subject of the posting: "How to tell your personality type from your code."

The links before the quote were to the sections in SICP with type tagging.

I should follow more a easily understandable way of citeing the source of links and text pulled from links.