6 Replies - 1087 Views - Last Post: 10 November 2009 - 10:47 AM

#1 Trake  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 115
  • Joined: 29-June 07

Is there a need for updating old code?

Posted 09 November 2009 - 11:39 AM

The other day I was asked to add some new functionality to a web app that I wrote about 3 years ago and as I was there I also improved the base code that I wrote because as usually happens I've learned better ways to do it since then. So now that app has more functionality but also loads in 50% less time on the clients computers compared to when it was originally created, but then I was thinking how much of that improvement came from the code improvements and how much came from the fact the computers and servers and internet connections involved in the process of loading the app are much improved compared to 3 years ago.

So I was thinking, is there a need to update old code or is it better to "simply" create new apps or similar that harness new technology better?

Is This A Good Question/Topic? 0
  • +

Replies To: Is there a need for updating old code?

#2 NeoTifa  Icon User is online

  • Whorediot
  • member icon





Reputation: 2778
  • View blog
  • Posts: 15,880
  • Joined: 24-September 08

Re: Is there a need for updating old code?

Posted 09 November 2009 - 12:29 PM

Yes. Prime example: Y2K.
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1642
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Is there a need for updating old code?

Posted 09 November 2009 - 12:32 PM

Why re-invent the wheel? I say improve/optimize the current codebase. When Firefox releases a new version do you think they completely rewrite it before a new release?
Was This Post Helpful? 0
  • +
  • -

#4 Trake  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 115
  • Joined: 29-June 07

Re: Is there a need for updating old code?

Posted 09 November 2009 - 01:16 PM

True with say FireFox where a new version is created quite often, but what about when a new version of DirectX or OpenGL is released while you may keep core logic you may need to rewrite large amounts if not all your graphical processes.
Also, in terms of game engines if a new one comes out then a whole new game may be needed to be written.
To look at current events, why is everyone talking about Google Wave when it seems to take the ideas of other existing systems and puts them together, yet it is probably possible to enhance one of the existing products to do the same instead of creating a new system.

In general I agree that re-inventing the wheel is bad, but maybe it has to happen sometimes so that the wheel goes faster and goes longer without needing maintenance?

Quote

Yes. Prime example: Y2K.


I'm too young so correct me if I'm wrong, but wasn't this caused by oversight by programmers in the 70's and 80's who didn't have a lot of space to work with, and then it took 20-30 years for everyone to realise the problem? Why fix something that is broken is true, but surely someone in that time had to add something or fix something and would have seen it.
Also, if those systems had been re-written at some point in that time there would have been no problem as the new system would probably taken advantage of the better resources available compared to when those programs were written.

(Slightly off-topic)Y2K was caused by storing dates as two digit integers but then only time sensitive things would have been affected and even then if you are comparing a two digit integer against another two digit integer the computer doesn't care what they mean only that they are the same or not? Correct my ignorance on this please.

This post has been edited by Trake: 09 November 2009 - 01:27 PM

Was This Post Helpful? 0
  • +
  • -

#5 Darkhack  Icon User is offline

  • D.I.C Head

Reputation: 36
  • View blog
  • Posts: 208
  • Joined: 25-November 08

Re: Is there a need for updating old code?

Posted 09 November 2009 - 02:44 PM

I think it depends on the application. Some software just has a lot of old cruft that needs to be gotten rid of. It may have been poorly written, or it was designed for some ancient CPU architecture or OS that is no longer in use or supported. A lot of great software was made great because they decided to start fresh.

For other projects, it just isn't necessary. One of the reasons Windows is so successful is because they upgraded the system instead rewriting from scratch and breaking binary compatibility. Old Netscape code still lives on in Firefox and X still has a lot of ancient code in it. But on the other hand there is a lot of projects that benefited from a restart. Although I just used Windows as an example for keeping old code, there are also parts that were replaced. The graphics and audio stacks were rewritten for Vista. So now if a buggy graphics driver crashes, it doesn't bring down the whole system, and individual applications can have separate volume settings.

So the answer is sometimes. At times you have a lot to gain by rewriting software. In other cases, you may actually make things worse. Joel Spolsky has an interesting view on it.
Was This Post Helpful? 0
  • +
  • -

#6 TriggaMike  Icon User is offline

  • Using up all your 1's and 0's
  • member icon

Reputation: 85
  • View blog
  • Posts: 1,103
  • Joined: 26-September 08

Re: Is there a need for updating old code?

Posted 09 November 2009 - 06:25 PM

No matter how far computing gets and what types of new technology comes out, the simple fact is good code is still good code. Sure some code may be ancient, but it is ancient for a reason. It does so happen that from time to time us programmers have a stroke of genius and write something that could nearly be carved into stone. It doesn't happen often, but when you break down systems to a low level there is a reason that 30 year old algorithms still do the heavy lifting, and that's because they're GOOD. They may be rewritten and reimplemented but they're still essentially the same code.

For example, if you're engineering a Bicycle, you're not going to start by asking yourself how many wheels it should have, now are you.
Was This Post Helpful? 0
  • +
  • -

#7 NeoTifa  Icon User is online

  • Whorediot
  • member icon





Reputation: 2778
  • View blog
  • Posts: 15,880
  • Joined: 24-September 08

Re: Is there a need for updating old code?

Posted 10 November 2009 - 10:47 AM

View PostTrake, on 9 Nov, 2009 - 02:16 PM, said:

blah blah blah

Quote

Yes. Prime example: Y2K.


I'm too young so correct me if I'm wrong, but wasn't this caused by oversight by programmers in the 70's and 80's who didn't have a lot of space to work with, and then it took 20-30 years for everyone to realise the problem? Why fix something that is broken is true, but surely someone in that time had to add something or fix something and would have seen it.
Also, if those systems had been re-written at some point in that time there would have been no problem as the new system would probably taken advantage of the better resources available compared to when those programs were written.

(Slightly off-topic)Y2K was caused by storing dates as two digit integers but then only time sensitive things would have been affected and even then if you are comparing a two digit integer against another two digit integer the computer doesn't care what they mean only that they are the same or not? Correct my ignorance on this please.



But it needed updated, didn't it ;D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1