Discover screenwriting conventions, include the articles, news, trends, analysis and practical advice about screenwriting conventions on alibabacloud.com
HookTaskType HookTaskType Meta string `xorm:"TEXT"` // store hook-specific attributes LastStatus HookStatus // Last delivery status Created time.Time `xorm:"CREATED"` Updated time.Time `xorm:"UPDATED"`}
Variable Naming conventions
Variable names generally follow the Hump method, but when you encounter a particular noun, you need to follow these rules:
If the variable is private and the noun is the first
", Routetemplate: "api/{controller}/{action}/{id}", New {id = routeparameter.optional});In the API controller: Public class Bookscontroller:apicontroller{ [HttpGet] Public string Details (int id);}In this case, a format similar to "API/BOOKS/DETAILS/8" is entered in the browser to map to the details (int id) method.You can also use the ActionName property to alias an action: Public class Bookscontroller:apicontroller{ [ActionName ("Sth")] Public Httpresposnemessage getsth (in
): return self.__var_3 if __name__== "__main__": obj = MyClass () print obj.var_1 print obj._var_2 print obj.get_var_3 () # no more errors
Four, the other should pay attention to
Do not use the first letter to identify the variable type (such as Ivalue) in a language like C, because Python determines the type when it is interpreted.
Because exceptions are also a class, follow the naming conventions for classes.
A technique that enforces type conversions by enabling the compiler to treat one type of variable as a different type.because Pascal has the ability to define new types, the compiler checks for parameters and argument types that are very strict when invoking a function. Therefore, in order to be able to check through the compiler, it is often necessary to convert the type of one variable to the type of another variable. For example, suppose you want to assign a value of a character type to a var
, Type:integer, desc:"Status ID."End Route_param:id do get do Status.find (Params[:id]) END End desc"Create a status."params do requires:status, type:string, desc:"Your status."End Post do authenticate! status.create! ({user:current_user, text:params[:status]}) End desc"Update a status."params do requires:id, type:string, desc:"Status ID."requires:status, type:string, desc:"Your status."End put': ID'Do authenticate! Current_user.statuses.find (Params[:id]). Update ({user:current_user, Text:
Common namingList, Luser array, arruser string, strtitle, split string, Strstatuss (multiple states separated by commas)C #Entity layer unification starting with E, such as euser,eorder, such as the creation of the object is Var euser=new euser ();D to layer (search object layer) unified to D, such as Duservar duser=new Duser (); Multi-table search objects to d+ Each table name, Duserorder property Description Equal,notequal,equalgreatthan,greatthan,equallessthan,lessthan,startwith,endwith, Cont
have a special symbol at the beginning;4. Variables can be declared multiple in the same statement, separated by commas;5. When declaring a variable, you can assign a value or do not assign a value.6. The difference between a constant and a read-only variable:A. Constants must be initialized at declaration time, and values cannot be modified after they have been specified. Read-only fields can be initialized at declaration time, or they can be specified in constructors, and values cannot be mod
naming rules for C # identifiersThe variable name, constant name, class name, and method name in the program are called identifiers . C # has a set of naming rules for identifiers, and errors occur if you do not follow the rules when naming them. This set of rules is simply said to have the following three articles:① identifiers can only be made up of English letters, numbers, and underscores, and cannot contain spaces and other characters.Incorrect identifier declaration:string $user; //错在使用了其他
punctuation, except for any punctuation marks other than _ underline.4.JavaScript names must not contain spaces. Ever.cannot have spaces in variable names5.You cannot use JavaScript keywords (parts of the language, itself) for variable names. ThuswindoworOpenor Locationorstringwould be illegal. Check a JavaScript reference if in doubt as to whether something was or is not part of the language-JavaScript have grown into a fairly fully-fleshed language, so you may get some occasional surprises.Yo
should be capitalized.If you can, color as far as possible with three-bit characters, such as #aabbcc written #abc.If there is no border, do not write border:0, should be written border:none.Try to avoid using AlphaImageLoader.Try to merge duplicate styles as much as possible while keeping the code decoupled.Background, font, and so on can be abbreviated attributes, as far as possible using abbreviated form.Common naming:Container: ContainerPage Header: HeaderContent: Content/containerPage body
1. keywordsC # defines some keywords (public/static/void/class/int/string) that are used to form the basic syntax of C #.The blue word in VS is the key word.The Main, String, console, and so on are not keywords. And just. NET class Library provides a number of methods, properties, etc... In theory, if you don't reference these libraries, there's no such stuff.2. IdentifiersIdentifiers are used to name classes, methods, variables, and so on.Naming rules (legal level, non-compliance On error):1) c
, responsible person, related remarks, using double star annotation/****/2. For the division of large areas under the module, it is customary to use double-line annotations://==================================================Describe:3. For the region, the method notes, through past experience, not everyone is willing to write in detail, so I think simple and clear best, using general comments:Code descriptionAuthor notes and other information (not limited to)4. For some important methods in the
The format and style of programming, as far as possible in the international direction, Microsoft is a very good example. The following link is the official Microsoft agreed format, in writing C, C + + code, it is worth reference.https://msdn.microsoft.com/zh-cn/library/windows/desktop/ff381404 (v=vs.85). aspxIn addition, the following points are mentioned:1, for 32-bit systems, 64-bit systems, typedef variable type is constant, such as a DWORD is always 32 bits wide;2, bool type, the contract i
ASP. NET Web API practice series 03, routing templates, routing conventions, routing settings, asp. netapi
The routes of ASP. NET Web APIs are similar to those of ASP. net mvc. routes are also placed in RouteTable. You can set a routing template in WebApiConfig. cs in the App_Start folder. The default routing template is:
routes.MapHttpRoute( name: "API Default", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Op
classThe function member executes the code. Behavior of a function member definition typeData membersXYZ DataMen1 datamen2//function member F1 () { exceutablecode}f2 () { Exceutablecode} ..... .....C # offers 15 predefined types including 13 simple types and 2 non-simple type membersThe names of all predefined types are made up of all lowercase lettersTwo non-simple types: String ObjectAll pre-defined types are mapped directly to the underlying. NET type, the C # type name is.
Class or interface:One word: The first letter of a word must be capitalizedMultiple words: Capitalize the first letter of each wordmethod or Variable:One word: The first letter of a word must be lowercaseMultiple words: First letter lowercase, uppercase from first letter of second wordSolidOne word: all capsMultiple words: Capitalize all letters and use underscores to separate wordsSingle-line comments can be nested, and multiline annotations cannot be nestedCommon naming
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.