Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am a programmer that can code. But I find that I can get thing done, but not get thing do well or like most of the open source communities do. Well, I use some of the library from git hub. I find most of the programme is well structure. Also, a read me.

My question are:

  1. Is that any common file structure or naming convention in the community or this is just a matter of personal taste?

  2. How to become a more organized programmer, instead of writing code just work. But more organized that let other easy to get in your project?

share|improve this question

closed as not a real question by gnat, Walter, Robert Harvey, GlenH7, Dynamic Dec 13 '12 at 21:15

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
I don't think there's a magic answer, but one way to approach it is to look at what makes it easy for you to 'get in' a well organized open source project that you use, and repeat those things in your own project. One little piece at a time. –  Philip Nov 24 '11 at 15:23
2  
As with a lot of things in programming, by far the most important is to be consistent –  Tom Squires Nov 24 '11 at 15:24
1  
@TomSquires: I'll have to disagree. By far the most important thing is to always improve yourself and the code + documentation. Consistency for the sake of consistency serves to make software harder to maintain over time. –  l0b0 Nov 24 '11 at 15:40
    
not only is there not a magic answer, there are a million different ways of programming, structuring projects etc, and lots of people with opinions, good or bad, about all of them. There are lots of little things you can do, lots of bigger things too, but no magic bullet –  jmo21 Dec 13 '12 at 12:49

4 Answers 4

up vote 3 down vote accepted

Development project structure has been discussed lots of times on Stack* (1, 2), just take your pick relevant to your situation.

To get more organized, I've tried many different methods and tools for organizing code and the surrounding information:

  • Bug trackers like GitHub/Bugzilla/TODO text files
  • Wikis like GTD TiddlyWiki/GitHub
  • Build tools like make/Maven/rake
  • Project management tools like JIRA and Redmine
  • Editors like jEdit and vim
  • Merge tools like Meld and kdiff3
  • Version control systems like Subversion and Git (actually scratch that, just use Git and save yourself a lot of grief)

Once you've tried several of each, you might find that some fit your way of thinking better than others. But remember that there is always a better tool which you don't know about, and tools are always catching up with each other. Therefore you should always be ready to try something else, even something you've already tried and dismissed, on the basis that anything you learn can and will be used by you for the greater good.

share|improve this answer
    
gtdtw link down? –  ell Dec 13 '12 at 16:29

Get feedback on your coding style from someone with more skill and experience.

The way I did it was I got a job where I and a senior programmer cooperated on projects, and he reviewed all the code I checked in. Once in a while he wrote me an email with everything that annoyed or puzzled him about my code. It took a while for me to find a style that both I and he were reasonably comfortable with, and we had some heated debates about some things, but all in all I learned a lot and we parted as friends.

Read books/articles about design patterns, apply different patterns to your problems and see which ones you think are useful in which situations.

Read books/articles about naming conventions and formatting styles. Different communities use different styles. It is generally a good idea to use a style that the people most likely to read your code will recognize.

Some concrete advice on structuring code:

  • When you see that some part of your code can be made simpler, do it.
  • When you see that some part of your code can be reused, make it a function and reuse it.
  • Don't be afraid to change the names of variables and functions if they are bad.
  • When you have an idea for something (a struct, function, class, pattern, anything) that can make your life easier, create it and use it.
  • Change your mind often. Each time you do, you learn something.

Taking the time to do this will of course slow you down in the beginning. As your code gradually gets more and more elegant, it will get easier to maintain and you will reap the benefits of your work.

share|improve this answer

Git and SourceForge. These are the two items that I use when writing a large, unorganized program. For details Google the two, as I cannot link right now for some odd reason. Sorry about that, hope this helps.

share|improve this answer

Refactor your code till you are happy with it.

Over time you will need to refactor less and less, and eventually you will be doing it right the first time around*.

Learn by doing.

*Mostly right :)

share|improve this answer
    
+1. Code is 'right' when any repetition has squeezed out and the tests are passing. The structure may change to pass subsequent tests. I try hard not to introduce complexity in anticipation of unwritten tests. –  kevin cline Nov 24 '11 at 16:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.