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.

306 questions
5
votes
4 answers

Design pattern for parameter settings that is maintainable in decent size java project

I am looking for concrete ideas of how to manage a lot of different parameter settings for my java program. I know this question is a bit diffuse but I need some ideas about the big picture so that my code becomes more maintainable. What my project…
user1443778
  • 581
  • 1
  • 5
  • 20
5
votes
5 answers

Proper use vs. over use of *args in Python

I've been looking at the source code for an open source package that I'm using. Nearly every function uses *args instead of named arguments. I'm finding it hard to follow and use the code, because every time I want to call a function I have to go…
brentlance
  • 2,189
  • 1
  • 19
  • 25
5
votes
2 answers

Code Analysis AvoidExcessiveComplexity - Just Setting Commands

I have a WPF form with 16 buttons on it. When my view model initializes, I need to set all 16 as RelayCommand objects. This is all my Initialize() method does, yet that causes the code analysis error CA1502:AvoidExcessiveComplexity. Is this a good…
Bob Horn
  • 33,387
  • 34
  • 113
  • 219
4
votes
3 answers

How to combine sets of Images, Strings, and Integers, in an easy to maintain format

So, I'm trying to figure out the best way to combine many data types together. Internal to my code, I'm creating a class. Externally, I want to have a single place to go to manage to following types of data, or at least pointers to said data. Note…
PearsonArtPhoto
  • 38,970
  • 17
  • 111
  • 142
4
votes
1 answer

Context Menu inheritance in WPF

I have TreeView which contains different item types. Item Styles are defined over a custom ItemContainerStyleSelector property. My styles are all sharing a base style and only item specific stuff is defined in each style. It looks like…
Petr Osipov
  • 621
  • 6
  • 16
4
votes
4 answers

How to avoid a switch block with 300 cases?

I am trying to add 300 Challenges into my program, but only display them if the CompletionValue.IsChecked = false; If you were creating this program. How would you store the Challenges? I am using a switch but having 300 cases is overkill, is…
MicroSumol
  • 1,434
  • 7
  • 22
  • 32
4
votes
1 answer

Does keeping cyclomatic complexity between 5-10 makes unit testing easier?

I'm planning to keep track of cyclomatic complexity for method and classes in between 5-10. Will it be easier to write unit tests if we keep it in that range? Does it help us write effective unit tests which can be valuable in long run? I know unit…
4
votes
1 answer

What's the best technique to build scalable (extensible), maintainable, and loosely coupled software?

I have been playing around with the concept of 'module' that some mvc frameworks implement and it seems like a good solution, and also with TDD, but I think there must be something more, like a design pattern I missed (I only know a few), that will…
HappyDeveloper
  • 12,480
  • 22
  • 82
  • 117
4
votes
5 answers

Group two functions that differ in only 1 line of code

I have two performance-critical functions like this: insertExpensive(Holder* holder, Element* element, int index){ //............ do some complex thing 1 holder->ensureRange(index);//a little expensive //............ do some complex…
javaLover
  • 6,347
  • 2
  • 22
  • 67
4
votes
2 answers

Good practice with conditional imports

I have a module for configuration, projectConfig, to parse a sample sheet for a project: class SampleSheetFields(): FIELD_1 = "field1" FIELD_2 = "field2" class SampleSheetFieldsOld(): FIELD_1 = "field_1" FIELD_2 = "field_2" I had…
kaligne
  • 3,098
  • 9
  • 34
  • 60
4
votes
1 answer

Best way to store "percentages" while programming?

I have a financial application that deals with "percentages" quite frequently. We are using "decimal" types to avoid rounding errors. My question is: If I have a quantity representing 76%, is it better to store it as 0.76 or 76? Furthermore, what…
jdg
  • 2,230
  • 2
  • 20
  • 18
4
votes
1 answer

Readability vs. Maintainability: Condensing statements to loops

Firstly, an example of what I'm referring to: UINT f, i, s; CONST UINT k[5] = { VK_LBUTTON, VK_RBUTTON, VK_MBUTTON, VK_XBUTTON1, VK_XBUTTON2 }; for (f = RI_MOUSE_LEFT_BUTTON_DOWN, i = 0, s = RI_KEY_MAKE; f != RI_MOUSE_WHEEL; f <<= 1, i += s, s =…
user2379628
4
votes
0 answers

How to design backward compatibility and not turn your code into a mess?

I am developing a Java-based RESTful web application intended to be a centerpiece for its various client apps. Those client-apps can operate on the same assets in the main system (e.g. client-app A creates assets in main system, and client-app B…
4
votes
3 answers

APL readability

I have to code in APL. Since the code is going to be maintained for a long time, I am wondering if there are some papers/books which contain heuristics/tips/samples to help in designing clean and readable APL programs. It is a different experience…
Oleksandr Nechai
  • 1,811
  • 16
  • 27
4
votes
1 answer

Some questions about CQRS

I am currently researching if CQRS can be applied when building a particular system and have some questions I cannot easily find answers for. Command availability/validation What user can do with particular entity is usually tied not only to the…
Arunas
  • 918
  • 1
  • 8
  • 20