• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is dom?

 
Serap Elbeyoglu
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Can anyone tell "dom" basically?

For example, now I am writing:


/** List the days in each month */

public final static int dom[] = {

31, 28, 31, /* jan, feb, mar */
30, 31, 30, /* apr, may, jun */
31, 31, 30, /* jul, aug, sep */
31, 30, 31 /* oct, nov, dec */ }

Why am I writing "dom" keyword?
 
Henry Wong
author
Marshal
Pie
Posts: 21016
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
serap elbeyoglu wrote:
Why am I writing "dom" keyword?


If I had to guess, I'll say you picked "dom" because it is short for "days of month"?

Henry
 
Serap Elbeyoglu
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



it is short for "days of month"?

Henry

Henry, thank you for your attention, but I think it isn't true. Because I feel that dom is a keyword of Java. (int [] sample.dom) Why do we need to use it ? What do you say? Do you think my question is clear?

Thank you.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not a "keyword of java". It's just a variable name. It could be fred, or shoomp, or jasgdjhgdasjh or anything else that's an identifier. It's just a variable name.
 
Henry Wong
author
Marshal
Pie
Posts: 21016
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote: It could be fred


How about "Find the Real End Day"? ...

Henry
 
Serap Elbeyoglu
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your helps guys, I've got the point
 
Ulrika Mingle
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
serap elbeyoglu wrote:Thank you for your helps guys, I've got the point


You can think of it as Don't Overdo Meaning
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15216
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This makes me think of a story that a colleague once told me. He had been a programmer long ago, in the 1970's. He told me that they always used two- or three-letter variable names, like "a1", "a2", "a3" etc., and they would have a table on paper somewhere that would explain what each variable was used for. Maybe that was necessary in the 1970's, when computers had a very limited amount of memory and were much slower than the chip in your cell phone...

It's very important to choose good and clear variable names. A name like daysPerMonth would have been much better than something like dom. Choosing good variable names makes it much easier to understand and maintain code.
 
Serap Elbeyoglu
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't Overdo Meaning

Thank you Jesper, it is a very clear explanation. Here is a good tip for java variables: Choose clear variable names for you programing process. AgeOfChildren is a better variable name than AOC. T

Thank you. At this point I want to ask "Why do we use variables?" My answer is that: "Serap, you can think variables are like tools in your kitchen. You have them to cook. The names of them is not so important. But, if you label them with good names according to their function, you would make jour job fast and easy. The important point is that how you will define and use them." Did I understand variables?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic