0
  1. What would be the way to have java-style annotations in Ruby and in C++?

(Optionally, perhaps it is a matter of taste)

  1. Are java-style annotations worth to be used, so you would recomend using them in other languages, if possible?
cibercitizen1
  • 20,944
  • 16
  • 72
  • 95
  • 4
    What is the problem you are trying to solve? Right now you have told us what the answer in Java is (Annotations), but you have not told us the question. In order to tell you what the answer in Ruby is, we *need* to know what the question is! IOW: what is the problem that you are solving with Annotations in Java that you also want to solve in Ruby? – Jörg W Mittag Jul 01 '10 at 09:58
  • The question is how to simulate java-like annotations in Java. I found the answer. I'm posting it in a separate question. – cibercitizen1 Jul 01 '10 at 11:47
  • 2
    For what purpose? The best way to accomplish whatever you're trying to ultimately accomplish may be something other than directly simulating a Java feature. Your question is like, "What would be the best way to install a screw with a hammer?" The best answer may be to give up your insistence on using a hammer and use a screwdriver instead. – Tyler McHenry Jul 01 '10 at 12:16
  • Think it this way. Java has annotations and many java programmer find they are useful. They are intensively being used in many frameworks related to java-enterprise. Then, in Ruby, we would have two choices: 1. How to mimic java-annotations in Ruby? 2. Considering that java annotations add semantic information to a class, method, or variable to be checked later by the compiler or at run time. Do we need it in ruby? If so, what's the natural way to do in Ruby, if any, other than way of 1.? By the moment I'm more concerned in 1, to gain knowledge for 2. – cibercitizen1 Jul 01 '10 at 14:08

1 Answers1

-1

Java-like annotations in Ruby

How to simulate Java-like annotations in Ruby?

But, in C++?

Community
  • 1
  • 1
cibercitizen1
  • 20,944
  • 16
  • 72
  • 95
  • I just can't understand the downvote. I think the matter is interesting and I link to a question of my own where I gave an answer, but I honestly finally accepted a better answer by another guy (Jörg W Mittag). – cibercitizen1 Jul 01 '10 at 22:10
  • 2
    For Java-like annotations in C++, see here: http://stackoverflow.com/questions/4689756/java-like-annotations-in-c – Anderson Green Oct 05 '12 at 20:37