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
22
votes
7 answers

Speed Comparisons - Procedural vs. OO in interpreted languages

In interpreted programming languages, such as PHP and JavaScript, what are the repercussions of going with an Object Oriented approach over a Procedural approach? Specifically what I am looking for is a checklist of things to consider when creating…
cmcculloh
  • 47,596
  • 40
  • 105
  • 130
20
votes
5 answers

Maintaining both free and pro versions of an application

I want to create a PRO version of my application for Android and was wondering how to structure my repository. For know I have a trunk and feature branches. I'd like to put a pro version in another branch but maybe there is a better way? For…
Marek Stój
  • 4,075
  • 6
  • 49
  • 50
19
votes
9 answers

How to self-document a callback function that is called by template library class?

I have a function User::func()(callback) that would be called by a template class (Library). In the first iteration of development, everyone know that func() serves only for that single purpose. A few months later, most members forget what…
javaLover
  • 6,347
  • 2
  • 22
  • 67
19
votes
4 answers

Angular directives - element or attribute?

I'm part of a team with about 6 UI devs, of varying quality and next to no Angular experience. Many are contractors, with little experience with the code base. The app has a very fancy (complicated) UI. It supports IE8+ (soon hopefully IE9+). We're…
user1147862
  • 4,096
  • 8
  • 36
  • 53
18
votes
9 answers

Do setup/teardown hurt test maintainability?

This seemed to spark a bit of conversation on another question and I thought it worthy to spin into its own question. The DRY principle seems to be our weapon-of-choice for fighting maintenance problems, but what about the maintenance of test code? …
cwash
  • 4,185
  • 5
  • 43
  • 53
17
votes
21 answers

Mandatory use of braces

As part of a code standards document I wrote awhile back, I enforce "you must always use braces for loops and/or conditional code blocks, even (especially) if they're only one line." Example: // this is wrong if (foo) //bar else …
Dean J
  • 39,360
  • 16
  • 67
  • 93
15
votes
2 answers

Something similar to "using" that will create an object and call a method on it when done, but let me do what I want in between

I'm using Lidgren and for every new type of message I make, I end up writing the same kind of code. I'm creating an instance of NetOutgoingMessage, running various assignment calls on it, then sending it when I'm done. Creation and send are the…
Dan B
  • 357
  • 1
  • 2
  • 15
14
votes
5 answers

Maintainability Index

I have come across the recommended values for a Maintainability Index (MI) as follows: 85 and more: good maintainability 65-85: moderate maintainability 65 and below: difficult to maintain with really bad pieces of code (big,…
Ani
12
votes
5 answers

How do I share a constant between C# and C++ code?

I'm writing two processes using C# and WCF for one and C++ and WWSAPI for the second. I want to be able to define the address being used for communication between the two in a single place and have both C# and C++ use it. Is this possible? The…
dlanod
  • 8,664
  • 8
  • 54
  • 96
12
votes
1 answer

Create property in MSBuild with result of a boolean expression

Is there a neat way to create "boolean" properties to use in MSBuild? I can evaluate the expression inside a Condition attribute, but not inside the Value attribute of a CreateProperty task. I'd like to do something like this:
Rob
  • 4,327
  • 6
  • 29
  • 55
11
votes
4 answers

Best pattern for Constants in SQL?

I have seen several patterns used to 'overcome' the lack of constants in SQL Server, but none of them seem to satisfy both performance and readability / maintainability concerns. In the below example, assuming that we have an integral 'status'…
StuartLC
  • 104,537
  • 17
  • 209
  • 285
11
votes
1 answer

small code redundancy within while-loops (doesn't feel clean)

So, in Python (though I think it can be applied to many languages), I find myself with something like this quite often: the_input = raw_input("what to print?\n") while the_input != "quit": print the_input the_input = raw_input("what to…
Ponkadoodle
  • 5,777
  • 5
  • 38
  • 62
11
votes
7 answers

Visual Studio Code Metrics and the Maintainability index of switch case

As a person who loves to follow the best practices, If i run code metrics (right click on project name in solution explorer and select "Calculate Code Metrics" - Visual Studio 2010) on: public static string GetFormFactor(int number) { …
pee2002
  • 177
  • 3
  • 10
11
votes
2 answers

Using Named Immediately-Invoked Function Expression (IIFE) instead of comments

What are the pros and cons of utilizing Named IIFEs within JS code to describe and group related code? I've been using this "pattern" to lend structure to my more procedural code that gets executed only in one place. Example (function…
Zach Lysobey
  • 14,959
  • 20
  • 95
  • 149
11
votes
10 answers

Should I use Resharper to tidy up other peoples code?

I use Resharper at work. Some of my colleagues do not. When I open some code that has been written someone who doesn't, it is immediately obvious by the amount of orange on my screen. What I am unsure of is to what extent I should feel free to tidy…
Modan
  • 775
  • 4
  • 14
1
2
3
20 21