views:

388

answers:

6

how i can improve our code quality and write clean code. if i write a unclean ugly code then how i can migrate as a good code (beautiful and clean).

+2  A: 
  1. use stylecop
  2. refactor the code
  3. rewrite if you can't fix it.
  4. most importantly: write good code from the start.
Femaref
suggest me how! code is working fine. and suited me good but other person say that it's garbage or ugly code
4thpage
Perhaps you should talk to that other person then?
Lasse V. Karlsen
@Richa: I forgot where I've read it, he say it's hard to know how a beautiful code looks like, but he can easily tell if the code is bad or ugly. In short, beauty is in the eye of the beholder, just take your colleague's criticism with a grain of salt. And it's easy to judge if something is bad or ugly, especially if the style of coding doesn't conform to another person's style
Hao
or Ask that person! don't vent here or to Femaref, perhaps you should channel your frustration to that other person
Hao
Case in point about judging that a certain code is beautiful is harder http://www.equivalence.co.uk/archives/101. On first code, you can not easily decide if the suggested code is beautiful, because you might have a preference that a function should have only one exit point. But you can easily decide that the original code is downright ugly
Hao
i am not richa i am anirugdha nick name aniru don't say @ Richa.
4thpage
@aniru, how can we know, we don't have clairvoyance power to infer that there is a nickname aniru lurking in name `Richa Media and services`, much less anirugdha :-)
Hao
+1  A: 

Don't write code unless you failing have a test

http://en.wikipedia.org/wiki/Test-driven_development

Mel Gerats
+3  A: 

Everyone finds it's own way of what clean code means, BUT there are few things you might want to know, which will help to reach that level/others understand your code (because in this world practically everything have it's own standards).

Lukas Šalkauskas
A: 

There are standards of writing the code read more about Design Engineering (talks about abstraction, architecture, patterns ... etc),
if you already have a spaghetti code Never Ever Ever Rewrite it. the golden rule is if it is not broken don't fix it. you have to design the interfaces and reshape the classes and just move the code carefully and test it. and to make clean code you need to make standard coding practices like naming conventions (as example) and follow the coding practices and standards at start of a project.

Kronass
A: 

Read a book like cleancode,implementation patterns.They help a lot in understanding how to write clean code

jess
A: 

Use FxCop and read Framework design Guidleines.

this. __curious_geek