naming-conventions

How should I name a java.util.Map? [closed]

℡╲_俬逩灬. 提交于 2019-12-03 06:26:31
问题 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 7 months ago . I have a java.util.Map that maps from a logical name to a set of parameters to use with that name. Map<String,Parameters> howShouldINameThee = ...; What is the best name for this map? Should I go simple and just call this parameters or parametersMap ? Do I include

How important are naming conventions for getters in Java?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 06:23:21
I’m a huge believer in consistency, and hence conventions. However, I’m currently developing a framework in Java where these conventions (specifically the get / set prefix convention) seem to get in the way of readability. For example, some classes will have id and name properties and using o.getId() instead of o.id() seems utterly pointless for a number of reasons: The classes are immutable so there will (generally) be no corresponding setter, there is no chance of confusion, the get in this case conveys no additional semantics, and I use this get -less naming schema quite consistently

Haskell module naming conventions

旧巷老猫 提交于 2019-12-03 06:23:08
问题 How should I name my Haskell modules for a program, not a library , and organize them in a hierarchy ? I'm making a ray tracer called Luminosity. First I had these modules: Vector Colour Intersect Trace Render Parse Export Each module was fine on it's own, but I felt like this lacked organization. First, I put every module under Luminosity , so for example Vector was now Luminosity.Vector (I assume this is standard for a haskell program?). Then I thought: Vector and Colour are independent and

Are classes in Python in different files?

雨燕双飞 提交于 2019-12-03 06:20:51
问题 Much like Java (or php), I'm use to seperating the classes to files. Is it the same deal in Python? plus, how should I name the file? Lowercase like classname.py or the same like ClassName.py? Do I need to do something special if I want to create an object from this class or does the fact that it's in the same "project" (netbeans) makes it ok to create an object from it? 回答1: In Python, one file is called a module. A module can consist of multiple classes or functions. As Python is not an OO

Naming convention JUnit suffix or prefix Test [closed]

时间秒杀一切 提交于 2019-12-03 06:13:42
问题 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 . Class under test MyClass.java JUnit test case name alternatives: TestMyClass.java MyClassTest.java http://moreunit.sourceforge.net seems to use "Test" as prefix default but I have seen both uses. Both seems to be recognized when running the entire project as unit test in

How to name a HashMap in Java?

半城伤御伤魂 提交于 2019-12-03 06:12:05
问题 This might be a silly question, but I have never found a satisfying way to name a variable of type HashMap<K,V> in Java. For example - lets say I have a HashMap where every bucket is a <K,V> pair where K is a String say representing "State" and V is an Integer representing the number of counties the state has. Should the HashMap be named as " mapStateCounty ", " stateToCountyMap ", etc. ? Which one seems logically more appealing and intuitive to understand without sounding confusing and

.htm or .html extension - which one is correct and what is different?

不羁岁月 提交于 2019-12-03 06:11:17
问题 When I save a file with an .htm or .html extension, which one is correct and what is different? 回答1: Neither is wrong, it's a matter of preference. Traditionally, MS software uses htm by default, and *nix prefers html . As oded pointed out below, the .htm tradition was carried over from win 3.xx, where file extensions were limited to three characters. 回答2: Mainly, the number of characters is different. ".htm" smells of Microsoft operating systems where the file system historically limited

Best Practice: How to Structure Arrays - Standards and Naming Conventions [closed]

时光毁灭记忆、已成空白 提交于 2019-12-03 06:02:57
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . What is the best practice in multidimensional array structure in terms of what elements hold the iterator vs the detail elements? The

Are there established alternatives to ISomething / ISomethingable for interfaces?

独自空忆成欢 提交于 2019-12-03 05:59:42
The .NET standard of prefixing an interface name with an I seems to be becoming widespread and isn't just limited to .NET any more. I have come across a lot of Java code that uses this convention (so it wouldn't surprise me if Java used it before C# did). Also Flex uses it, and so on. The placing of an I at the start of the name smacks of Hungarian notation though and so I'm uncomfortable with using it. So the question is, is there an alternative way of denoting that Something is an interface, rather than a class and is there any need to denote it like this anyway. Or is it a case its become a

Is there a difference between int *x and int* x in C++? [duplicate]

十年热恋 提交于 2019-12-03 05:53:22
This question already has an answer here : Difference between char* var; and char *var;? [duplicate] (1 answer) I'm getting back into my C++ studies, and really trying to understand the basics. Pointers have always given me trouble, and I want to make sure I really get it before I carry on and get confused down the road. Sadly, I've been stymied at the very outset by an inconsistency in the tutorials I'm reading. Some do pointer declarations this way: int *x and some do it this way: int* x Now the former of the two seems to be by far the most common. Which is upsetting, because the second