Software rots if you can no longer set up the exact tool chain and environment (compiler, build tool, OS version, external database, etc) required to build and run it. Even interpreted languages suffer from this problem as features are subtlely changed - by design or accident. It doesn't matter if your project is using an ancient version of VC++ or a two year old version of NodeJS. If it doesn't keep up with the late…
Through the miracle of virtual machines, this is much less so. VMs are the NAT of computer systems.
Why Does Software Rot?
51–60 of 81 posts
Re: Why Does Software Rot?
#52Re: Why Does Software Rot?
#53s/youth/younger programmers/
How can they make work for themselves?
1. Do what's already been done, not even knowing it's already been done. 2. Declare "rot" or some similar claim of obsolescence and proceed to redo what's already been done.
There's nothing necessarily awful about this unless they fail to do a better job than the earlier effort.
Alas, this is too often the case. For a variety of reasons.
In the early days, portability was a higher priority. Not to mention longevity. Because everything was expensive.
Today's software "rots" a lot faster than the software from the early days of computing, IMO.
And so the younger programmers have lots of "work" to do.
Yet I do not see much progress being made. Because I do not measure progress by productivity alone.
Programmers who can churn out code in a dozen different languages to do the same old things are a dime a dozen.
As a user, I do not want software that needs to be updated every week. Poorly written software and gratuitous use of network bandwidth.
But I can see how programmers who love writing code would enjoy this state of affairs.
Re: Why Does Software Rot?
#54Earlier quoted context omitted.
But strstr() doesn't seem rotten or "legacy" in a bad way.
strcpy() does, though.
In a nutshell, we can only safely use it if we somehow know that the source string fits into the destination buffer. Those situations are few: basically, they involve fixed-length string literals being moved into buffers that are "obviously" larger. E.g. some widget_t object has a char name[256] field, and we initialize it by default with strcpy(new_widget->name, ""), or some bullshit like that. The literal is way shorter than 256 and nobody in their right mind will ever make it that long, or shorten [256] in widget_t so that this literal doesn't fit.
In situations when we don't know the length of the source string, there are two cases: it is going into some buffer that is already allocated, or else we will be allocating one. In either situation, we must measure the length of the source string, to test whether it fits or to determine how much to allocate for it.
In the case when the string doesn't fit into the target buffer, we cannot use strcpy, obviously, since it copies the entire string. We use some truncating-copying function, or we handle the situation in some other way (diagnose the problem and abort or whatever).
In the case when we allocate, because we have calculated the length, we still should not use strcpy to finally copy the string. We should use memcpy, because memcpy doesn't wastefully examine every byte to see whether it is null.
So the opportunities for a correct, non-wasteful use of strcpy are few.
Re: Why Does Software Rot?
#55Re: Why Does Software Rot?
#56"Software rot" stems from the world around the software changing in a way the software is unable to adapt to, and breaking it.
Re: Why Does Software Rot?
#57Earlier quoted context omitted.
But strstr() doesn't seem rotten or "legacy" in a bad way.
strcpy() does, though.
http://stackoverflow.com/questions/1694036/why-is-the-gets-f...
Re: Why Does Software Rot?
#58"... the arrogance and self-indulgence of youth." s/youth/younger programmers/ How can they make work for themselves? 1. Do what's already been done, not even knowing it's already been done. 2. Declare "rot" or some similar claim of obsolescence and proceed to redo what's already been done. There's nothing necessarily awful about this unless they fail to do a better job than the earlier effort. Alas, this is too ofte…
Re: Why Does Software Rot?
#59Software rots if you can no longer set up the exact tool chain and environment (compiler, build tool, OS version, external database, etc) required to build and run it. Even interpreted languages suffer from this problem as features are subtlely changed - by design or accident. It doesn't matter if your project is using an ancient version of VC++ or a two year old version of NodeJS. If it doesn't keep up with the late…
Some smart dude, don't remember who, said that every single line of code becomes technical debt the moment it is written.