views:

1146

answers:

22

Hi all,

When we want to compliment someone on their programming code which is neat, clear and the file only takes a few kilobytes,
are there any good professional words that we can use to praise him / her?

The one that I used most is "Your code is lightweight."

But I had seen some people say "it's light-coded"

Please suggest yours . I am learning how to be professional.

+6  A: 

"Expressive" is my recent favorite. As in: "You solved that problem in a concise and expressive manner."

David
+16  A: 

I would suggest "clean".

advait
+55  A: 

"Elegant" is a good word to apply to code.

I like one of the meanings of "elegant" from WordNet: "simple and precise and lucid". Simple, because it has low complexity. Precise, because there is no room for error. Lucid, because it is clear, and easy for a human to understand.

Thomas
This is my favorite, and when I use it I mean it to imply most of the other suggestions here.
PSUnderwood
I also like to refer to code as elegant when it is simple, direct, and easily understood when read by others. However, be careful when you hear this word from others. "Clever" programmers that over abuse patterns and over engineer things also like to refer to their solutions as "elegant", when they really mean "clever" (in a bad way - they just don't always realize it).
Samuel Meacham
'Elegant' is the highest form of praise I know of.
Superstringcheese
+15  A: 

Probably "Sexy"

Jake
I don't think that is the "professional" answer that he's looking for, but +1 anyway.
Matthew J Morrison
Funny for some, but for someone outside the culture trying to understand how to speak professionally, not at all helpful. (I know you're joking, but that isn't necessarily obvious is print and across cultures.)
FarmBoy
IMO a very bad option. Invokes connotations of hype and buzzwords.
Michael Borgwardt
+1 nice and funny
Dave
+2  A: 

The word 'beautiful' is certainly design-ish and pedantic, but it's still a nice word to describe code with anyway.

BoltClock
+8  A: 

"Optimal/Optimum" in terms of clarity, maintainability, execution size, execution time, or any other factor that matters. Also "Efficient".

Chris Thornton
Optimal/Optimum is probably not the best to use. It could apply to multiple factors, as you say... but optimum execution time/size is rarely the same code as optimum maintainability. In fact, they're often far apart.
Brian S
Besides, "optimum" should be reserved for code that has *no* apparent room for improvement.
harpo
Agreed, it would be difficult to be optimum in every aspect. So I wold say "Optimum maintainability" or "optimum for execution time". It would be rare to be able to use more than one or two qualifiers, but I suspect that the "perfect storm" could exist.
Chris Thornton
+3  A: 

The terms I hear most often for this specific combination of things are "elegant," as Thomas suggested, and also "concise." If want to focus on the brevity of expression, I'd prefer "concise." If your focus is on how neatly the solution matches the problem without doing a lot of other futzing around, "elegant" is closer.

Chuck
+2  A: 

The already mentioned "elegant" is my favorite, but also "fluent" and "succinct."

TechNeilogy
+4  A: 

My manager has said my code is bad ass, but that's probably him trying to appeal to a 21 year old, hehe.

Stefan Valianu
+2  A: 

"...clean, easy to read, easy to maintain and modify, human-engineered, efficient, and reliable..."

(from the cover of the programming classic Software Tools by Kernighan and Plaugher)

Tom Chappell
+3  A: 

Your code is clean, concise, and most importantly: efficient.

Alternatively, you could say it's elegant or easy-to-follow.

+6  A: 

I usually say it's "tight".

Pandacoon
For some reason I imagine you giving a high-five after that
BernardMarx
+1  A: 

Things that come to my mind:

  • elegant: your code reads well and does not appear forced

  • perfect: from latin "perfectus", "done", does not need any more work

  • normalized: your code has no redundant parts and can not be reduced further without it losing its functionality. A normalized class is a class with maximal cohesion and minimal coupling

Ozan
+1  A: 

I vote for 'runnable'

Clint Grimsley
+2  A: 

"Lean", but don't combine it with "and mean"; that's just cheesy.

kingjeffrey
+6  A: 
  • nice: If the code gets the work done it is supposed to in a reasonable way without WTFs - just the way any programmer with sanity and reason would write it.
  • elegant: If it's nice and additionally very readable (regarding variable names, indent style, expressive use of language features) - just like the source of this answer.
  • perfect / optimal: If it's elegant and additionally You can't imagine how to improve it - just as if it was written by yourself.
  • neat / sexy: If it solves a common problem in a very uncommon, elegant way - just like You wish You HAD written it yourself.
  • wow (not WoW): The positive comparative of neat. Your mind is blown away - You haven't seen such beautiful code in a time.
  • concise: Can be used in combination with the terms nice through wow. If done so, it adds even more value to Your compliment.
  • [programming language]ish/ic: Can also be used in combination with the terms nice through wow. Implies an expressive use of [programming language] specific features.
  • 1337: The negative superlative of neat. One line of code that does computations worth a hundred lines of code - in opposite to neat and wow its only purpose is to show of the 1337ness of the author and is of no real value since it abuses readability, portability and a whole lot of well defined coding standards. There are very few exceptions to this.
  • Skeetesque: The positive superlative of neat. The code snippet of Your coworker has proved P = NP, solved the Halting Problem and what not.

  • efficient: A token of gratitude that the programmer spend a couple of minutes longer on a method implementation which therefore runs in O(n log n) instead of O(n2) either respecting the already reached hardware limit or pushing said one a little further away.

  • clean, clear, well factored, ...: If the code isn't really good but it is OK and You would like to say some nice sounding things to Your coworker since there are so few possibilities to do so. (Note: You're going to rewrite the code snippet described with one of the listed terms when said coworker is out of office and explain that to him/her with some lame excuse.)
  • runnable / commitable / acceptable: If the code has the same quality as if it were cealn / clear / well factored / ... but there is no need to tell that Your coworker in a roundabout way, since
    • A: He/She already heard some nice words form You in the last days / usually does a better job and therefore can take some harsh statements now.
    • B: He/She is a really good colleague of You and usually produces very good code but wasn't able to do so this time due to some external circumstances (e.g. a dead line). In this case it is advised to use the term "runnable" for an extra laugh.
  • compilable: The negative superlative of runnable most often used under the same circumstances as in case "B" form the point above. However, You usually deal with a way better colleague / friend that usually produces even better code than in case "B". It is advised to use a phrase like "at least it compiles" for an even bigger laugh.
    Less often used when talking to a newbie. Here, it can serve the purpose to motivate a newbie who despairs about some hard problem.
Dave
@kwokwai If you argue that the above list is just a collection of subjective reactions then point Your coworkers to this SO question: In combination with their knowledge of Your coding skills they will be able to derive a absolute measure for Your compliments ;D
Dave
I'm going to try to keep this meta answer up to date with new incomming answers from all of You. However, please feel free to edit/extend is by yourselves! :-)
Dave
Um... *133t* is "leet", not neat. As in "e-leet" (elite, but spelt rong for h4x0rz).
mattmc3
@mattmc3 why does it have to be "neat" in order to be a superlative form of that word?
Dave
+2  A: 

One of the best compliments I got from an instructor was, "Your code is very concise but clear."

I also put in votes for "Elegant" and "Sexy".

chaosTechnician
+2  A: 

I will give an answer that you probably don't want to hear.1)

While I think it very admirable that you want to compliment others for their code, I think you should only give out compliments on code if you can actually read and judge it yourself. Otherwise, it can't really be an honest compliment, and I'm almost sure people will eventually notice.

Instead of learning complimentary adjectives by rote, read the code and choose adjectives that actually match the code. I dare say if you are, or have been, a programmer for some time, this shouldn't be too difficult.


1) I don't mean to give any offense by this answer. It really only applies in the specific case where you'd compliment code with adjectives such as clean, elegant, well-structured, reduced to the max, etc. etc. without actually having looked at it closely.

stakx
Yeah..You're right. However, don't be too serious ;) - at least I've specified the conditions under which one can use which terms and one only can check the conditions by actually looking into the code - so I'm off the hook^^.
Dave
stakx
A: 

I vote for "sharp".

ronik
+5  A: 

Your code is pure craftsmanship.

StackedCrooked
+1  A: 

I like "Clean" "Neat" when someone describes my code...

Senthil Balakrishnan
+2  A: 

Obviously, this is not available in all languages, but code that is very 'pythonic' is usually a good thing. If it is written in python, and it actually looks like python, then it's probably close to perfect, not the least for being exactly the sort of code the interpreter is good at running. I expect other languages probably have similar language dependent.

TokenMacGuy
Heh, interesting answer :) Too bad that Python itself often forces you to do unPythonic things, e.g., `def foo(bar = None):\n if bar == None:\n bar = []`.
Thomas