7 Replies - 2556 Views - Last Post: 09 March 2017 - 06:15 AM

When you started out as a developer, did you put yourself down ?

I've been a software developer (by profession) for maybe 1.5 years, as a hobby (3-4 years). I'm by no means an expert in any language, still junior/edging toward intermediate.

This question is toward the more experienced developers maybe 3-5 years onward.

No matter what code I put together, how much effort I put into following OO principles, refactoring the code over and over, I always look at my code, no matter what it may be, and I put it down. I criticise and assume every other developer who looks at my code is stunned by how bad it is. Essentially I'm always ashamed to show anybody with any knowledge and skill in this field any of my work.

Is this a normal feeling when you enter the software dev field ? If so, when did you overcome this and is their any tips you'd put my way ?

Re: When you started out as a developer, did you put yourself down ?

Posted 08 March 2017 - 02:21 PM

Hell, I have been at this ~14 years and just submitted work for review and am going thru the same feelings that you have. I would rather that I not be so confident that I am cocky, but confidence is a good thing. I'll tell you what I tell myself, keep on trucking and good things will come out of it.

Re: When you started out as a developer, did you put yourself down ?

Posted 08 March 2017 - 04:49 PM

All code is deficient in some way, and all programmers fail to live up to some standard. Imperfect is not only normal, it's ubiquitous. You should always look at your code and think about what's wrong with it. But you should never stop there - once you've identified what's wrong with it, you should think about the best way to fix it, and you should make that fix, and you should learn from the experience so you do it better next time. What you should not do is beat yourself up about it. This helps nobody and will usually keep you from getting better, which is what you really want.

It will often help to read the Sacred Texts - Fowler on Refactoring, Martin on Clean Code and Feathers on legacy code all come to mind - and try to bring what you learn to everything you write. Even if it's a trivial piece of code, write it as well as you can. You should get in the habit of seeking perfection, and you should therefore get used to forgiving yourself for not achieving it.

It sounds like you're not working with other programmers. This will be a big help - when you work on a team and you do code review, suddenly you have other people who will help you see better ways to organize the code, and you'll learn from them.
If you have any colleagues - be they classmates or local programmers at some meetup or users group, or collaborators on an open-source project or whatever - see if you can talk them into helping you out with some code review. You can make this an occasional reciprocal deal - bring something that you've worked on lately and let others have a go at it - or something more formal, where you're each doing pre-merge reviews for each others' projects. Whatever works for you and your colleagues, if it gets you reading other peoples' code and them reading yours it'll help you a lot.

Quote

refactoring the code over and over,

This can be counterproductive. When you are making a functional change to the code, that's a great time to review the stuff you're going to touch and see if there's any changes you can make to make your new work easier - this might be specific changes that allow the new functionality to fit in more smoothly, or it might be getting rid of some awful thing you did that now makes your stomach turn over when you look at it. Either way, when you identify something that is worth changing, start there: do a refactor, which is to say a change that improves the code and does not change the tests. Then, write the failing tests which define your new functionality and make them pass. When you're done with that, it's possible you'll have identified something else that you want to change. If so, do another refactor pass. Then, check in the code and get on with your life.
Seek perfection in new code, not in overgrooming the existing code.

Re: When you started out as a developer, did you put yourself down ?

Posted 08 March 2017 - 07:43 PM

To quote from Top Gun:

Quote

Maverick: So you think I should quit?
Viper: I didn't say that. The simple fact is you feel responsible for Goose and you have a confidence problem. Now I'm not gonna sit here and blow sunshine up your ass, Lieutenant. A good pilot is compelled to evaluate what's happened, so he can apply what he's learned. Up there, we gotta push it. That's our job. It's your option, Lieutenant. All yours.

As developers, we also push the edge. It our job to keep on learning and improving.

One of the things a good developer learns quickly is to separate their ego from their code. Bad code is not a reflection of you as a person. It's usually the result of the confluence of lack of direction, imagination, experience, time, or all of the above. Bad code can be remediated. Good code should be emulated.