What is the convention for word separator in Java package names?

All three are not the conventions. Use com.stackoverflow.mypackage. The package names do not follow camel casing or underscores or hyphens package naming convention. Also, Google Java Style Guide specifies exactly the same (i.e. com.stackoverflow.mypackage) convention: 5.2.1 Package names Package names are all lowercase, with consecutive words simply concatenated together (no underscores). For example, com.example.deepspace, not … Read more

C# naming convention for constants?

The recommended naming and capitalization convention is to use PascalCasing for constants (Microsoft has a tool named StyleCop that documents all the preferred conventions and can check your source for compliance – though it is a little bit too anally retentive for many people’s tastes). e.g. private const int TheAnswer = 42; The Pascal capitalization … Read more

Why are exclamation marks used in Ruby methods?

In general, methods that end in ! indicate that the method will modify the object it’s called on. Ruby calls these as “dangerous methods” because they change state that someone else might have a reference to. Here’s a simple example for strings: foo = “A STRING” # a string called foo foo.downcase! # modifies foo … Read more

What’s the name for hyphen-separated case?

There isn’t really a standard name for this case convention, and there is disagreement over what it should be called. That said, as of 2019, there is a strong case to be made that kebab-case is winning: https://trends.google.com/trends/explore?date=all&q=kebab-case,spinal-case,lisp-case,dash-case,caterpillar-case spinal-case is a distant second, and no other terms have any traction at all. Additionally, kebab-case has … Read more

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

For me is better to have a schema that you can map directly to code (easy to automate), mainly because code is what is going to be at both ends. GET /orders <—> orders POST /orders <—> orders.push(data) GET /orders/1 <—> orders[1] PUT /orders/1 <—> orders[1] = data GET /orders/1/lines <—> orders[1].lines POST /orders/1/lines <—> … Read more

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

_ 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 the standard CPython interpreter, and other interpreters have followed suit For translation lookup in i18n (see the gettext documentation for example), as in code like raise … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)