Software Creation Mystery - https://softwarecreation.org

Archive for December, 2008

A Few Words In Defense of Copy And Paste Programming

I was always against Copy and Paste programming. I condemned people who use this practice as discrediting the honorable profession of The Programmer. This evil activity inflates application code without adding anything useful. This shameful practice causes various complications – more code, more things to remember, needless complexity, and difficulty to manage and synchronize related changes in the future. But at some point, I admitted to myself – things are not so black and white. I do Copy and Paste in my code, it is difficult to resist this seductive activity.

The only indulgence is that I’m very keen to eliminate bad effects of Copy and Paste before finishing my task.

I use two main approaches for writing new code. The first is Top-Down – I have clear design ideas how I should program and I know what classes and components to use. I go ahead and write code from scratch using my memory and power of intellect :). There are few problems with this approach. Unfortunately, my memory is not so great and knowledge is not so vast. Regularly I have new tasks that I don’t know or don’t remember how to program. Sometimes I don’t get immediately what other people programmed without debugging. And often I want to save time and avoid re-implementing the same idea again. And that is why I also use the second approach – Bottom-Up. I copy and paste code first. And after I figure out how this code works, how to use, fit and improve it. Read full post >>

Pair Programming: To Do or Not To Do

Pair Programming is a great way to build software systems. When Pair Programming works, it has significant benefits:

  • better ideas – continuous brainstorming, larger knowledge pool, less gaps in understanding and more brain power to solve design problems;
  • better quality – fewer bugs, instant validation of ideas, consistent approach and stricter adherence to team conventions;
  • better knowledge – experience and knowledge sharing, deeper understanding of why, how and what was done;
  • increased productivity – better focus and higher intensity, pushing each other and motivating to achieve best results, less procrastination and wasting of time;
  • more enjoyment – most people like to work in groups and solve together interesting problems.

Extreme Programming leaders insist that all significant development should be done in pairs. But can we say that Pair Programming is the best method in all situations?

Read full post >>

The Elements of Pragmatic Programming Style. Approach.

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. – Antoine De Saint Exupery

The approach to programming is concerned with finding the best ways to translate programmer’s intention into the good system design and code.

The programming is communication. The programmer continuously add, change and refine ideas in the code. Source code has two important goals: tell a computer what to do and tell people what the computer should do. The program code is the only true medium for storing and communicating ideas about the software system behavior. Quality of the ideas expression in the code directly affects overall quality of the system.

So, what are characteristics of the good code?

  1. clear – easier to work with ideas;
  2. minimal – less effort to understand and change ideas;
  3. testable – easier to validate ideas.

These are 6 top reasons for bad design and code:

  1. lack of expertise
  2. unrestrained technical curiosity and creativity
  3. missing big picture: system purpose and customer goals
  4. blindly following popular methods and over-using technology
  5. sloppiness; lack of attention to details
  6. over-complicating design to have more work or increase job security

The programmer can write better code (and avoid most of these problems) by improving programming style and approach.

Read full post >>

Software Creation Mystery - https://softwarecreation.org
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License .