I
I
Ivan Balaksha2015-04-08 19:27:53
Java
Ivan Balaksha, 2015-04-08 19:27:53

Do I need to prefix variable and class names?

From time to time I come across a class name like IClassName - the first letter I denotes an interface. The clean code mentioned this and kind of thought it was wrong.
I don't see any point in using the letter m in variable names.
What do you think about this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
asd111, 2015-04-08
@tagantroy

This is not accepted in java. Usually just the name of a class or interface.
Those. just ClassName regardless of whether it is an interface or a class.
variables are just someVariable without prefixes, etc.

D
Dmitry Chernysh, 2015-04-11
@Dmitrich

Read the code style guidelines source.android.com/source/code-style.html#java-lan... . Classes do not need a prefix, field names do.
Non-static, non-public fields start with "m",
static fields start with "s",
constants - in uppercase without prefixes, the
rest - whatever you want, starting with a lowercase letter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question