1 Replies - 1414 Views - Last Post: 29 March 2013 - 04:35 AM

#1 b.netana  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 92
  • Joined: 11-September 11

deciding what parts of your code needs to be changed

Posted 29 March 2013 - 02:35 AM

How does a programmer decide what parts of their code needs to be changed? What is the process?
Is This A Good Question/Topic? 0
  • +

Replies To: deciding what parts of your code needs to be changed

#2 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2153
  • View blog
  • Posts: 3,313
  • Joined: 21-June 11

Re: deciding what parts of your code needs to be changed

Posted 29 March 2013 - 04:35 AM

That depends entirely on the situation we're talking about, i.e. what we want to achieve by changing the code. If the code is buggy and we want to change it to remove the bug, we use a debugger to find out where the bug is and then change that part of the code.

If the code is slow and we want to make it faster, we use a profiler to find out which part is the bottleneck and change that part to make it faster (once we've determined that that part can indeed be made faster that is -- otherwise we need to rethink the whole design).

If parts of the code are hard to read or to maintain, we consider whether those parts can be independently refactored to make them more readable and maintainable. If that's not possible, it might be a problem with the API that they use, so we should consider whether the API can be changed in a way that makes the code that uses the API more readable and maintainable. If that's also not possible, we might rethink the design and/or consider whether the problem is really big enough to justify the cost of changing everything.
Was This Post Helpful? 3
  • +
  • -

Page 1 of 1