Maintainability refers to the nature, methods, theory and art of maximizing the ease with which an asset may be sustained, modified or enhanced throughout the duration of its expected useful life.
Questions tagged [maintainability]
306 questions
10
votes
13 answers
At what point does refactoring become not worth it?
Say you have a program that currently functions the way it is supposed to. The application has very poor code behind it, eats up a lot of memory, is unscalable and would take major rewriting to implement any changes in functionality.
At what point…

JD Isaacks
- 56,088
- 93
- 276
- 422
9
votes
3 answers
Simplify Overriding Equals(), GetHashCode() in C# for Better Maintainability
I find my self overriding Equals() and GetHashCode() frequently to implement the semantic that business objects with identical property values are equal. That leads to code that is repetitive to write and fragile to maintain (property gets added…

Eric J.
- 147,927
- 63
- 340
- 553
9
votes
8 answers
What programming shortcuts do you end up regretting or backing out?
I saw this question and it reminded me of AutoGenerateColumns in the old DataGrid. The few times I've used them, I ended up backing it out because I needed data formatting past the standard "spit out the Data Source columns." Likewise, with toggle,…

bryanjonker
- 3,386
- 3
- 24
- 37
9
votes
11 answers
One database or many?
I am developing a website that will manage data for multiple entities. No data is shared between entities, but they may be owned by the same customer. A customer may want to manage all their entities from a single "dashboard". So should I have…

dsims
- 1,322
- 1
- 15
- 24
9
votes
9 answers
'from X import a' versus 'import X; X.a'
I've seen some Python programmers use the following style fairly consistently (we'll call it style 1):
import some_module
# Use some_module.some_identifier in various places.
For support of this style, you can cite the "explicit is better than…

cdleary
- 69,512
- 53
- 163
- 191
8
votes
2 answers
Usual values on Code Metrics (C#, Visual Studio) for production projects
There are some questions on Code Metrics here, especially this one on goal values. What I'm looking for though is what's "usual" on real life production projects. Maybe it's just me, but no project I ever get put on ever has these things in mind so…

John-Philip
- 617
- 9
- 20
8
votes
6 answers
How do you maintain code with InvalidEnumArgumentException?
I am curious how would you maintain your code once you throw a System.ComponentModel.InvalidEnumArgumentException.
Basically I have a switch statement like this:
switch (enumValue)
{
case MyEnum.Value1:
break;
case MyEnum.Value2:
…

Marlon
- 19,924
- 12
- 70
- 101
8
votes
2 answers
Dependency Injection and code maintainability
I am working on a (vb.net/asp.net) project that is using interfaces to provide dependency injection. But to me, it feels like the maintainability of the code has been killed. When I want to read through the code, I can't simply jump to the code of a…

JLX
- 219
- 2
- 4
8
votes
3 answers
Delphi: Maintainability Virtual vs Virtual Abstract
I was writing a bunch of code a few months ago and now I'm adding stuff to it. I realized I wrote a bunch of functions that descend from a class that has about 2/3rds of its functions abstract and the remaining 1/3rd virtual.
I'm pretty much sick…

Peter Turner
- 11,199
- 10
- 68
- 109
8
votes
9 answers
Is there any appreciable difference between if and if-else?
Given the following code snippets, is there any appreciable difference?
public boolean foo(int input) {
if(input > 10) {
doStuff();
return true;
}
if(input == 0) {
doOtherStuff();
return true;
}
return…

Drew
- 15,158
- 17
- 68
- 77
8
votes
5 answers
Maintainability of Java annotations?
My project is slowly implementing Java annotations. Half of the developers - myself included - find that doing anything complex with annotations seems to add to our overall maintenance burden. The other half of the team thinks they're the bee's…

Dean J
- 39,360
- 16
- 67
- 93
7
votes
1 answer
Spliting component in Entity-Component-System demands too much refactoring
I have an existing working C++ game library that use Entity-Component-System (ECS).
User of my library would like to create some components e.g. Cat :-
class Cat{ public:
int hp;
float flyPower;
};
He can modify hp of every cat by e.g.…

javaLover
- 6,347
- 2
- 22
- 67
7
votes
3 answers
Are enums less maintainable than public static final constants?
I was recently discussing enums vs public static final constants with a friend. I told him that public static final constants are more maintainable than enums, sometimes faster (android developer docs confirm this), and more convenient as well. I…

horvste
- 636
- 6
- 19
7
votes
7 answers
Coding Practice: What are your thoughts on a 1.7 Million LOC project?
I am listening to a panel discussion where a person mentions their 'engine' is not 1.3 but now is 1.7 million lines of code. That frightens me. I can't imagine that number of lines, the amount of modules, etc. I always felt that C++ doesn't handle…
user34537
7
votes
3 answers
How to write a probability algorithm that can be maintained easily?
Supposed I want to create a game. At the start of the game, the player will pick a monster.
It's easy to picks the monster fairly.
// get all monsters with equal chance
public Monster getMonsterFair(){
Monster[] monsters = {new GoldMonster(),…

code4j
- 4,208
- 5
- 34
- 51