Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

variable conventions in ruby

 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was reading a tutorial on Ruby which talks about variable name conventions such a class name variable must start with "@@". Why is this required .. why not let the developer to take the decision?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Java, you always declare variables, and you use "static" to make something a class variable. In Ruby, you don't declare things, and you use naming conventions to tell Ruby what kind of a thing it is. Just how it works.
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
gao zhixin
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Ruby's name convention is better than Java
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic