writing a few lines of comments that work in most languages
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
the idea is to be able to attach a small amount of data to a file that in the context of the file, does not affect the file, but can still be recognized as being there, extracted, decoded, (if needed), etc.
Well that's not "comments".
Comments are there to aid the code, not to be taken out, decoded, or have zero impact to the file. Yes they have zero impact to the parser, that's the intent and definition of a comment. Instead you're proposing something like markup language.
Reading this makes me feel the same as that user who is continually inventing their own language for years.
But uuencode does exist, and if you were trying to reinvent it we'd tell you to use base64.
at least you wouldn't be saying that uuencode could be better than base64.
Quote:
Originally Posted by dugan
Are you being deliberately vague (to avoid revealing proprietary information, or because you don't want your idea stolen, or whatever), or is this actually how well-formed and specific your idea actually is?
i try to express my questions in a way to keep the discussion on topic. when i put more details out there, many people avoid the topic and focus where they should not.
Quote:
Originally Posted by dugan
(Earlier, I actually stopped myself from wondering out loud if you this was a scheme to hide your porn collection).
Comments are there to aid the code, not to be taken out, decoded, or have zero impact to the file. Yes they have zero impact to the parser, that's the intent and definition of a comment. Instead you're proposing something like markup language.
call it "markup" if you want. if you know another way to get the language to be compiled with no effect for that, then i'd to have you say how. in the mean time, having information disguise itself as a comment (while revealing to certain tools) achieves the goal. an archive tool could also do this except that the goal is for the goal is for zero impact whether the added "faked" code is removed or remains in place.
i try to express my questions in a way to keep the discussion on topic. when i put more details out there, many people avoid the topic and focus where they should not.
Oh, so it's deliberate? And you kept it up after, *checks* over three weeks of everyone telling you that they have no idea what you're talking about?
This isn't working, and I've wasted enough time with this.
i want to write some reasonably arbitrary text as comments to be prepended and/or appended to source code for most languages or all major languages used in BSD or Linux the code that will write this commented text will not know which language it is, or get to even see the code that the comments will be attached to for to guess the language.
Quote:
Originally Posted by Skaperen
i don't know Java. if knowing that has value in the context of this thread, maybe you can explain more.
Java is definitely a major language, it looks like you need to be familiar with it.
Quote:
Originally Posted by rtmistler
Well that's not "comments".
Comments are there to aid the code, not to be taken out, decoded, or have zero impact to the file. Yes they have zero impact to the parser, that's the intent and definition of a comment.
Comments [can be] used to [auto]generate documentation and also pass options/flags to different linters, analyzers and other tools working on the code.
(but I still don't understand what is it all about)
(but I still don't understand what is it all about)
Skaperen made sure that you did not know what it was about, because he wants to keep the thread on topic. If you knew what it was about, then you would avoid the topic and focus on what you should not.
The vagueness of your question and lack of useful additional info has left others, myself included still guessing as to what your actual use case is. Clearly this is beginning to annoy some who have taken time to reply and have received no clarification, all of whom it seems have participated in good faith (and thanks to all), so I think it is time to either provide some useful information, or call it a day for this thread.
I ask you to please review the Site FAQ for guidance in asking well formed questions. Especially visit the link from that page, How to Ask Questions the Smart Way for discussion of things to consider when asking others for help.
After doing so please reformulate your question (in this thread for continuity), preferably providing a specific example of data you wish to include in your not-really-a-comment (for want of a better term) and an example or two of how you would want that to be inserted into some particular language familiar to yourself and others, and explain why simply including it as a comment does not work for you, in order to illustrate your goal. Otherwise, let's all let this thread fade into the mists.
Going back to the original problem: what have you done so far and where are you stuck? Do you still have any open questions?
i have done nothing more than just think about the "problem" which initially is trying to find if there is a way to tag a source file more directly than trying to define a container for the content and the tag. i could do this by using what each language defines as a comment. but my program would have to know or detect which language it is. a common way that spans many of today's languages would be the answer. and this can be put in front or behind the file, simplifying how this could be designed (insert in the middle could be more complex). i am "stuck" thinking about it. i have thought about it a few times over the years. i'm about to give up on it and do a container.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.