naming-conventions

Best practices in naming conventions on Maven artifactID (is there restriction?)

廉价感情. 提交于 2019-12-03 04:44:12
问题 My team is new to Maven and we haven't been able to find any definitive guidance on selecting artifactIDs for our projects. I know that the Guide to naming conventions says that artifactIDs should be "whatever name you want with lowercase letters and no strange symbols" but some folks in my group want to use the reverse domain name style for both groupIDs and artifactIDs. Based on the above-mentioned guidelines plus all the examples that I've seen in the central repository I don't think it

To foo bar, or not to foo bar: that is the question

不打扰是莪最后的温柔 提交于 2019-12-03 04:24:01
This was something originally discussed during a presentation given by Charles Brian Quinn of the Big Nerd Ranch at acts_as_conference . He was discussing what he had learned from instructing a Ruby on Rails Bootcamp to many people both new to programming and new to Rails. One particular slide that stood out was along the lines of never using foo and bar as examples when trying to teach someone to program . His reasoning was very simple. Which is easier to understand? baz = foo + bar or answer = first_number + second_number It's happened many times myself when explaining something and I

How to build executable with name other than Golang package

﹥>﹥吖頭↗ 提交于 2019-12-03 04:20:42
Is it possible to build (install, go get, etc) an executable with the name foobar if my Golang package name is one of the following: github.com/username/go-foobar github.com/username/foobar-tools and has main.go in the package root? Craig Kelly You can specify the executable name using the -o switch with go build . For your example it would look something like: cd $GOPATH/github.com/username/go-foobar && go build -o foobar . However, you're just left with the executable in the package's folder -- you still need to install it somehow. However, I don't know of any way to specify that for someone

When is a function name too long?

偶尔善良 提交于 2019-12-03 04:20:01
I try to be rather descriptive with my function names, where possible. This occasionally results in function names in the twenty to thirty character range such as "GetActionFromTypeName" or "GetSelectedActionType". At what point do functions get too long to manage (not too long for the compiler)? If there's a shorter, but yet descriptive way to name the function, then the function name is too long. When you can't read them aloud anymore without taking a breath in the middle =D A function name is too long when it starts to either over-describe what it does, or when it hinders readability of the

C library naming conventions

こ雲淡風輕ζ 提交于 2019-12-03 03:53:18
问题 Introduction Hello folks, I recently learned to program in C! (This was a huge step for me, since C++ was the first language, I had contact with and scared me off for nearly 10 years.) Coming from a mostly OO background (Java + C#), this was a very nice paradigm shift. I love C. It's such a beautiful language. What surprised me the most, is the high grade of modularity and code reusability C supports - of course it's not as high as in a OO-language, but still far beyond my expectations for an

Does functional programming mandate new naming conventions?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 03:36:13
问题 I recently started studying functional programming using Haskell and came upon this article on the official Haskell wiki: How to read Haskell. The article claims that short variable names such as x , xs , and f are fitting for Haskell code, because of conciseness and abstraction. In essence, it claims that functional programming is such a distinct paradigm that the naming conventions from other paradigms don't apply. What are your thoughts on this? 回答1: In a functional programming paradigm,

Should we use prefixes in our database table naming conventions?

六眼飞鱼酱① 提交于 2019-12-03 03:32:29
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 case we are using a table's name in the code, so to not confuse them with variables, attributes, etc. But

Storyboard Segue Identifier naming conventions

我与影子孤独终老i 提交于 2019-12-03 03:28:00
问题 I'm building a large storyboard and I was wondering if anyone has come up with helpful naming conventions for segue identifiers . It looks like Apple just uses 'ShowX' in their examples where X is the name of the view it is showing. So far I prefer to use 'PushX' or 'ModalX' to keep track of which type of transition it is. Anyone have any other tricks or tips? 回答1: There is no correct answer for this question. It depends on taste. I mitigate for readability. Don't be shy to give a long name

Naming convention for a C# Dictionary

丶灬走出姿态 提交于 2019-12-03 03:25:52
问题 How do we name a dictionary variable? Say in my method I have Dictionary<string, List<string>> dictionary; , where the keys of the dictionary are country names and the values are lists of province/state names. How should I rename dictionary ? I know we can create a Country class for this example. But please don't mention this alternative because I'm thinking of good naming convention here. 回答1: ProvincesByCountry 回答2: I use mostly one of these: CountryToStatesDictionary CountryToStatesMap

Maven naming conventions for hierarchical multiple module projects

余生长醉 提交于 2019-12-03 03:04:47
问题 I've got a question on Maven naming conventions (groupId, artifactId and directory names) in a multiple module project with a hierarchical directory structrure. Research Before asking, I went through other the web on this topic and what I cleared out for myself: Possible duplication for my question, but it does not cover multiple-hierarchy levels. Project directory name should match artificatId. Guide to Naming Conventions provide examples: groupId will identify your project uniquely across