Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"Code Craft: The Practice of Writing Excellent Code"

 
Swapnil Shroff
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is Excellent Code..Can be a particular code excellent with all aspects...
Like.
Performance
Maintainability
Understandable..etc
 
Pete Goodliffe
author
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is an excellent question, and one we could discuss for a month and not have an answer! For code to be truly "excellent" it must meet a large number of criteria. And it's not just about what the lines of code look like, but how they fit into the large software ecosystem, how they were crafted, and more...

It's probably easiest to think of what some of the characteristics of "excellent" code are. And equally easy to think of some of the characteristics of "bad" code.

Perhaps that's something we should think about in this thread?

For example: "excellent code" is

- correct (how do you prove this?)
- idiomatic (what idioms?)
- maintainable (what does that mean, and is it impacted by the nature and capability of the team you're currently working with)
- well tested (is this programmatic "unit tests" or user-testing? Or both?)
- you suggest more!

And "bad" code is:
- incorrect - not working all the time (the worst is when it looks like it works most of the time, but occasionally falls over in a screaming heap)
- badly designed
- hard to follow
- commented too much
- not commented enough

And that's not even scratching the surface! I wrote 600 pages on the topic, and I'm still not done yet :-)
 
Swapnil Shroff
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Pete

you are right. we can carry this this discussion never ending.

And we always have to compromise one aspect when we need to improve on other.for example if we want to improve maintainability of code may be we need to compromise performance.

but which aspect is most important for a excellent code. ofcourse, an excellent code would be optimized mix, balancing all aspects and fitting in the software ecosystem to best. but I always feel that apart from the correctness of code(which depends on correctness requirement :roll: ) performance is most important.

what are our views on this
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic