Click here to Skip to main content
15,911,531 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I just recently learned about Quine programs today in my CS class. I understand that they are programs meant to output there own source code, or "self-reproduce". But what I don't get is, besides being a good test of coding ability and logic, whats the point? Can these types of programs be used in real life situations or are they simply for fun?

Are they applicable to the real word?

What I have tried:

Asking on Stack Overflow...and everyone was a jerk about it. I'm genuinely interested.
Posted
Updated 3-Nov-16 9:48am
Comments
[no name] 3-Nov-16 14:15pm    
Never seen or had the occasion to know of anyone using such a thing outside of a programming class.

As far as I know they are useful in real life applications only rarely. I can envision a scenario where you have a code generating app that compiles on the fly. It would be useful to include a module by invoking it and having it write its output that can then be compiled into a stand-alone executable module.

Admittedly, this is a very contrived, theoretical example because that's the only possible use I can think of for them beyond fun and games.
 
Share this answer
 
Google is the best place for such questions: Quine programs - Google Search[^].
 
Share this answer
 
Comments
mooseman55 3-Nov-16 14:16pm    
I mean I understand them and how they work, I'm just looking for real life examples.
Richard MacCutchan 3-Nov-16 14:18pm    
Yes, and Google has lots of them.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900