code-organization Questions

1

I have two PowerShell classes that are inter-dependent: Class A: class A { [int] hidden $i [B] hidden $b_ A([int] $i) { $this.i = $i } [void] set_b([B] $b) { $this.b_ = $b } [B] get_b(...
Capello asked 4/8, 2021 at 20:28

15

Solved

I have been running StyleCop over some C# code, and it keeps reporting that my using directives should be inside the namespace. Is there a technical reason for putting the using directives inside ...
Bryantbryanty asked 24/9, 2008 at 3:49

11

Is it OK (or even recommended/good practice) to #include a .c file in another .c file?

1

Solved

I'm trying to call a function belonging to some module from another module (for code factoring, organization, etc). Here is my crate structure: ➜ mod_test git:(master) ✗ tree . ├── Cargo.lock ├─...
Albino asked 2/4, 2020 at 14:13

2

I am looking for a good project organization for a multi-platform project with multiple components written in Go. I am aware of the recommended layout from http://golang.org/doc/code.html, but the ...

3

I'm writing a Python library that represents some web API. Right now, my library directory looks close to this: __init__.py Account.py Order.py Category.py requests.py In __init__.py, I have so...
Biweekly asked 27/9, 2019 at 19:27

6

Solved

How do you do unit testing when you have some general unit tests more sophisticated tests checking edge cases, depending on the general ones To give an example, imagine testing a CSV-reader (I ...
Ellington asked 1/10, 2010 at 21:29

10

Solved

When I undertake an R project of any complexity, my scripts quickly get long and confusing. What are some practices I can adopt so that my code will always be a pleasure to work with? I'm thinkin...

3

Solved

What is the recommended doctrine for using the AutoOpen attribute ? (This question is probably is in continuation to when to use module function VS static function on similarly named type ) Exper...
Sensate asked 19/10, 2012 at 15:23

18

If you're writing a library, or an app, where do the unit test files go? It's nice to separate the test files from the main app code, but it's awkward to put them into a "tests" subdirector...
Drawee asked 14/9, 2008 at 5:41

1

Solved

I have multiple fixtures (interaction between a website and a hybrid app) and I would like to have a test suite run (Smoke test, regression test ...) but I'm not sure how to do it. This is how my ...
Trudietrudnak asked 23/11, 2018 at 11:7

6

Solved

This is an IDE question I am always working with collapsed methods, because I want to be able to see my methods all together. This is a little time consuming because I have to use the mouse to scro...
Preparatory asked 3/6, 2010 at 10:49

3

Solved

I'm just learning some Swift and I've come across the section that talks about nesting functions: Functions can be nested. Nested functions have access to variables that were declared in the out...

11

Solved

I recently started learning Java and found it very strange that every Java public class must be declared in a separate file. I am a C# programmer and C# doesn't enforce any such restriction. Why do...
Gadabout asked 23/8, 2009 at 14:33

1

We have several tools for our website written in Angular 1 for order tracking, pricing quotes, etc. It has a pretty normal npm structure root/ ├── build/ ├── src/ │ ├── scripts/ │ ├── assets/ │ ├─...
Threaten asked 10/4, 2017 at 12:46

4

Solved

How do you decide between writing a function inside a module or as a static member of some type? For example, in the source code of F#, there are lots of types that are defined along with a equall...
Hierarchy asked 6/2, 2010 at 18:27

8

Solved

Consider a class which implements a lot of interfaces, would it make sense to implement each interface in a separate file using partial class definitions? Would this be an abuse of the language f...
Grubb asked 13/1, 2011 at 14:35

1

Solved

I am uncertain about the way of including several modules into RSpec, so let me describe my situation. Under app/helpers I have two files with helpers, containing the modules ApplicationHelper and...
Humiliate asked 17/7, 2014 at 7:6

1

Solved

They appear to be in the same file in the documentation example: https://facebook.github.io/react/docs/thinking-in-react.html. How would you break up your components into pages in an instance like...
Peculiarize asked 23/3, 2017 at 23:23

9

Solved

I love to organize my code, so ideally I want one class per file or, when I have non-member functions, one function per file. The reasons are: When I read the code I will always know in what fil...
Partheniaparthenocarpy asked 10/2, 2009 at 5:20

6

Solved

We have Java and Flex projects. We currently have 1 base pom that contains the configurations we want to use for both projects. Problem with this is: Flex projects inherit configuration, for exampl...
Ornithorhynchus asked 28/10, 2009 at 11:54

1

So, having spend many years in an object oriented world with code reuse, design patterns and best practices always taken into account, I find myself struggling somewhat with code organization...
Tamartamara asked 25/9, 2015 at 7:30

1

Solved

I would like to use java.nio.files.Path in a class I'm creating called "DocumentGenerator" but I'm not sure how to instantiate and initialize it when using a constructor that does not pass in anoth...
Hekate asked 25/3, 2016 at 3:5

2

I'm building my first android app, and it's gotten a little messy already. I'm using List/detail patterns because they're what fit the circumstances, but because I'm developing for both mobil...
Aha asked 6/8, 2013 at 3:18

2

Solved

I'm using GIT to manage a Content Management System (CMS) project. The CMS can have multiple plugin (module). So basically, I want to have 3 types of repositories: The core CMS development ( eve...
Ophidian asked 25/3, 2011 at 19:55

© 2022 - 2024 — McMap. All rights reserved.