naming-conventions

Naming conventions: Guidelines for verbs/nouns and english grammar usage

亡梦爱人 提交于 2019-12-04 08:05:31
问题 Can anyone point me to a site, or give me some wisdom on how you go about choosing names for interfaces, classes and perhaps even methods and properties relating to what that object or method does? This is specifically for Microsoft development, so Java-esque "doGet" and so on isn't really used, however some general rules that cross language barriers must (I would've thought) exist. An example might help: I have 4 choices of names for an interface: IGroupedItem IGroupableItem IDataEntity

Java Interface Naming Conventions [closed]

孤人 提交于 2019-12-04 07:50:13
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I work on a Java web-app that uses Spring for dependency injection and JMock for mocking out these dependencies in our unit tests.

Which way to name a function in Go, CamelCase or Semi-CamelCase?

a 夏天 提交于 2019-12-04 07:46:32
问题 I want to write a function in Go to insert a document into a collection in a MongoDB database. Which way to name the function is better, writeToMongoDB or WriteToMongoD ? The second is CamelCase, while I saw someone using the style of the first one, so I am not sure which one is more appropriate. Thanks. 回答1: Syntax In Go this is not a matter of style, it is a matter of syntax. Exported names (that is, identifiers that can be used from a package other than the one where they are defined)

Naming convention for utility classes in Java

懵懂的女人 提交于 2019-12-04 07:28:12
问题 When writing utility classes in Java, what are some good guidelines to follow? Should packges be "util" or "utils"? Is it ClassUtil or ClassUtils? When is a class a "Helper" or a "Utility"? Utility or Utilities? Or do you use a mixture of them? The standard Java library uses both Utils and Utilities: javax.swing.Utilities javax.print.attribute.AttributeSetUtilities javax.swing.plaf.basic.BasicGraphicsUtils Apache uses a variety of Util and Utils, although mostly Utils: org.apache.commons

Using UNNEST with a JOIN

与世无争的帅哥 提交于 2019-12-04 07:22:46
I want to be able to use unnest() function in PostgreSQL in a complicated SQL query that has many JOIN s. Here's the example query: SELECT 9 as keyword_id, COUNT(DISTINCT mentions.id) as total, tags.parent_id as tag_id FROM mentions INNER JOIN taggings ON taggings.mention_id = mentions.id INNER JOIN tags ON tags.id = taggings.tag_id WHERE mentions.taglist && ARRAY[9] AND mentions.search_id = 3 GROUP BY tags.parent_id I want to eliminate the taggings table here, because my mentions table has an integer array field named taglist that consists of all linked tag ids of mentions . I tried following

Naming convention for unique constraint

不羁的心 提交于 2019-12-04 07:21:33
问题 Naming conventions are important, and primary key and foreign key have commonly used and obvious conventions ( PK_Table and FK_Table_ReferencedTable , respectively). The IX_Table_Column naming for indexes is also fairly standard. What about the UNIQUE constraint? Is there a commonly accepted naming convention for this constraint? I've seen UK_TableName_Column , UQ_TableName_Column , and someone recommending AX_TableName_Column - I don't know where that comes from. I've typically used UQ but I

Why does CakePHP use different plural/singular naming conventions?

六眼飞鱼酱① 提交于 2019-12-04 06:59:13
Can somebody perhaps explain here why on earth CakePHP has a convention of using plural names for db tables and controllers and singular for models? Why not always use singular terms, or always plural? For me it seems confusing to always have to think "now do I use plural or singular here?" (Or is there an easy way to remember??) And then you have the join-tables that use a combination of both! I assume there's a good reason somewhere, but just have not come across it. (I really hope it's not just because Ruby-on-Rails works that way.) Simon. CakePHP Conventions CakePHP’s conventions have been

What is this functional “pattern” called?

坚强是说给别人听的谎言 提交于 2019-12-04 06:38:06
I was fooling around with some functional programming when I came across the need for this function, however I don't know what this sort of thing is called in standard nomenclature. Anyone recognizes it? function WhatAmIDoing(args...) return function() return args end end Edit: generalized the function, it takes a variable amount of arguments ( or perhaps an implicit list) and returns a function that when invoked returns all the args, something like a curry or pickle, but it doesn't seem to be either. WhatAmIDoing is a higher-order function because it is a function that returns another

Python naming conventions for attributes and methods meant to be overwritten

ぃ、小莉子 提交于 2019-12-04 05:19:38
I have some object oriented code in Python, where some classes are meant to be extended to provide the missing custom bits of code (a la Template Method pattern , but also with variables), that will only be used by the super class, not by the client code using them. Are there any style conventions for such abstract (or dull, because their implementation in the super class would be either pass or raise a NonImplemented exception) methods and attributes? I've been browsing the PEP-0008 and it only mentions about prepending an underscore to private members not intended to be used by subclasses.

What naming conventions do you use in C#? [closed]

独自空忆成欢 提交于 2019-12-04 05:17:17
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . As a beginning programmer, I'm trying to settle on a standard naming convention for myself. I realize that it's personal preference, but I was trying to get some ideas from some of you (well a LOT of you) who are much smarter than myself