The code-organization tag has no usage guidance.
0
votes
1answer
66 views
Is it a bad practice to use external files for storing SQL templates?
I am working on a report system which aggregate a lot of data from multiple sources (databases and internal APIs).
Among other things I communicated with another departaments and told them I need some ...
1
vote
1answer
86 views
Ruby: Abusing mixin
I'm currently working with some code that IMO has abused ruby's mixin features. Given that I'm new to ruby, I wonder if MO in IMO is correct or not.
My primary question is what makes more sense (and ...
1
vote
2answers
83 views
How to structure classes in a large codebase
One of the most touted rules of OOP is to keep classes small. This means that in a significantly sized project there are bound to be thousands of classes.
Logically it seems to make sense to combine ...
5
votes
1answer
119 views
How to organize my module
This is currently the way I'm organizing it.
myProject/
README
subproject1/
__init__.py
classA.py
classB.py
driver.py
basicTest.py
Driver imports ...
2
votes
0answers
63 views
Should the order of definitions correspond to the order of declarations in header/source files? [closed]
If my header looks like this:
class foo {
public:
foo();
~foo();
QString b();
QString c();
QString a();
void setB(QString s);
void setC(QString s);
void ...
5
votes
1answer
2k views
Directory organization of a CMake (C++) repository containing several projects
I would like some advises on the organization of a set of related but independent C++ projects stored in a single (git) repository. The projects use CMake.
For a simplified example we imagine 2 ...
3
votes
1answer
84 views
Split program to smaller programs
I have for planned to build my own drone from scratch for learning purpose and will program all controls for the drone. My question is if it's a good idea to split the code that doesn't interact with ...
0
votes
2answers
278 views
Way to organize repetitive text in Java
Some times I have texts that appears in different places, like comments, messages... For example if I have a custom Exception, probably class doc, messages that passes as parameter to its constructor ...
1
vote
1answer
705 views
What is the purpose of separating routes into individual modules with Node.js and Express?
My app uses Node.js and Express 4 and has the following code in the app.js file located in the root directory:
var express = require('express');
var index = require('./routes/index');
var users = ...
2
votes
1answer
98 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 ...
3
votes
1answer
136 views
Structure project based on platform or design?
I have a medium sized project (~10,000 lines) that runs on Windows and Linux. However it is only specific components of the program that are platform dependent and are located in a folder called ...
0
votes
1answer
190 views
How to organize large polyglot projects?
One of my projects started as PHP but recently some of the new functionality has been written in JavaScript on Node.js platform.
How do big polyglot projects that use multiple languages to write ...
1
vote
0answers
206 views
Structuring a multi-language project?
I'm working on a project which involves writing code for multiple devices, each in its own language (in particular, Arduino and Python). I want to contain the entire project in a single directory, but ...
-1
votes
1answer
64 views
Know any good resources/information on architecting an iOS app? [closed]
I spent a few months working on an iOS app of mine (in Swift) before realizing it was really a bunch of MVCs (Massive View Controllers).
I want to start fresh and build something modular, scalable, ...
5
votes
1answer
389 views
What and how much domain code should be put in an F# module
According to recommendations given here, F# modules should correspond to DDD bounded contexts, i.e. subdivisions of a business domain.
The bounded context I'm working on right now has 2 aggregates ...
4
votes
2answers
546 views
Practices for organizing JavaScript AMD imports
Our company has been using newer versions of the Dojo framework, which have progressed to an AMD-based loader format. I'm currently trying to find logical ways to separate layer files, taking a module ...
1
vote
0answers
178 views
Organize Web API Controllers by their associated Views, or by the logical type they operate against?
We're building a large Angular SPA that uses ASP.NET Web API on the backend. The application will have a large number of views (100-200). I'm debating whether to organize the Web API such that the ...
0
votes
1answer
719 views
Git structure for java project
I know there are multiple posts on similar problems, so please be kind with me.
I am asking for suggestions I have not thought of and for good advice.
I have a java "project" that is structured in a ...
0
votes
2answers
2k views
Organizing solution / project structure and classes for Line of Business Application (LOB)
The question how-do-you-organize-your-projects already has a few good answers. I would like to get a better understanding about this suggested structure:
MyApp.Core
MyApp.Model
MyApp.Presenter
...
1
vote
5answers
902 views
Breaking up classes and methods into smaller units
During code reviews a couple devs have recommended I break up my methods into smaller methods.
Their justification was (1) increased readability and (2) the back trace that comes back from production ...
2
votes
3answers
443 views
What is a good way to share internal helpers?
All my projects share the same base library that I have build up over quite some time. It contains utilities and static helper classes to assist them where .NET doesn't exactly offer what I want. ...
6
votes
1answer
204 views
What to focus on when separating a monolithic codebase into separate (NuGet) packages?
I work on a fairly large web application. The main solution containing the web application project has over 100 projects. The average build time of that solution is 2 minutes on a 12 GB quad-core ...
2
votes
3answers
179 views
When to use python function nesting?
I am writing a program that creates backup of directories.
Which of the following approach is better for code organization?
Create separate class for Backup and Zip logic -
class BackupUtil:
...
3
votes
2answers
221 views
Should accessible members of an internal class be internal too?
I'm designing a set of APIs for some applications I'm working on. I want to keep the code style consistent in all the classes I write but I've found that there are a few inconsistencies that I'm ...
1
vote
1answer
1k views
What are the tradeoffs for using 'partial view models'?
I've become aware of an itch due to some non-DRY code pertaining to view model classes in an (ASP.NET) MVC web application and I'm thinking of scratching my itch by organizing code in various 'partial ...
2
votes
0answers
84 views
How to manage success dependency between unit tests [duplicate]
How do you manage the dependency of one unit test on another unit test succeeding?
So, supposed I have a class and this class has say 5 methods. I create like 2 dozen unit tests (test methods) for ...
3
votes
2answers
288 views
TDD workflow for (implementation specific) edge cases
When developing features with TDD, I create a test for each combination of feature and case. So, one test for creating user successfully, one for validation errors, and one for database errors. I ...
2
votes
3answers
1k views
DAL vs BLL functions' return types
Here is how I see the main differences between the DAL and the BLL:
The DAL directly query the database.
The DAL doesn't create new information. It may execute complex sql requests, joining several ...
1
vote
1answer
73 views
When using an ORM should mappings be defined in the code file?
Doctrine offers three ways to define the object mapping properties: in XML, in YAML and as inline docblock annotations in the code. The Doctrine documentation doesn't give any advice on choosing ...
2
votes
4answers
683 views
What is the proper way to store an object with many attributes in Objective-C?
I have an object that I am downloading over HTTP, that has approximately 50 attributes. What is the proper way to store this information in Objective-C? Should I have an NSObject with a property for ...
5
votes
2answers
1k views
Where to put interface in .Net
I have VB.Net project, with a class with a couple of abstract (mustoverride) properties, that I am thinking about moving into an interface.
My question, is structurally how do I do this? Currently ...
5
votes
1answer
223 views
How Do You Organize Your Methods in OO Progamming [duplicate]
Whenever I am programming in an object-oriented language, I am always faced with what order and how to group the methods for an object. Are there any standards for this, or any suggestions?
2
votes
1answer
656 views
Organizing related projects and dependencies for nuget publishing
I've been working on writing .NET bindings for Rollbar, an error and message reporting service, like Airbrake. My library is working nicely and is published in the NuGet gallery.
So now I want to ...
3
votes
1answer
1k views
What are standard directory layouts for storing database scripts in TFS?
I recently took over the maintenance of 10-15 SQL Server databases and to my surprise found out that the team does not store the code scripts anywhere. They currently deploy changes to each ...
3
votes
1answer
516 views
Why do we write our specs in different files from our source?
The D Programming Language supports writing unit tests inline with source. There's a Ruby gem called test_inline that lets you write specs in the same file as your code.
Why is it generally ...
0
votes
1answer
141 views
Exception handling class: static or object-oriented?
I am working in a windows service (using VB.Net) for internal use of my department. When ever a certain type of exception (FooException for now on) is captured, I follow the same logic:
Log the ...
1
vote
1answer
1k views
Big project with many external libraries - source code organisation
I was wondering what is the best way to organize my source code. I was researching on SO and found http://stackoverflow.com/a/1398594/137261 but this source code layout is library specific and doesn't ...
10
votes
2answers
4k views
Should classes, enums and other entities be placed in separate files?
My company's team lead\architect argues that a large-scale project is easier to understand if "entities connected by logic" are placed in one .cs file.
I quote:
"The whole structure of the logic ...
1
vote
1answer
80 views
Need some input on storing stdin, stdout, stderr information for debugging
I am working with a legacy system that is not too bad, but I thought of making some improvements to it, and I wanted to solicit your feedback to help me make good decisions. The platform is Linix ...
2
votes
1answer
561 views
Organizing ASP.Net Single Page Application with Nancy
As a personal project, I'm creating a single page, asp.net web application using Nancy to provide RESTful services to the single page. Due to the complexity of the single page, particularly the ...
2
votes
1answer
2k views
Should I implement BackBone.js into my ASP.NET WebForms applications?
Background
I'm trying to improve my group's current web app development pattern. Our current pattern is something we came up with while trying to rich web apps on top of ASP.NET WebForms (none of us ...
15
votes
6answers
3k views
Using nested public classes to organize constants
I'm working on an application with many constants. At the last code review it came up that the constants are too scattered and should all be organized into a single "master" constants file. The ...
3
votes
4answers
985 views
How to maintain same code fragments on multiple projects [closed]
I am an indie developer working on multiple Android projects. I am having problem with maintaining same functionality on different projects. For example, three of my apps use the same 2 classes; since ...
3
votes
5answers
1k views
How do you name your personal libraries? [closed]
I'm pretty bad with naming things.
The only name I can every generically come up with is 'helper'. Say, if I have a header file that contains helping functions for manipulating paths, I tend to put ...
25
votes
9answers
4k views
How do you organize highly customized software?
I'm working on a large software project which is highly customized for various customers arround the world. This means that we have maybe 80% code which is common between the various customers, but ...
11
votes
1answer
6k views
Organizing code for iOS app development
I've been developing an app for the iOS platform, and as I've been going along, I've noticed that I've done a terrible job of keeping my files (.h, .m, .mm) organized. Is there any industry standards ...
4
votes
2answers
360 views
Layout of mathematical views (iOS)
I am trying to figure out the right way to encapsulate graphical information about mathematical objects. It is not simple. For example, a matrix can include square brackets around its entries, or ...
2
votes
4answers
2k views
Splitting code from form operations in C#
I have a large (at least for me - approximately 10k lines) project that is written in C#. I have a treeview object on the left of my form and i have many nodes on my treeview. When i click a node, i ...
-1
votes
1answer
283 views
Javascript Form Validation
When validating a JavaScript form, would it be better to process each input field individually, or, where possible check collectively?
e.g.
validate()
{
noblanks()
fieldOne()
...
7
votes
4answers
442 views
Should large or old codebases be expected to be easy to navigate?
I'm an Undergraduate Computer Science Student currently on a placement year at a company that produces and supports a large enterprise web application. I'm loving the experience of seeing how software ...