What’s the name for hyphen-separated case?

This is PascalCase: SomeSymbol This is camelCase: someSymbol This is snake_case: some_symbol So my questions is whether there is a widely accepted name for this: some-symbol? It’s commonly used in url’s. 15 s 15 There isn’t really a standard name for this case convention, and there is disagreement over what it should be called. That … Read more

Unit test naming best practices [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Closed 6 months ago. Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. What are the best practices for naming unit test classes and test methods? This … Read more

Should I use Singular or Plural name convention for REST resources?

I’m new to REST and I’ve observed that in some RESTful services they use different resource URI for update/get/delete and Create. Such as Create – using /resources with POST method (observe plural) at some places using /resource (singular) Update – using /resource/123 with PUT method Get – Using /resource/123 with GET method I’m little bit … Read more

What is the purpose of the single underscore “_” variable in Python?

What is the meaning of _ after for in this code? if tbh.bag: n = 0 for _ in tbh.bag.atom_set(): n += 1 5 s 5 _ has 3 main conventional uses in Python: To hold the result of the last executed expression in an interactive interpreter session (see docs). This precedent was set by … Read more

Why aren’t ◎ܫ◎ and ☺ valid JavaScript variable names?

I noticed that in Internet Explorer (but, unfortunately, not in the other browsers I tested), you can use some Unicode variable names. This made my day, and I was absolutely delighted that I could write fun Unicode-laden code like this: var ктоείναι草泥马 = “You dirty horse.”, happy☺n☺mat☺p☺eia = “:)Yay!”, ಠ_ಠ = “emoticon”; alert(ктоείναι草泥马 + happy☺n☺mat☺p☺eia … Read more

Database, Table and Column Naming Conventions? [closed]

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 8 years ago. Improve this question Whenever I design a database, I always wonder if there is a best way of naming … Read more

What is the naming convention in Python for variable and function names?

Coming from a C# background the naming convention for variables and method names are usually either camelCase or PascalCase: // C# example string thisIsMyVariable = “a” public void ThisIsMyMethod() In Python, I have seen the above but I have also seen underscores being used: # python example this_is_my_variable=”a” def this_is_my_function(): Is there a more preferable, … Read more

What are the rules about using an underscore in a C++ identifier?

It’s common in C++ to name member variables with some kind of prefix to denote the fact that they’re member variables, rather than local variables or parameters. If you’ve come from an MFC background, you’ll probably use m_foo. I’ve also seen myFoo occasionally. C# (or possibly just .NET) seems to recommend using just an underscore, … Read more