naming-conventions

Defining properties and naming conventions in JavaScript

丶灬走出姿态 提交于 2019-12-03 01:52:21
I've been a good JavaScript programmer and adhered to the coding conventions enlisted by Douglas Crockford . However JavaScript has evolved since then and I believe the naming conventions are now outdated. For example Crockford said: Do not use _ (underbar) as the first character of a name. It is sometimes used to indicate privacy, but it does not actually provide privacy. If privacy is important, use the forms that provide private members . Avoid conventions that demonstrate a lack of competence. However JavaScript now allows you to create non-enumerable properties. Hence it makes sense (at

An Ideal Folder Structure for .NET MVC [closed]

空扰寡人 提交于 2019-12-03 01:39:48
问题 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 . When I started in .NET Webforms I didn't have much trouble finding a folder structure to follow since VS offered you application

python: naming a module that has a two-word name

≯℡__Kan透↙ 提交于 2019-12-03 01:34:09
问题 I'm trying to put together a really simple module with one .py source file in it, and have already run into a roadblock. I was going to call it scons-config but import scons-config doesn't work in Python. I found this SO question and looked at PEP8 style guide but am kind of bewildered, it doesn't talk about two-word-name conventions. What's the right way to deal with this? module name: SconsConfig? scons_config? sconsconfig? scons.config? name of the single .py file in it: scons-config.py?

How to properly set an element's scope using BEM?

故事扮演 提交于 2019-12-03 01:32:10
问题 Given the following BEM tree structure, where five nested levels exist: collection-main__features-top__story__byline__author according to BEM's naming convention, where an element is part of a block and has no meaning outside of the block it belongs to, what is the proper way to name the author class? Since an author is semantically tied to the byline and the story context, but meaningless under the features-top and collection-main blocks, what is the best BEM name? collection-main__author

“ID” or “Id” on User Interface

痞子三分冷 提交于 2019-12-03 01:25:11
问题 The QA manager where I work just informed me there is a bug in my desktop app due to the sign-on prompt being "Operator Id" when it should be "Operator ID". Her argument being that "Id" refers to the ego portion of Freud's "psychic apparatus" and is not semantically correct. Now being an anal engineer (AE) I of course had to go and lookup Id vs ID and from my cursory investigations (google) it seems ID is just as commonly used for Freud's ego as Id is. So my reasoning would be that Id is a

Naming conventions for template types?

风流意气都作罢 提交于 2019-12-03 01:22:18
Traditionally, the names of template types are just a single upper-case letter: template<class A, class B, class C> class Foo {}; But I hesitate to do this because it's non-descriptive and hard therefore to read. So, wouldn't something like this be better: template<class AtomT, class BioT, class ChemT> class Foo {}; I also tend to think the following would not be a bad idea: template<class ATOM, class BIO, class CHEM> class Foo {}; It makes them stand out (and also, it's upper-case letters again). What's your opinion? For C++ templates I have a couple of patterns If there is just a single

Naming convention for controls [duplicate]

纵饮孤独 提交于 2019-12-03 01:21:32
问题 This question already has answers here : textBoxEmployeeName vs employeeNameTextBox (16 answers) Closed 6 years ago . Microsoft has naming guidelines on their website (here). Also I have the Framework Design Guidelines book. What I could not find was a guideline about naming controls. For example, a button, when dropped to a form, gets the typename + number, camel-cased as default name, such as "button1". This is what I do: I delete the number and add a meaningful description after. For

Use of special characters in function names

空扰寡人 提交于 2019-12-03 01:20:51
In Ruby, a standard convention is to use a question mark at the end of a method name to indicate the method returns a boolean result: [].empty? #=> true Another standard convention is to end a method name with an exclamation point if the method is destructive (that is, it modifies the original data): mylist.sort! # sort mylist in-place Recently I have seen these same conventions used in Scheme. Which makes me wonder, what other languages use/support this convention? Are there any other special characters that are commonly used for naming by these or other languages? The answer is, of course,

Lambda variable names - to short name, or not to short name? [closed]

Deadly 提交于 2019-12-03 01:12:49
Typically, when I use lambdas, I just use "a, b, c, d..." as variable names as the types are easily inferred, and I find short names to be easier to read. Here is an example: var someEnumerable = GetSomeEnumerable(); var somethingElseList = someEnumerable.Select(a => a.SomeProperty) .OrderBy(a => a.SomePropertyField); var someDictionary = somethingElseList.ToDictionary(a => new SomeClass(a.Prop1), a => a); Some question this naming, and would prefer to see long typed out names, like this: var someEnumerable = GetSomeEnumerable(); var somethingElseList = someEnumerable.Select(importantObj =>

What is the naming convention for Python class references

独自空忆成欢 提交于 2019-12-03 01:10:43
What is the naming convention for a variable referencing a class in Python? class MyClass(object): pass # which one is correct? reference_to_class = MyClass # or ReferenceToClass = MyClass Here is another example that resembles my situation: # cars.py class Car(object): pass class Sedan(Car): pass class Coupe(Car): pass class StatonWagon(Car): pass class Van(Car): pass def get_car_class(slug, config): return config.get(slug) # config.py CONFIG = { 'ford-mustang': Coupe, 'buick-riviera': Coupe, 'chevrolet-caprice': Sedan, 'chevy-wan' Van: 'ford-econoline': Van } # main.py from config.py import