tags:

views:

295

answers:

7

Hello,

Where would one find information or just rather good ideas on what is considered proper programming ethics or methodology of how to format the code, comments, or even variable names so that it is easier to read the code at a later time?

Thanks!

+11  A: 

The book Code Complete 2 is a timeless reference for good coding practice.

AnthonyWJones
I keep hearing about this book. Maybe the time will soon come I will actually make the purchase. +1
Peter Perháč
For those who have read both 1 and 2, would it be helpful for a mid level developer to read the first one before jumping to the second?
DotnetDude
Thanks for this! I am going to check this book out , as well as the information from the posts below. Thanks guys!
psiko.scweek
I would suggest you only need Code Complete 2 its a revision of the original Code Complete. It presents the concepts in the context of modern languages we use today.
AnthonyWJones
+1  A: 

You're asking for Coding Standards, which are language specific.

For C# check out The IDesign C# Coding Standard (on the right-side of the screen in the middle of the page)

For .NET in general see Design Guidelines for Developing Class Libraries

For C++ check here

For Java see Sun's resource Code Conventions for the JavaTM Programming Language

Chris Andrews
+6  A: 

The absolute 'must-read' for you is Robert C. Martin's book Clean Code. Do give it a try. It makes some awesome points. I keep recommending to everyone ever since I bought it 6 months ago.

Edit

I thought reading my Amazon review could help :)

Peter Perháč
see http://web.telia.com/~u43518104/reviews/cleancode.htm and http://www.javaworld.com/community/node/1844 for less enthusiastic reviews
anon
+1 to your comment. I totally forgot to mention the book IS all about Java and OOP. But the concepts covered are widely applicable and I wish all of my colleagues would have read this book. It's just... enlightening.
Peter Perháč
Another review http://www.nomachetejuggling.com/2009/04/22/book-review-clean-code/
Chris Nava
again, +1 for the comment. I had a look at the review and... Yes, the book really is divided into two parts, one more interesting than the other. The second half of the book contains a bit too many code examples, but that's okay. No one will ever force you to read the whole thing. The first 190 pages contain such good points I wish everyone would read and consider to apply the knowledge in their everyday hacking.
Peter Perháč
Thanks! I will check this out! Great review also!!
psiko.scweek
+1  A: 

Hi,

For C++ I use the C++ google style guide

Amokrane
A: 

Including Code Complete and Clean Code I would recommend you to read "The pragmatic programmer" and "Ship it!". The last books mentioned are not so much about how to format the code, comments, ect. but rather about best practices for developers and development.

Fossmo
A: 

Three books I consider essential for beginning OO programmers.

  1. "Refactoring: Improving the Design of Existing Code".

Although modern IDEs often support automatic refactor, this book is still useful. By knowing the reason (or code smell) behind a particular refacoring, you can strive to write the correct code the first time.

  1. "Pragmatic Programmer"

A wealth of best practices.

  1. "Design Pattern"

Most advanced book, but still useful.

Journeyman Programmer
good books, but probably too advanced
Derek Adair
A: 

Clean Code is certainly a good book. Martin's Agile Principles, Patterns, and Practices in C# is my recommendation if you want a more .NET specific book.

daft