Questions tagged [maintainability]

system quality aspect characterizing the ease of software maintenance

2
votes
1answer
206 views

How to (or should I) refactor RxJS nested subscriptions with intermediate return value?

I hope this fits more here than SO because it is mostly about code design than making it work. Also, this is not tied to RxJs, but more to the reactive paradigm. (TypeScript tag is only added to make ...
49
votes
10answers
11k views

Does splitting a potentially monolithic application into several smaller ones help prevent bugs? [closed]

Another way of asking this is; why do programs tend to be monolithic? I am thinking of something like an animation package like Maya, which people use for various different workflows. If the ...
0
votes
0answers
30 views

Does separating chunks of “similar” code into separate functions really improve maintainability? [duplicate]

I was working on a relatively large function recently (about 500 LOC) and I noticed that a lot of the code could be relatively well summarized into a few different chunks of code: void MyFunction() { ...
0
votes
3answers
89 views

Duplicated formula in front and back end

I'm struggling with logic that is duplicated in the front end code and the database. Right now, I just put a comment. Here is a small example (the current system has a lot of much more complicated ...
2
votes
0answers
81 views

Is “equivalent” functions / methods readability worth its maintanability cost?

First of all, I am sorry if it is a duplicate, I could not think of any "correct" wording to search about this. Second let me clarify: By "equivalent" I mean methods that are meant to have the same ...
2
votes
1answer
155 views

What terminology is associated with uneven maintainability?

A developer is tasked with writing a service that will iterate through a number of records and send notifications for each one. The type of notification might be different per record, so you can ...
0
votes
6answers
863 views

Are vague variable names more maintainable?

I'm looking for some advice about which line of code is more appropriate, readable, and maintainable. 1: var result = mediator.Send(query).Result; 2: var accountDetails = mediator.Send(...
3
votes
1answer
59 views

Aliasing repeated function calls

I'm working on a JavaScript user script to assist my team in making assembling support tickets on a web interface more efficient. In doing so, I'm finding myself making a lot of calls to DOM API to ...
57
votes
9answers
8k views

Readability versus maintainability, special case of writing nested function calls

My coding style for nested function calls is the following: var result_h1 = H1(b1); var result_h2 = H2(b2); var result_g1 = G1(result_h1, result_h2); var result_g2 = G2(c1); var a = F(result_g1, ...
1
vote
0answers
31 views

Running Multiple distinct Services on a single server process

I am working on a java server, which has a bunch of seemingly distinct "services". A lot of which are just effectively classes. From a software architecture point of view I wonder what the opinion is ...
6
votes
2answers
225 views

What time horizon and level of abstraction is the right for the maintainable and evolvable software? [closed]

From time to time I feel exhausted in my software development efforts because I am pressed to think and develop in very specific and very short term manner. One client here and now requires one ...
-1
votes
2answers
131 views

Database optimization vs readibility

I'm working on some code that checks for some invariants in the database. For example to check that an element is not repeated the code checks for a database error since the invariant is coded at ...
3
votes
6answers
776 views

What are the techniques for keeping the code quality high when requirements change?

Whenever I write a piece of functionality from scratch, it's a good and robust code. But often times my assumptions about how the code should work evolve over time. After I reflect those changes in ...
3
votes
3answers
295 views

Designing new system to replace legacy: Would you start with a new database and maintain both independently until the switch? [closed]

We have a legacy system which will eventually be deprecated, at which point we will switch to using a new system. What are the pros and cons of maintaining separate databases for the old and new ...
1
vote
1answer
144 views

Guidelines about fields of classes in maintainable software?

I recently read the Building Maintainable Software book by Joost Visser and feel there is something they haven't discussed. The title hints as much, I do not know if following the guidelines have ...
7
votes
2answers
312 views

Is practice of using Annotations detrimental to code quality and longer term code maintenance?

With Doctrine annotation processing engine for PHP, and Annotatons being used for Doctrine Entities and for Zend Form, and possibly other things, and use in other languages as well, it looks like ...
1
vote
1answer
843 views

Console application for developer interviews [closed]

I have been tasked with helping our HR department create some new interview questions for candidates applying for development positions. As part of the process, I would like to assess their ability to ...
1
vote
1answer
96 views

Overtake the maintenance of a software package

Recently I am using a software package which seems pretty useful, but which I don't understand how it works internally. This package contains software generated by several PhD students and lecturers ...
7
votes
3answers
317 views

How to prevent downstream problems due to inheritance

I've moved this from Stack Overflow and this was the suggested place to ask. This has been marked as a possible duplicate of a question about the merits of composition over inheritance. I'm not asking ...
0
votes
2answers
570 views

When to use classes, and when to use POD (PDS) + functions

Recently, I've read a blog post, that I can't find back, about how we should "free the data". The main point of the post was that we use classes and encapsulation too much since a lot of problems can ...
4
votes
1answer
267 views

How to handle defects from production (older version) in SCRUM

We are moving to SCRUM - in our sprints, we work on a version 1.1, while version 1.0 is being in production. However, ocassional bug from version 1.0 is reported and have to be fixed. I found no ...
0
votes
2answers
204 views

When software rots, what property of the system changes? [closed]

Software rots. Or at least ages. Software development methodologies may slow down this process, but eventually almost any software system becomes so hard to maintain that a reimplementation is ...
1
vote
1answer
68 views

If no contribute intention, should we never change codes in open source frameworks unless no alternatives available?

Suppose I use a open source framework in my project and I would not contribute (submit changes) to that framework, and the current version is stable, should we keep the framework unchanged when ...
7
votes
2answers
878 views

How do you organize API endpoint contracts

Where trying to improve the "confidence" we have in our inter-service communication. Background: "Contracts" has been a matter of sharing a piece of code that defines an interface to implement, but ...
-1
votes
4answers
474 views

Fundamental issues of programming [closed]

I just let my brain run wild and the results are again chaotic. It is kind of bothering me how in the very basics, programming itself can be pretty redundant. Let's look at this snippet of code and ...
2
votes
4answers
204 views

Is it a good idea to make method behavior depend on the calling thread?

I want to subclass a 3rd party class, in order to make it thread-safe. I have a good idea of how to implement this, but there is a problem: the superclass has a property, which affects the behaviour ...
16
votes
4answers
1k views

How to write maintainable, not brittle, unit tests for a GUI?

I tried writing UI unit tests for my GUI apps and I face the problem that, while they work well when I initially write them, they turn out to be brittle and they break whenever the design changes (...
1
vote
1answer
64 views

Maintainability while adding custom findByX methods to DAOs

I'm in the beginning of a project which I want to have the best testability and maintainability possible. To achieve this, I'm reading a lot about concepts in the DDD area, mainly. To get you ...
21
votes
4answers
812 views

What are the ways to avoid duplication of logic between domain classes and SQL queries?

The example below is totally artificial and its only purpose is to get my point across. Suppose I have an SQL table: CREATE TABLE rectangles ( width int, height int ); Domain class: public ...
2
votes
2answers
235 views

Continue building off an ugly code base or start refactoring? [duplicate]

I'm currently interning at a company where I've been tasked with building an application from scratch. I've been working about 8 weeks, with 4 left to go. I've written a lot of code in that time, but ...
1
vote
1answer
211 views

Right-aligning code [closed]

I recently was looking for a CSS solution to vertically-align elements, and I found one here. One thing that I thought was nice was the right-justified code; example: .vertical-center { // ... ...
11
votes
6answers
2k views

Best practice boolean assignment [closed]

I came across the following conditional in a program that I have taken over from another developer: if (obj.Performance <= LOW_PERFORMANCE) { obj.NeedsChange = true; } else { obj....
3
votes
2answers
127 views

What characteristics does software have that's easily modified by other developers 6+ months after initial release? [closed]

One of the measures of maintainable software is its acceptance of changes later on by developers other than the one(s) who wrote it. But what characteristics does software have when it has been in ...
2
votes
1answer
116 views

Pick dynamically the right Factory Class with Inversion of Control

I have a TreeView and I want to enable the context menu when clicking with the right mouse button. It is composed by items from different classes, but they all share the same base class. So, I was ...
5
votes
2answers
237 views

Architectural / Application Practices to guard against 'breaking changes'

We have an application where the customer has changed their mind about a large area of functionality and this area requires a large amount of re-work. Whilst the re-work itself is not an issue, it ...
4
votes
0answers
588 views

Decoupling of Model and API (in an .net WEB API Project)

I currently have one separate project for my models, and one separate project for a API application that consumes this model. The intention of the separation is to avoid any outgoing dependencies from ...
0
votes
1answer
366 views

How to choose between different ways to write some code?

I would like to validate point in a two-dimensional rectangular Cartesian coordinate. I found following regular expression solution on stackoverflow ^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$ . Another ...
2
votes
1answer
969 views

Callback functions: Semantics and maintainability, when they aren't necessary [duplicate]

Within the context of JavaScript/Node.JS; Will using Callback functions improve the maintainability of source code, when there is no need for async programming? For example does the plain code sound ...
4
votes
0answers
129 views

Environment that enables variable constraint checking and creation

Currently, I'm working on a system that enables users to add Tag's to available TagTypes on specific pages. For instance, we would have a TagType called "Installer" and the user wants his name ...
3
votes
1answer
604 views

How reduce the usage of Magic Strings?

In the application database there is a configuration table with this schema: Table: ReleaseProperty ReleasePropertyID ReleaseID Name Value Currently to retrieve a specific property I pass to the ...
-1
votes
5answers
343 views

Isn't striving for elegance counter-productive? [closed]

Many questions have been asked about the nature of elegant code and design, but the underlying assumption seems to be that elegance is a good thing. Therefore it is acceptable or even desirable to ...
29
votes
10answers
5k views

Is template “metaprogramming” in Java a good idea?

There is a source file in a rather large project with several functions that are extremely performance-sensitive (called millions of times per second). In fact, the previous maintainer decided to ...
5
votes
2answers
300 views

Can decoupling hurt maintainability in certain situations?

Can the fact that the business logic is mapped to interfaces instead of implementations actually hinder the maintenance of the application in certain situations? A naive example with the Java's ...
8
votes
1answer
491 views

Refactoring a 1500 LOC method that only builds the graphical UI [closed]

I'm currently scratching my head over how to refactor a method that basically only builds the UI. The method is more than 1500 lines of code (LOC) long - and counting. It has grown, there was no plan ...
1
vote
4answers
366 views

Is there a good way to communicate the intent that a class only contains referentially transparent methods?

My workplace mostly uses C# for writing code. I'm trying to figure out a good way to indicate that a class with referentially transparent methods is intended to be referentially transparent (i.e., ...
23
votes
4answers
2k views

What should plugins use: hooks, events or something else?

Consider an app that allows plugins to react to its program flow. I know 2 ways to achieve this: hooks and events 1. Hooks Use calls to empty functions inside the main program flow. These functions ...
0
votes
1answer
105 views

Persisting type in Java - should I be using flags?

Is there some specific piece of advice around persist values that indicate type? Specifically I want to know if I should persist a flag/state indicating the type in persistence or not. I get the ...
2
votes
1answer
2k views

Splitting and hiding headers in a static library

I am writing a static library for C/C++ (personal project). As my headers became rather large, I thought that splitting my headers would be a good idea. Right now a header looks like this: MainClass....
20
votes
5answers
2k views

Fighting technical debt as the “lowest developer”?

Let's say you work for a company and what you do is develop software for them. You have no idea of the big picture or maybe slight. What you do have are tasks assigned to you via issue tracking system....
1
vote
3answers
180 views

Should one create underlying architecture to increase flexibility - in advance or when needed? [closed]

In this question I asked: Is the cost of designing more levels of abstraction to allow loose coupling worth the benefits, or not? People said that it's often worth the cost, but one should sense ...