Questions tagged [file-structure]

77 questions
38
votes
8 answers

Is there a conventional way to combine file path strings?

In an example: var assets = "images/" var sounds = assets+"sounds/" Is it more conventional to put the slash on the back of a file path? var assets = "/images" var sounds = assets+"/sounds" Is there another method that is a good common practice?
iiridescent
  • 499
  • 1
  • 4
  • 7
21
votes
5 answers

Is it a bad practice to give two very different files with the same general purpose the same name?

Is it a bad practice to give two very different files with the same general purpose the same name, separating them into different directories?
19
votes
7 answers

How do you organize your MVC framework while supporting modules/plugins?

There are a two main codebase structures that I have seen when it comes to MVC frameworks. The problem is that they both seem to have an organisational bug that goes with them. Standard MVC /controller /model /view Problem: No separation of related…
Xeoncross
  • 1,213
  • 1
  • 11
  • 24
18
votes
4 answers

Is there a better alternative to the folder-based file system, and will it be replaced any time soon?

All file systems I've encountered have been based on folders - you have a root folder, which contains files and subfolders, which in turn contains files and subfolders, and so on. Is there a better alternative to organizing files, and will it…
gablin
  • 17,377
  • 22
  • 89
  • 138
18
votes
1 answer

Why is the code section called a text section?

The section of an executable that contains code is sometimes called the .text section. In segmented memory architectures, a segment mapped as code is sometimes called a text segment. The unix error message “text file busy” (ETXTBSY) means “this file…
16
votes
7 answers

Best way to handle delimited files

So typically a CSV file uses a comma and the return character as it's field and line delimiters. This runs into obvious problems with text which can contain both these characters. Obviously there are options there (escaping them) but how do people…
Jon Hopkins
  • 22,734
  • 11
  • 90
  • 137
15
votes
5 answers

Is there a proper way to create a file format?

I'm building a proprietary file format for an application I wrote in C# .NET to store save information and perhaps down the line project assets. Is there a standard on how to do this in any way? I was simply going to Serialize my objects into binary…
corylulu
  • 271
  • 1
  • 2
  • 5
14
votes
5 answers

Small functions vs. keeping dependent functionality in same function

I have a class that sets up an array of nodes and connects them to each other in a graph-like structure. Is it best to: Keep the functionality to initialize and connect the nodes in one function Have the initialization and connection functionality…
mcfroob
  • 249
  • 1
  • 5
14
votes
4 answers

Is it good practice to keep the main function separate in its own file?

Is it good practice to have a main.c file that just has the main function in it and no other functions so that all other functions can be interfaced? If there is no definitive rule, when is it good to do so and not to do so?
Michael
  • 243
  • 2
  • 5
10
votes
7 answers

Which languages use "paired" header/implementation files?

C is ubiquitous, and C++ nearly as much, but I'm curious which other languages follow a similar model of header files. Specifically, in which other languages is it idiomatic to edit pairs or groups of "header" and "implementation" files? (A group…
Roger Pate
10
votes
3 answers

Clever PHP Application Organization Structures?

There are a million-and-one file-system structures that go into the myriad of Open Source projects available. Things like modules, language files, domains, third-party libraries, migrations, internationalization, backups, and syslinks to other parts…
Xeoncross
  • 1,213
  • 1
  • 11
  • 24
9
votes
1 answer

How should I organize programming files into directories?

Sometimes, one creates a exploratory prototype and forgets about structure in the directories... What are good tips on dividing the programming files over (several levels of) directories?
Tamara Wijsman
  • 8,259
  • 14
  • 58
  • 94
9
votes
4 answers

Considerations when designing a file type

I'm about to start writing a process for saving some data structure from code in to a file of some proprietary, as-yet-undefined type. However, I've never designed a file type or structure before. Are there any things, generally speaking, that I…
Andy Hunt
  • 5,996
  • 1
  • 33
  • 56
9
votes
2 answers

Write a directory structure (pseudo code)

I am writing a wiki article and wondering what is the proper way to write a directory scheme? I am doing something like main folder - sub folder - sub folder ... But I'm stuck after that. Any help?
Steven
  • 193
  • 1
  • 1
  • 3
8
votes
4 answers

C++ Header files design : just like defining an API?

I'm kind of new to large scale software development in C++, and I was wondering on the design side of things. I was reading this question, and I thought that, overall, once we get past constant definitions and other trivial matters, C++ header files…
Jiby
  • 199
  • 1
  • 6
1
2 3 4 5 6