code-organization

Code organization in Python: Where is a good place to put obscure methods?

I have a class called Path for which there are defined about 10 methods, in a dedicated module Path.py. Recently I had a need to write 5 more methods for Path, however these new methods are quite obscure and technical and 90% of the time they are irrelevant. Where would be a good place to put them so their context is clear? Of course I ...

Use a separate WCF project with Silverlight

I am working on a Silverlight application that uses WCF. I need to have my WCF project separate from the ASP.Net application that will host my Silverlight project. I am looking for some guidance on how I should organize my solution and list gotchas other people have experienced during debugging and deployment. Specifically my questions ...

What is this dashed line called that aligns function blocks in my IDE?

The SPE IDE that I use for my Python code uses this "visual cue" that looks like a vertical dashed line for alignment of (what I would call) function blocks. How can I get this option in Visual Studio 2008? Here is what it looks like: ...

how to organize the code similar to #region/#endregion in .NET?

Hi, While the code is growing big it is getting harder and harder to keep everything well organized. One thing I liked very much the time I developed in .NET was #region/#endregion which enabled to organize the code in logical groups and made further organization much easier. Does anyone know whether there is any similar code organizat...

Organizing Classes in PHP

Suppose I've the following classes in my project: class Is // validation class class Math // number manipulation class Now, if I want to validate a given number for primality where would be the logical place to insert my Prime() method? I can think of the following options: Is_Math::Prime() Math_Is::Prime() ...

Managing site deployments between demo/staging/live on production servers

The way we currently manage site roll outs to the server and then switching sites between demo/acc/live "mode" is a bit hap-hazard and i'm looking to improve the whole process. I've been reviewing automated deployment tools, but also the way the server is structured. I'll save the automated deployment questions for another post, here i'...

Organize small utilities functions

Hi all. After years of programming, we all have a set of small functions used as helpers utilities that we wish it comes build-in so we can use it in any project and have ti taken care by more people (test and optimized). I have quite a collection of these functions. I wonder how do you guys organize them? Do you have any tips? This is...

Can maven projects have multiple parents?

Hi, we have java and flex projects at work. 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 javadoc and pmd for example, which they do not want. I want to do this a bit more clean and have a real base-pom and then a java-base-p...

Folder and file organization for Python development

Hello guys. What is the best way to organize code that belongs to the same project in a Python development environment? What are the do and donts of Python project organization? Do you separate each class in a file? Project A Classes "subsystem1" class1 class2 subsystem1Module "subsyst...

How should I organize my ajax actions files

I would like to know what's the best way to organize my php project with ajaxActions files. At the moment I have a few ./process/ajaxAction_pagename.php files containing my actions like this: if ($action=="actionName") { //code } I'm just wondering if there is a better (or more standard) way to do it. ...

How to organize OO js code in files? Local network application

I'm currently developing an application that will be run on local network in B2B environment. So I can almost forget about micro(mini?) optimizations in terms of saving bandwidth because Hardware Is Cheap, Programmers Are Expensive. We have a well structured Object oriented js code in the project and obviously lots of js classes. If all...

Organizing Python projects with shared packages

What is the best way to organize and develop a project composed of many small scripts sharing one (or more) larger Python libraries? We have a bunch of programs in our repository that all use the same libraries stored in the same repository. So in other words, a layout like trunk libs python utilities projects ...

How should I organize Python source code?

I'm getting started with Python (it's high time I give it a shot), and I'm looking for some best practices. My first project is a queue which runs command-line experiments in multiple threads. I'm starting to get a very long main.py file, and I'd like to break it up. In general, I'm looking for: How do python programmers organize multip...

What do you use for organizing SQL snippets?

What do you use for organizing SQL snippets? I've been using a directory structure with separate SQL files. I work as an consultant and the customer wants some of their people to have an "easier" interface for organizing/searching for SQL snippets than directories and operating system search. What solutions are others using? Seems lik...

How to organize your Controllers to get the best structure (MVC)

Whats the best way to organize controllers. Lets say I have a user controller and a register action, should I have a process_registration action as well where I validate and process the data, or just do all processing within the register action itself. Should I have a validation/processing action for every action that requires it (regist...

System for organizing multi-file Ruby programs?

Is there a standard or conventional system for organizing multi-file Ruby programs? I have embarked on my first large "project" in Ruby, a search program which is logically organized into multiple files and directories. I've outlined below my potential structure: The main file. This file implements the search class and general searchin...

How to better organize the code in C++ projects

I'm currently in the process of trying to organize my code in better way. To do that I used namespaces, grouping classes by components, each having a defined role and a few interfaces (actually Abstract classes). I found it to be pretty good, especially when I had to rewrite an entire component and I did with almost no impact on the ot...

F# code organization: types & modules

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 equally named module, as follows: type MyType = // ... [<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>] module MyType = ...

How to make my Python unit tests to import the tested modules if they are in sister folders?

I am still getting my head around the import statement. If I have 2 folders in the same level: src test How to make the py files in test import the modules in src? Is there a better solution (like put a folder inside another?) ...

What is a good way to organize a PHP website application?

When doing large projects my code seems to get all over the place. How do you guys organize your code? ...