Questions tagged [maintainability]

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.

297 questions
65
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
  • 64,851
  • 44
  • 155
  • 203
61
votes
6 answers

Array of objects vs Object of Objects

The issue is to decided the trade offs between following notations: JSON based: "users": { "id1": { "id": "id1", "firstname": "firstname1", "lastname": "lastname1" }, "id2": { "id": "id2", …
me_digvijay
  • 5,087
  • 5
  • 41
  • 78
55
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
  • 7,593
  • 15
  • 64
  • 105
49
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…
47
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,083
  • 3
  • 11
  • 23
41
votes
1 answer

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
38
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
  • 10,603
  • 16
  • 52
  • 73
35
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
  • 99,791
  • 133
  • 372
  • 575
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
  • 4,876
  • 1
  • 26
  • 42
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,487
  • 12
  • 25
27
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
  • 33,373
  • 14
  • 91
  • 117
26
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…
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
  • 31,476
  • 15
  • 72
  • 121
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
  • 7,189
  • 14
  • 61
  • 101
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
  • 54,471
  • 90
  • 289
  • 523
1
2 3
19 20