code-organization

Objective-C, iPhone RSS Reader Application Query - How to organize your RSS Feed Display into groups?

Hi! I've been very unfortunate with my programming. I am still rather new to Objective-C, but I am trying to learn as quickly as possible. I need to complete an RSS Reader for iPhones application, a relatively simple one which parses the rss feed, displays it in a navigation-table view and when you click on an article you are taken to ...

Typical rule of thumb for dividing pieces of code into seperate projects

I'm wondering when to divide code, and components of a project into a separate project. I'm creating a MVC .NET Web project, and there are many directories/sub-directories, and I haven't even started getting into some of the background processes that will take even more space. I'm just trying to work on organizing projects and the code...

Debug class, c++, linker error

Hello all, I am trying to write a debug class for a project I am working on, and I do not want to have to pass a debug object around so I was trying to do it this way. However, I do not know why my compiler or linker seems to be skipping the implementation I am writing for it. If I add #include "Debug.cpp" to main.cpp this code works j...

Are there tools that help organizing #includes?

Are there any tools that help organizing the #includes that belong at the top of a .c or .h file? I was just wondering because I am reorganizing my code, moving various small function definitions/declarations from one long file into different smaller files. Now each of the smaller files needs a subset of the #includes that were at the ...

where should model objects be instantiated for programmatic MVC development on iphone

I'm still fairly new to iphone development, but I'm in the process of moving away from Interface Builder, as I prefer to build views in code. When working in the MVC paradigm though, I'm trying to figure out the best places to 'start' M-ish things; in other words, where to start firing up my model objects and where's the most logical pla...

Designing parameters and return values of functions for a tasklist program

I'm working on a tasklist program to brush up on my C before I take a class. I have two structs, task and tasklist. Here is the task struct: typedef struct task { char name[100]; bool completed; /* bool is described as an enum in an included header file */ date due_date; /* date is a described as a struct in an included header f...

How to organise large code files?

I am increasingly aware that my code in any single file can often span hundreds of lines quite easily and although I know the implementation might be sound, it still feels messy and unorganised. I understand that there are situations where a lot of code is neccessary, but whats the best way to organise it all? I've thought about separa...

Code organization for Rails models accessed in different views

I am confused about where I should put code for a model that is modified in the view for another controller. Huh? Here's the situation: I have a Phone model and an associated controller. In the Phones view you can modify simple things like who the Phone is assigned to. In order to change more low-level things about the Phone, you ha...

Nib file (and code) organization in a one-window, non-document-based app

Good people of StackOverflow, I am in the early stages of building a non-document-based Cocoa application. What I'm aiming for is a window layout similar to iTunes, with a left, middle, and right pane. The Xcode template for such an application includes a file called MainMenu.xib containing both the main menu, and the main application w...

Are type fields pure evil?

As discusses in The c++ Programming Language 3rd Edition in section 12.2.5, type fields tend to create code that is less versatile, error-prone, less intuitive, and less maintainable than the equivalent code that uses virtual functions and polymorphism. As a short example, here is how a type field would be used: void print(const Shape ...

Unit-testing with dependencies between tests

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 just made up a notation for demonstration), def test_readCsv(): ... @dependsOn(test_readCsv) def test_readCsv_duplicateColumnName(): ... @d...

Including pre-compiled libraries in source tree

Hello, I have a cross-platform C++ project. In this project, we use several third-party, statically-compiled libraries that are quite huge and not easy to build. Currently, our source tree looks like this: | +-3rdparty | +-include (initially empty) | +-lib (initially empty) | +-some-library | +-another-library | +-source Whe...

Git Repo Structure for Capistrano recipes and other Misc things

My problem is that I have a bunch of different capistrano recipes and code snippets that I use across multiple projects. My local file structure is a folder called helper-snibbits with folders under that called ./capistrano, ./php-bits, and .py-bits I can track each snippet individually with a repo but that becomes hard to manage on the...

Business layer what's best solution to incorporate Email Templates

Hi there, I'm asking the best solution for a very 'simple' problem. Today, I have emails templates files and also the logic for sending those emails, on my frontend/website. Now, I'm improving my code by removing any Mail logic to my BL. So my idea is to have my Business Layer (BL) project, responsible for sending emails, if some busi...

When to put static function definitions in header files in C?

Hi, I've come across some code that has a large static function in a header file and i'm just curious when it is/is not ok to do this. For example, if many .c files include the header, why not just define the function non-static and link it in ? Any advice or rules of thumb on when/when not to put static function definitions in header ...

How can we effectively version a large web application consisting of multiple sub-applications?

I'm part of a team that operates a portal for our company. There are ~200 small, what we call applications, inside of the portal. One may be to submit receipts, another to submit a timesheet, another to see activities going on, etc. Each of these applications is fairly separate from the others, so we've created individual trunk/branch...