Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

variable conventions in ruby  RSS feed

 
Pradeep bhatt
Ranch Hand
Posts: 8933
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
Sheriff
Posts: 24215
37
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: 8933
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
Boost this thread!