I am a fresher. My job is not very demanding of me when it comes to exercising my programming prowess. So, I have started to write code on my own (a simple space invasion program, chat application, etc). I will be completing some of these in a few weeks, but what i am worried about is how I shall get my code evaluated/criticised . I am new and they say it takes years to become a good programmer, so obviously I am making mistakes. But who can tell me what mistakes I am making? The amount of code that I write at my company and gets checked or revised by senior developers is too small to make any significant impact on my career. Please help.
There's always our sister site Code Review
It's still in beta (as of 14th April 2011), and please check their FAQ before posting. I would expect that they wouldn't like a whole project posted in a question, but a method or two would be OK.
As Michael points out in his comment it's usually easier to review short sections of code so you would be advised to post one (short) method per question. Once you've had a couple of questions answered you could then post more linking back to the original ones to give people context. However, having the whole project available (e.g. as Github project) might also be good practice.
If you don't have anyone to review your code, you can always make an approximation by asking yourself the following questions:
- Is my code easy to test?: Can you write JUnits for your code without wanting to throw your computer out the window? Easy-to-test code is a good thing!
- Is it easy to modify your code?: If your project requirements change, does your codebase let you do that, or do you need to do significant amounts of re-writing?
- Does my code smell?