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
69
votes
3 answers
What are the trade-offs between different methods of constructing API URLs: subdomain vs. subdirectory and versioning?
We have a web application with a domain name of example.com. Now we want to extend a part of this application as a REST API, and we are debating on the best URL pattern.
We could use the URL pattern api.example.com or example.com/api. What…

Abhijith Prabhakar
- 1,325
- 3
- 12
- 24
68
votes
6 answers
Array of objects vs Object of Objects
The issue is to decide the trade offs between the following notations:
JSON based:
"users": {
"id1": {
"id": "id1",
"firstname": "firstname1",
"lastname": "lastname1"
},
"id2": {
"id": "id2",
…

me_digvijay
- 5,374
- 9
- 46
- 83
66
votes
10 answers
What should we do to prepare for 2038?
I would like to think that some of the software I'm writing today will be used in 30 years. But I am also aware that a lot of it is based upon the UNIX tradition of exposing time as the number of seconds since 1970.
#include
#include…

Frank Krueger
- 69,552
- 46
- 163
- 208
58
votes
6 answers
Doing calculations in MySQL vs PHP
Context:
We have a PHP/MySQL application.
Some portions of the calculations are done in SQL directly. eg: All users created in the last 24 hours would be returned via an SQL query ( NOW() – 1 day)
There's a debate going on between a fellow…

siliconpi
- 8,105
- 18
- 69
- 107
50
votes
7 answers
Writing Maintainable Event-Driven Code
I have just recently started playing with event-driven architectures, coming from a pretty standard object-oriented mindset.
The first thing I noticed was that the difficulty in understanding and tracing through programs seems to increase…

Mantas Vidutis
- 16,376
- 20
- 76
- 92
42
votes
2 answers
Code Metrics Calculation in Visual Studio
What is the prefered score range for the code metrics calculation for the following
Maintainability Index
Cyclomatic Complexity
Depth of Inheritance
class Coupling

Asad
- 21,468
- 17
- 69
- 94
40
votes
9 answers
What's the cleanest way to write a multiline string in JavaScript?
It doesn't really have to add newlines, just something readable.
Anything better than this?
str = "line 1" +
"line 2" +
"line 3";

Robin Rodricks
- 110,798
- 141
- 398
- 607
39
votes
28 answers
How complex should code be?
I'm studying about algorithms which can help me write smaller but more complex code. Instead of writing 150 lines of if-else statements, I can design an algorithm that does it in 20 lines. The problem is a lot of these algorithms can be complex…

danmine
- 11,325
- 17
- 55
- 75
31
votes
9 answers
managing document.ready event(s) on a large-scale website
NOTE: I have now created a jQuery plugin which is my attempt of a solution to this issue. I am sure that it could be improved and i've probably overlooked lots of use cases, so if anyone wants to give feedback feel free :-)…

WickyNilliams
- 5,218
- 2
- 31
- 43
29
votes
5 answers
Is it OK to #include .c source file for maintainability of embedded C code?
I am not an expert C programmer and I know that including .c source file from another is considered bad practice, but I have a situation where I think it could help maintainability.
I have a big structure with a lot of elements and I use #define to…

ncenerar
- 1,517
- 12
- 25
29
votes
4 answers
To CTE or not to CTE
Having been stuck with SQL2000 for far too long, I've not really had a lot of exposure to Common Table Expressions.
The answers I've given here (#4025380) and here (#4018793) have gone against the flow in that they didn't use a CTE.
I appreciate…

Stephen Turner
- 7,125
- 4
- 51
- 68
28
votes
19 answers
Design of an Alternative (Fluent?) Interface for Regular Expressions
I've just seen a huge regex for Java that made me think a little about maintainability of regular expressions in general. I believe that most people - except some badass perl mongers - would agree that regular expressions are hardly maintainable.
I…

sfussenegger
- 35,575
- 15
- 95
- 119
25
votes
10 answers
Our code sucks and I'm powerless to fix it. Help!
Our code sucks. Actually, let me clarify that. Our old code sucks. It's difficult to debug and is full of abstractions that few people understand or even remember. Just yesterday I spent an hour debugging in an area that I've worked for over a…

Michael Kristofik
- 34,290
- 15
- 75
- 125
23
votes
8 answers
What makes Perl code maintainable?
I've been writing Perl for several years now and it is my preferred language for text processing (many of the genetics/genomics problems I work on are easily reduced to text processing problems). Perl as a language can be very forgiving, and it's…

Daniel Standage
- 8,136
- 19
- 69
- 116
22
votes
4 answers
Cruft code. IoC to the rescue
In question about usefulness of IoC Container, the winning submitter mentioned that with an IoC container you can take this:
public class UglyCustomer : INotifyPropertyChanged
{
private string _firstName;
public string FirstName
{
…

AngryHacker
- 59,598
- 102
- 325
- 594