naming

Why can't file names in the drawable folder contain special characters or start with a capital letter?

拟墨画扇 提交于 2019-12-04 02:55:59
问题 Is there a point to these rules? 回答1: Each file inside folder is translated into java field name inside R.java class: drawable\icon.png -> R.drawable.icon Hence the reason for not using special characters inside file names, as they can no be used in Java names. As for capital letters, I guess that's to avoid one little problem in Windows vs. Linux environment. That's because Linux thinks that Icon.png and icon.png are different files, and Windows thinks that Icon.png and icon.png is the same

Naming: solution, projects, namespaces and assemblies

亡梦爱人 提交于 2019-12-04 00:14:24
I'm working on naming guidelines for solutions, projects, their default namespaces and assemblies (Visual Studio). Now it looks like that: For example, we have a company named "Company" and a project named "Project". The project has business logic in separate dll, UI (WPF/WinForms) and a web part. There are names of things listed in the question title: Solution name: "Project". Business logic dll project name: "Project", default namespace: "Company.Project", assembly name: "Project". UI project name: "ProjectUI", default namesapce: "Company.Project.UI" (it can be extended in case of multiple

What are the valid characters for a Java method name?

ε祈祈猫儿з 提交于 2019-12-03 13:11:24
I read about the naming of Java variables . It says that Java variables cannot start with any numbers and special characters except for $ and _. Some valid examples: int count; int _count; int $count; And some invalid examples: int %count; int 4count; int #count; Do the same rules apply to method names? Yes, method names and variable names are what's called "identifiers". Identifiers all share the same rules regarding accepted characters. Take a look at §3.8 from the Java Language Specification to find out exactly what an identifier may contain, and §6.2 for an explanation about how

Programmers dictionary/lexicon for non native speakers

白昼怎懂夜的黑 提交于 2019-12-03 10:14:39
I'm not an English speaker, and I'm not very good at English. I'm self thought. I have not worked together with others on a common codebase. I don't have any friends who program. I don't work with other programmers (at least nobody who cares about these things). I guess this might explain some of my problems in finding good unambiguous class names. I have tried to find some sort of "Programmers dictionary" containing words often used and their meanings. When reading others code I have to look up words quite often, and as many use abbreviations this poses an additional challenge. My very

Is using “is” to name Boolean variables bad practice?

天大地大妈咪最大 提交于 2019-12-03 09:24:58
Is naming Booleans that start with "is" bad practice now? My manager believes that "isAnything" is outdated and poor practice. Is this true? myManager.isLame ? correct() : incorrect(); It's used quite often in a lot of languages, but I don't know if it can be said with certainty that it's the preferred method. I think consistency and everyone on a given team using the same standards/styles is the important thing to bear in mind. I would not use any hard and fast rules here. Although I find a prefix such as 'Is' useful in identifying a boolean property, there are many cases where 'Is' would not

Android activity naming

自古美人都是妖i 提交于 2019-12-03 08:40:35
问题 I'm running into more and more naming clashes between Android activities and other classes. I was wondering if you could tell me how you avoid these. Sadly, my particular naming problems are not covered in the related questions on SO. First example I have an activity that displays a level of the game. However, the data required for that level (background artwork, entities etc.) is stored in a separate class. Naturally, I would call the latter class Level . However, I would call the activity

iPhone Application Name Availability

試著忘記壹切 提交于 2019-12-03 06:20:41
问题 Is there a way to check whether an iphone application name is available to use? Would a search on iTunes and checking to see if there is an existing application already out there be indicative that an iphone application name is available to use or not? 回答1: As pointed out here, even if you search the traditional channels, there may still be someone who has claimed that same name but not submitted an application yet. If you wish to truly test this out, it sounds like you can start the process

Renaming SVN repository project name

放肆的年华 提交于 2019-12-03 04:14:04
问题 I have migrated a project from CVS to SVN. Now I need to rename that project. What can be the best possible way to rename it, keeping the all the history intact. The project folder contains some 100 numbers of C and its header files. 回答1: There is no built-in mechanism in Subversion to rename a repository. The best option in order to maintain integrity and history is to perform a repository dump of the old repository and then re-import the dump into a new repository. I wrote a post about this

Is the word “Helper” in a class name a code smell?

旧时模样 提交于 2019-12-03 04:08:14
问题 We seems to be abstracting a lot of logic way from web pages and creating "helper" classes. Sadly, these classes are all sounding the same, e.g ADHelper, (Active Directory) AuthenicationHelper, SharePointHelper Do other people have a large number of classes with this naming convention? 回答1: I would say that it qualifies as a code smell, but remember that a code smell doesn't necessarily spell trouble. It is something you should look into and then decide if it is okay. Having said that I

What are the different kinds of cases?

删除回忆录丶 提交于 2019-12-03 03:31:06
问题 I'm interested in the different kinds of identifier cases, and what people call them. Do you know of any additions to this list, or other alternative names? myIdentifier : Camel case (e.g. in java variable names) MyIdentifier : Capital camel case (e.g. in java class names) my_identifier : Snake case (e.g. in python variable names) my-identifier : Kebab case (e.g. in racket names) myidentifier : Flat case (e.g. in java package names) MY_IDENTIFIER : Upper case (e.g. in C constant names) 回答1: