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 know it's mostly a psychological question, but what practices exist for a software developer to improve the sense of recognizing basic concepts in the domain and the habit to define simple reusable expressions for them instead of duplicating their definitions all over the code? I'm not speaking about hard-to-learn tools for abstraction but trivial, essential ones like constants and functions that every programming language has. For example, if someone has the task of changing multiple string literals in the code by adding a prefix to them, instead of "FooBar", they should write (pseudocode):

def prefix = "Foo"
prefix + "Bar"

Or if there is a domain-specific derived property of a certain type of entity to compute, introduce a function for that which clearly reflects the nature this derived property:

def boolean isRight(Foo foo) = foo.bar.length > 0

The problem is that even more experienced developers sometimes fail to do this due to lots of possible causes (encountering a new programming language, time pressure etc.). Do you know any good, respectful ways to communicate this with fellow colleagues (not students) in order to let this approach become more instinctive?

share|improve this question

closed as too broad by gnat, Dan Pichelman, GlenH7, MichaelT, Dynamic Jun 30 at 18:02

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
Did you mean "aptitude"? –  Sebastian Redl Jul 25 '13 at 13:56
    
An existing relevant question is: programmers.stackexchange.com/q/122477/35075 –  thSoft Aug 22 '13 at 12:35

1 Answer 1

Knowing you have weaker areas, and accepting that they need work is a great start.

Practice itself is what you really need.

Identify design patterns you would like to use and use them.

Write a lot of code. If your day job means you are stuck doing maintenance coding all day, start a project from scratch in your own time to learn.

Look at old code you have written. Write down a list of the things you think could be improved. Then refactor the old code. Again, maybe you can't do this at work so maybe you would have to do it in your spare time.

share|improve this answer

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