code-organization

F# code organization: types & modules

折月煮酒 提交于 2019-12-18 10:42:25
问题 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 = // ... Why don't you simply define the operations as static members of type MyType? 回答1: Here are some notes about the technical distinctions. Modules can be

How would you organize a large complex web application (see basic example)?

和自甴很熟 提交于 2019-12-18 09:57:07
问题 Just to keep things interesting and close my final open question, the solution that implements the below functionality in a nicely organized manner with a decent architecture gets a good bounty. The full code is on jsfiddle, and feel free to ask any questions :) How do you usually organize complex web applications that are extremely rich on the client side. I have created a contrived example to indicate the kind of mess it's easy to get into if things are not managed well for big apps. Feel

Recommended Source Control Directory Structure?

a 夏天 提交于 2019-12-17 23:45:04
问题 I am going to be using Subversion for source control on a new J2EE web application. What directory structure will you recommend for organizing code, tests and documentation? 回答1: I usually have Project Directory src - actual source doc - documentation lib - libraries referenced from source dep - installation files for dependencies that don't fit in lib db - database installation script In work with Visual Studio, I'm not sure if this works the same in the java world. But i usually put stuff

Setting up a large software system in Delphi

邮差的信 提交于 2019-12-17 22:15:35
问题 We have a software package which is about 16 years old. It's gone through just about every version of Delphi (besides .NET ones). Over the years, things have become very confusing when it comes to cross-referencing and keeping proper setup for additional packages (like third-party libraries). I was wondering if there is some standard practice when it comes to keeping large projects (and groups of projects) like this organized. So to explain the current setup... This is a multi-application

How are words bound within a Rebol module?

戏子无情 提交于 2019-12-17 18:17:41
问题 I understand that the module! type provides a better structure for protected namespaces than object! or the 'use function. How are words bound within the module—I notice some errors related to unbound words: REBOL [Type: 'module] set 'foo "Bar" Also, how does Rebol distinguish between a word local to the module ( 'foo ) and that of a system function ( 'set )? Minor update, shortly after: I see there's a switch that changes the method of binding: REBOL [Type: 'module Options: [isolate]] set

How should I organize Python source code? [closed]

Deadly 提交于 2019-12-17 17:19:10
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . 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

Can maven projects have multiple parents?

不打扰是莪最后的温柔 提交于 2019-12-17 10:34:09
问题 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 example, for javadoc and pmd plugins, which is not desirable. I want to clean it up and have a real base pom, and then a java-base-pom and a flex-base-pom . But how does this work in a multi-module that has both a Flex part and a Java part? We have plugins to our own application where we use the following

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

倾然丶 夕夏残阳落幕 提交于 2019-12-17 09:20:36
问题 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 files in C would be appreciated, thanks 回答1: Some ideas: One possible legitimate use I can think of is when you want to make a function available without creating a

WPF Data binding: How to organize projects and classes in a solution?

…衆ロ難τιáo~ 提交于 2019-12-13 05:23:11
问题 I have the following projects/assemblies in my solution: Entities ; It is a class library that contains two classes: Account and AccountDetail . Account class has a property Details which is of type ObservableCollection<AccountDetail> and I use it to store the details of the account object. Core ; It is a class library that contains one class: AccountController whose purpose is to get the data from the Sql Server and to populate the Account objects (alongside the AccountDetail collection

CSS separating code in parts

故事扮演 提交于 2019-12-13 03:37:36
问题 I was wondering if there is a way to 'separate' parts/pieces of CSS in a single file, to be more organized and have more readability. For example, when we set some style to an element, it appears like that: Nodes (plus and minus icon) that can be closed/opened So, what i want to know is, there is a way to create something like nodes or 'regions' to close/open parts of CSS, like: Want to separate all styles that I use for DIVs in a single part, Buttons in another part, etc.. then I can close