naming-conventions

MySQL naming conventions, should field name include the table name?

坚强是说给别人听的谎言 提交于 2020-01-01 01:47:08
问题 A friend told me that I should include the table name in the field name of the same table, and I'm wondering why? And should it be like this? Example: (Table) Users (Fields) user_id, username, password, last_login_time I see that the prefix 'user_' is meaningless since I know it's already for a user. But I'd like to hear from you too. note: I'm programming in php, mysql. 回答1: I agree with you. The only place I am tempted to put the table name or a shortened form of it is on primary and

Naming convention for new projects [closed]

放肆的年华 提交于 2019-12-31 09:47:13
问题 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 6 months ago . I've tried several times to come with an answer to this question. I'm not happy with how projects are named in my shop, they are usually random named after some of these items: the client some technology used/ or expected to be used inside the project some acronyms for the

Naming convention for new projects [closed]

不打扰是莪最后的温柔 提交于 2019-12-31 09:45:51
问题 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 6 months ago . I've tried several times to come with an answer to this question. I'm not happy with how projects are named in my shop, they are usually random named after some of these items: the client some technology used/ or expected to be used inside the project some acronyms for the

What are the naming conventions that you use while coding?

爷,独闯天下 提交于 2019-12-30 07:16:33
问题 What are the naming conventions that you use while coding? 回答1: I hope we will not discuss prefixes for field names and brace styles here :) Here is my bible for .NET: Also MSDN gives solid guidelines. Another useful source is MS Internal Coding Guidelines 回答2: Here's a list of general naming conventions from MSDN. I tend to just go-with-the-flow, however. Whatever standards are currently in place, it's usually easiest to just go with them and maybe slowly shift it over time. It's not really

Naming convention for class properties in TypeScript

无人久伴 提交于 2019-12-30 05:55:08
问题 According to the offical style guide you should Avoid prefixing private properties and methods with an underscore. As I come from a Java background, I usually would just use the this keyword: export default class Device { private id: string; constructor(id: string) { this.id = id; } public get id(): string { // [ts] Duplicate identifier 'id'. return this.id; } public set id(value: string) { // [ts] Duplicate identifier 'id'. this.id = value; } } But the TypeScript compiler complains: [ts]

CA1500 vs. SA1309 - Which one wins?

百般思念 提交于 2019-12-30 03:44:04
问题 I'll prefix by saying that I understand that both Code Analysis and StyleCop are meant as guidelines, and many people chose to ignore these anyway. But having said that, I'd like to see what the general consensus is with regard to these two rules. Rule CA1500 says don't make parameter names and private field names the same. Rule SA1309, on the other hand, says don't prefix members with underscore or "m_". This leaves us with little options for distinguishing private backing fields from their

Picking good identifier names

大憨熊 提交于 2019-12-29 06:52:08
问题 Ok, so you can read guidelines on identifier naming 'til you're blue in the face... camel case, pascal case, make 'em descriptive... but they won't help you actually pick the best name for a given application domain. The easiest to choose (IMHO) are one or two word noun groups: EntryForm Employee WidgetCollection But not every class fits neatly into a noun so I see a lot of people turn verbs into nouns by adding -er to the end of them: AccountManager RecordCounter ProcessRunner The biggest

Java Exception Naming Conventions

五迷三道 提交于 2019-12-29 03:36:06
问题 In Java, is there a semantic difference between using " Illegal " (as in IllegalArgumentException ) versus " Invalid " (as in javax.activity.InvalidActivityException )? During the course of an assignment it became useful to write a subclass of IllegalArgumentException to represent a series of input characters that cannot be tokenized, and I'm wondering whether convention says to use InvalidTokenException or IllegalTokenException . The only difference I can find so far is that java.lang seems

Foreign Key naming scheme

半腔热情 提交于 2019-12-29 02:24:13
问题 I'm just getting started working with foreign keys for the first time and I'm wondering if there's a standard naming scheme to use for them? Given these tables: task (id, userid, title) note (id, taskid, userid, note); user (id, name) Where Tasks have Notes, Tasks are owned by Users, and Users author Notes. How would the three foreign keys be named in this situation? Or alternatively, does it even matter at all ? Update : This question is about foreign key names, not field names! 回答1: The

Restful API naming conventions [closed]

守給你的承諾、 提交于 2019-12-28 12:32:43
问题 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 . So me and my boss aren't agreeing here and can't find any information on it. Scenario: I want to get all the users for a certain organisation. What should the URL be? mydomain.com/users/by/organisation/{orgId} OR mydomain.com/organisation/{orgId}/users Our arguments: Case 1: