This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Agile and Other Processes and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » Agile and Other Processes
Bookmark ""Code Craft: The Practice of Writing Excellent Code"" Watch ""Code Craft: The Practice of Writing Excellent Code"" New topic
Author

"Code Craft: The Practice of Writing Excellent Code"

Swapnil Shroff
Ranch Hand

Joined: Mar 07, 2006
Posts: 58
What is Excellent Code..Can be a particular code excellent with all aspects...
Like.
Performance
Maintainability
Understandable..etc


SCJP 5, SCDJWS<br /> <br />It's amazing how premature optimisation is both seductive and destructive; even when you know
Pete Goodliffe
author
Greenhorn

Joined: Feb 02, 2007
Posts: 24
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

Joined: Mar 07, 2006
Posts: 58
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: "Code Craft: The Practice of Writing Excellent Code"