naming-conventions

What is the correct casing convention for C# local and instance variables? [closed]

廉价感情. 提交于 2020-01-13 19:27:09
问题 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 2 years ago . There are a lot of former Java developers at my company who use camel casing in C# for both of these. What casing is most widely accepted / used for C#? 回答1: Here is the Microsoft Conventions Here is the full MSDN conventions And here are the internal guidelines via Brad

C++ Style Convention: Parameter Names within Class Declaration

橙三吉。 提交于 2020-01-13 10:17:08
问题 I'm a fairly new C++ programmer and I would like to hear the arguments for and against naming parameters within the class declaration. Here's an example: Student.h #ifndef STUDENT_H_ #define STUDENT_H_ #include <string> using namespace std; class Student { private: string name; unsigned int age; float height, GPA; public: Student(string, unsigned int, float, float); void setAge(unsigned int); }; #endif /*STUDENT_H_*/ vs. #ifndef STUDENT_H_ #define STUDENT_H_ #include <string> class Student {

How do you handle differing naming conventions when serializing C# objects to JSON?

为君一笑 提交于 2020-01-12 04:30:07
问题 I am using ASP.Net to serialize classes designed in C# to JSON. My Javascript application then requests those objects with AJAX. I have done this on a couple of projects now, but I run into the problem that the C# standard naming conventions use PascalCase for the public members, and in Javascript they are generally camelCase. This particularly becomes an issue when I have some Javascript-only classes that use camelCase and some mixed-use classes that use PascalCase since I designed them in C

Should we use prefixes in our database table naming conventions?

落爺英雄遲暮 提交于 2020-01-12 03:16:08
问题 We are deciding the naming convention for tables, columns, procedures, etc. at our development team at work. The singular-plural table naming has already been decided , we are using singular. We are discussing whether to use a prefix for each table name or not. I would like to read suggestions about using a prefix or not, and why. Does it provide any security at all (at least one more obstacle for a possible intruder)? I think it's generally more comfortable to name them with a prefix, in

Ruby variable name with double underscores

混江龙づ霸主 提交于 2020-01-10 19:13:25
问题 Sometimes I see variable names with double underscore in the beginning and the end. For example: Article.__elasticsearch__ Is there some naming convention related to double underscores in Ruby variable names? 回答1: An initial underscore or double underscore basically indicates "special/avoid overwrite" --meaning it's meant to reduce the likelihood that someone else might define a method/attribute of the same name. The most common occurrence is __send__ . From Ruby Forum 回答2: The author of the

Java naming convention for boolean variable names: writerEnabled vs writerIsEnabled

余生颓废 提交于 2020-01-10 09:38:13
问题 Which of the following declarations conforms to Java's naming conventions? private boolean writerIsEnabled; // with methods like public boolean getWriterIsEnabled() public void setWriterIsEnabled() OR private boolean writerEnabled; // with methods like public boolean getWriterEnabled() public void setWriterEnabled() I personally find the first name "writerIsEnabled" to be more readable, especially when you use it in an if statement like this - if(writerIsEnabled) { //... } 回答1: As far as I

How do I remove an SVN tag completely that contains spaces?

丶灬走出姿态 提交于 2020-01-10 05:37:25
问题 I tried to clean up the svn repository and remove a tag that contains a space, so all tags and branches are git conform: PROJECT=myproject svnrepo=svn+ssh://rubo77@myserver.de/var/svn-repos/$PROJECT svn rm "$svnrepo/tags/version 3.6.2" but it seems, that doesn't do the job here: How do I convert an svn repo to git using reposurgeon? How do I remove it entirely? 回答1: You have to supply commit log message when you use svn rm to delete the file in remote repository. When doing delete, rename,

Is a variable named i unacceptable? [closed]

橙三吉。 提交于 2020-01-10 03:34:06
问题 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 . As far as variable naming conventions go, should iterators be named i or something more semantic like count ? If you don't use i , why not? If you feel that i is acceptable, are there cases of iteration where it shouldn't be used? 回答1: Depends on the context I suppose. If you

C# Field Naming Guidelines?

Deadly 提交于 2020-01-09 04:38:41
问题 I am going to be working on a bit of C# code on my own but I want to make sure that I follow the most widely accepted naming conventions in case I want to bring on other developers, release my code, or sell my code. Right now I am following the naming convention that Microsoft has set as they seem to be the most widely accepted. The one thing they don't mention though is naming for private fields. For the most part I have seen them named in camelCase like protected fields however that present

print variable-name in Matlab

天涯浪子 提交于 2020-01-09 03:45:07
问题 I have a function in Matlab that has some variables in it. I need to print out the variable_names (in case of an exception etc.). I am aware of inputname function but it works for input_arguments only. mat = [ 1 2 ; 3 4 ] ; % disp(['Error in var: ' ??(a)]) % desired ouput: Error in var: mat (and NOT 1 2 ; 3 4!) Thanks! 回答1: Matlab essentially does not let you do that. However, you can write a helper function to ease your pain in creating output like that: function disp_msg_var(msg, v) disp(