A quality what I would like to develop is to write more concise code. With writing more concise, at least in my opinion, the opportunity to add bugs to the code is smaller. It is easier to read the code for other.My question is if it is something that just comes with experience or is it something you can do explicitly for developing that quality?
How to write less code
self improvement
I would say that on the whole it is something that comes with time and experience, but you may find that if you do some work with more terse languages you bring that quality back to your regular working languages. Certainly after a year or two working with Ruby I found my C# got a lot tauter. I think if I was to understand functional programming better ( an ongoing ambition ) I would probably take more from that.Also there are some guidelines that can help- for example if you write the same two lines more than once split them into their own method. That's a simple guideline but quickly cuts down on lines of code and cut and paste programming, which most of us are guilty of from time to time.If you understand inheritance you can often save on repeating the same code in different places by giving common functionality to parent classes. This is obvious in principle but something people often miss in practice.There can be a difference between writing less code and having less code in your application- sometimes you can use code generation to avoid having to repeat yourself so you only write a few lines of code but those then generate a whole lot of other code for you- that can give you a lot of leverage. Look at what a tool like Rails or Entity Framework does in this respect to grasp how useful it can be. Be clear about the need for it though and think twice, three times and then four times about rolling your own code generation- that can land you in YAGNI hell.Understand your language, your API and your tools. Again this seems obvious but over the years I have written so much code that I later realised was reproducing functionality I could have just inherited from the API or used a language feature to simplify that I have come to realise that a few hours of reading up on the documentation for the API I am working with will save me many hours of coding or debugging later on. Similarly, most platforms you work with have a grain - learn to work in the way they expect and your life will be a lot easier. Spend some time finding the direction of least resistance for the platform you are working with and you will get things done a lot better.If you are wondering whether there is a better way to do something, there probably is and it is always worth finding out how to do things better.