New answers tagged

3

It seems like a batcher. So you could name it like this. public class HeavyWorkBatch { ArrayList<File> myList = new ArrayList<>(); public void AddToBatch(File f) { myList.add(f); } public void DoHeavyWork() { for (File f: myList) { /// ... } } } // Note there is a conspicuous lack of ...


7

a library where I can put in all non-UI related code that I want to share between iOS apps (networking, filesystem, logic, algorithms, data structures) Don't you think it's a really bad idea? The purpose of (1) naming things and (2) having libraries is to make it easier to find things. By putting unrelated stuff in the same library, you go against this ...


4

You're right that you shouldn't name the namespace the same as a type it contains. I think there are several approaches you can use: Pluralize: Model.DataSources.DataSource This works especially well if the primary purpose of the namespace is to contain types that inherit from the same base type or implement the same interface. Shorten: Model.QueryStorage ...


3

.NET design guidelines requires I prefix for interfaces. It recommends singular form for classes (Collection suffix for everything implementing IEnumerable) and plural form for namespaces.


-1

You need to prefix namespace names with a company name to prevent namespaces from different companies from having the same name. examples: Fabrikam.Math Litware.Security eventually your namespace must have this structure: <Company>.(<Product>|<Technology>)[.<Feature>][.<Subnamespace>]


3

In probability theory, when a random variable is more likely to produce one result than another, we call it biased towards the first result. I would probably call your functions randomBiasedTo2 etc.



Top 50 recent answers are included