naming-conventions

Programmers dictionary/lexicon for non native speakers

白昼怎懂夜的黑 提交于 2019-12-03 10:14:39
I'm not an English speaker, and I'm not very good at English. I'm self thought. I have not worked together with others on a common codebase. I don't have any friends who program. I don't work with other programmers (at least nobody who cares about these things). I guess this might explain some of my problems in finding good unambiguous class names. I have tried to find some sort of "Programmers dictionary" containing words often used and their meanings. When reading others code I have to look up words quite often, and as many use abbreviations this poses an additional challenge. My very

Best practices for creating a data model [closed]

浪子不回头ぞ 提交于 2019-12-03 09:55:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . For a current project I'm creating a data model. Are there any sources where I can find "best practices" for a good data model? Good means flexible, efficient, with good performance, style, ... Some example questions would be "naming of columns", "what data should be normalized", or "which attributes should be

Naming convention for const object keys in ES6

半世苍凉 提交于 2019-12-03 09:47:44
Is there a recommended naming convention for key names within a const object in es6? I haven't been able to find a resource which states if they should be uppercase or lowercase. const COLOR_CODES = { BLUE: 1, RED: 1 }; vs const COLOR_CODES = { blue: 1, red: 1 }; The examples from this MDN article show both styles, so maybe both are acceptable. According to Google it would be all caps. Speaking from experience, most of the other programming languages have all caps so I would suggest using that. Use NAMES_LIKE_THIS for constant values. Use @const to indicate a constant (non-overwritable)

What are the Laravel naming conventions for controllers/models/views?

青春壹個敷衍的年華 提交于 2019-12-03 09:34:05
I remember hearing you should name your controllers, models and views in a special way. Either singular or plural. I don't remember which ones to name what though, and i can't find anything about it in the doc. I'm guessing it's like this: Controllers are plural Views are plural Models are singular Am i on the right track? I understand it's just a convention and you don't have to follow them, but i still want to know what the right way is. In ASP.NET MVC, I use the convention you mentioned above, expect for Views, which are mixed. If I have a view that displays multiple "things", such as a

Why is the LINQ “apply-to-all” method named Select?

只愿长相守 提交于 2019-12-03 09:31:06
When I read code that uses Select I think "select-all-where". When I read code that uses Map I think "this-to-that" or "apply-to-all". I can't be the only person that feels the name Select is confusing. Map It's really identical to map from functional languages. The reason it's named Select is that it's designed to be used as a part of LINQ which uses SQL-like keywords. from item in collection where item.Value == someValue select item.Name is translated to: collection.Where(item => item.Value == someValue) .Select(item => item.Name) it would be a little inconsistent if Select was named Map ;

Android activity naming

自古美人都是妖i 提交于 2019-12-03 08:40:35
问题 I'm running into more and more naming clashes between Android activities and other classes. I was wondering if you could tell me how you avoid these. Sadly, my particular naming problems are not covered in the related questions on SO. First example I have an activity that displays a level of the game. However, the data required for that level (background artwork, entities etc.) is stored in a separate class. Naturally, I would call the latter class Level . However, I would call the activity

Which abbreviations should we use for python variable names?

坚强是说给别人听的谎言 提交于 2019-12-03 07:00:44
In generally I'm using the standard naming stated in PEP-8 for variables. Like: delete_projects connect_server However sometimes I can't find any good name and the name just extend to a long one: project_name_to_be_deleted I could use pr_nm_del , but this makes the code unreadable. I'm really suffering finding good variable names for functions. Whenever I begin to write a new function I just spent time to find a good variable name. Is there any standard for choosing certain abbreviations for well known variable names like, delete,project,configuration, etc. ? How do you choose short but good

MySQL column name standards / conventions [closed]

半城伤御伤魂 提交于 2019-12-03 06:49:58
问题 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 4 years ago . I'm looking for document (suggestions) with column name standards or conventions for MySQL. Can anybody suggest any? 回答1: There's nothing "standard" in this space I'm aware of, unlike say Sun's old Java conventions. Anything you adopt will be personal/company preference. That

How to name a variable: numItems or itemCount?

 ̄綄美尐妖づ 提交于 2019-12-03 06:42:08
问题 What is the right way to name a variable int numItems; vs. int itemCount; or constant: public static final int MAX_NUM_ITEMS = 64; vs. public static final int MAX_ITEM_COUNT = 64; 回答1: In "Code Complete," Steve McConnell notes that "Number" is ambiguous. It could be a count, or an index, or some other number. "But, because using Number so often creates confusion, it's probably best to sidestep the whole issue by using Count to refer to a total number of sales and Index to refer to a specific

Name conventions for xibs

て烟熏妆下的殇ゞ 提交于 2019-12-03 06:34:00
I've been looking at the sample code and sometimes Apple names xib files ClassNameView and sometimes ClassNameViewController . The ClassName is always a UIViewController or UITableViewController , which had me wonder what convention to use when naming a xib. I would think View as it's not really the ViewController , but curious on what the convention is or at least what your naming conventions are for xibs. I use ClassNameView since the xib represents the view, not the view controller. I don't think there is a generally accepted convention. CocoaTouch supports both conventions, with a