maintainability

Spliting component in Entity-Component-System demands too much refactoring

◇◆丶佛笑我妖孽 提交于 2020-07-08 05:53:10
问题 I have an existing working C++ game library that use Entity-Component-System (ECS). User of my library would like to create some components e.g. Cat :- class Cat{ public: int hp; float flyPower; }; He can modify hp of every cat by e.g. :- for(SmartComponentPtr<Cat> cat : getAll<Cat>()){ cat->hp-=5; //#1 } Some days later, he want to split Cat to HP and Flyable :- class HP{ public: int hp; }; class Flyable{ public: float flyPower; }; Thus, every cat that access hp will compile error (e.g. at

code management: generate source files with slight variations of various rules

别来无恙 提交于 2020-01-26 03:33:09
问题 I have a source file in a declarative language ( twolc , actually) that I need to write many variations on: a normative version and many non-normative versions, each with one or more variations from the norm. For example, say the normative file has three rules: Rule A: Do something A-ish Rule B: Do something B-ish Rule C: Do something C-ish Then one variation might have the exact same rules as the norm for A and C , but a different rule for B , which I will call B-1 : Rule A: Do something A

Code Metrics Calculation in Visual Studio

点点圈 提交于 2019-12-31 08:07:03
问题 What is the prefered score range for the code metrics calculation for the following Maintainability Index Cyclomatic Complexity Depth of Inheritance class Coupling 回答1: The theoretically optimal values are: Maintainability index: 100. Higher values indicate better maintainability. Cyclomatic complexity: 1. The number of different paths that code can take. Depth of inheritance: 1. The number of class definitions above this one in the inheritance tree, not including interfaces. Class coupling:

Code Metrics Calculation in Visual Studio

早过忘川 提交于 2019-12-31 08:06:07
问题 What is the prefered score range for the code metrics calculation for the following Maintainability Index Cyclomatic Complexity Depth of Inheritance class Coupling 回答1: The theoretically optimal values are: Maintainability index: 100. Higher values indicate better maintainability. Cyclomatic complexity: 1. The number of different paths that code can take. Depth of inheritance: 1. The number of class definitions above this one in the inheritance tree, not including interfaces. Class coupling:

What's the cleanest way to write a multiline string in JavaScript? [duplicate]

寵の児 提交于 2019-12-28 05:57:07
问题 This question already has answers here : Creating multiline strings in JavaScript (37 answers) Closed 6 years ago . It doesn't really have to add newlines, just something readable. Anything better than this? str = "line 1" + "line 2" + "line 3"; 回答1: Almost identical to NickFitz's answer: var str = ["" ,"line 1" ,"line 2" ,"line 3" ].join(""); // str will contain "line1line2line3" The difference, the code is slightly more maintainable because the lines can be re-ordered without regard to

What's the cleanest way to write a multiline string in JavaScript? [duplicate]

本秂侑毒 提交于 2019-12-28 05:57:06
问题 This question already has answers here : Creating multiline strings in JavaScript (37 answers) Closed 6 years ago . It doesn't really have to add newlines, just something readable. Anything better than this? str = "line 1" + "line 2" + "line 3"; 回答1: Almost identical to NickFitz's answer: var str = ["" ,"line 1" ,"line 2" ,"line 3" ].join(""); // str will contain "line1line2line3" The difference, the code is slightly more maintainable because the lines can be re-ordered without regard to

Generalizing work orders

自闭症网瘾萝莉.ら 提交于 2019-12-25 08:42:46
问题 Hello stackoverflowians, I am working on designing tables for work orders. The problem: There is different work order models (from now on called WOM ) The WOMs share some attributes (Num, Date, Description, ... etc) The WOMs have details such as: Sectors on wich the work is done. Some WOMs use storage tank instead of sectors (products are prepared in storage tanks). Products and their quantities (plus or no some info on product) applied to wich sector. Human ressources wich worked on the WO.

How not to repeat yourself across projects and/or languages

怎甘沉沦 提交于 2019-12-24 06:44:52
问题 I'm working on several distinct but related projects in different programming languages. Some of these projects need to parse filenames written by other projects, and expect a certain filename pattern. This pattern is now hardcoded in several places and in several languages, making it a maintenance bomb. It is fairly easy to define this pattern exactly once in a given project, but what are the techniques for defining it once and for all for all projects and for all languages in use? 回答1:

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

送分小仙女□ 提交于 2019-12-18 04:09:54
问题 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 closest I've come is defining the constant in an IDL, then using MIDL and TLBIMP to get it into a DLL that can be consumed by C#. However this doesn't seem to expose the constant, or at least I can't figure out how to make it do so. Maybe it is limited

Maintaining both free and pro versions of an application

坚强是说给别人听的谎言 提交于 2019-12-17 21:54:38
问题 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 example, maybe I should create two branches - one for free version, the other for pro? Pro version will have additional features and will be ads-free, so eg. I don't want to include AdMob libraries in the pro version. Do you have any experience or